From e.i at bluewin.ch Thu Aug 2 02:53:35 2007 From: e.i at bluewin.ch (Emanuel =?ISO-8859-1?Q?Inderm=FChle?=) Date: Thu, 02 Aug 2007 08:53:35 +0200 Subject: [Rake-devel] List of Files as prerequisits In-Reply-To: References: <1185880821.16157.19.camel@localhost> Message-ID: <1186037615.9779.8.camel@localhost> Hi zimbatm Thanks for your answer. I did it this way, and it worked very well. best regards emanuel Am Dienstag, den 31.07.2007, 16:51 +0200 schrieb Jonas Pfenniger: > Hi Emanuel, > > your problem (I think) is that you are relying on the execution order > of your task's dependencies. Here is a snippet that should work : > > file "letter.txt" do > #generate "letter.txt" somehow > end > > task :ensure_hmms => "letter.txt" do > (File.read('letter.txt').split("\n") - FileList['*.hmm']).each do | > missing_hmm| > sh :touch, missing_hmm > end > end > > task :combineFiles=>:ensure_hmms do > #do something with the files > end > > -- > Cheers, > zimbatm > _______________________________________________ > Rake-devel mailing list > Rake-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rake-devel From e.i at bluewin.ch Wed Aug 8 06:44:00 2007 From: e.i at bluewin.ch (Emanuel =?ISO-8859-1?Q?Inderm=FChle?=) Date: Wed, 08 Aug 2007 12:44:00 +0200 Subject: [Rake-devel] rule does not look for every source Message-ID: <1186569840.11818.12.camel@localhost> Hello I tried to make a Rakefile to generate pdf from latex sources: ---------------------Rakefile-------------------- $file = "latexproject" rule ".aux" => [".tex"] do | t | sh "latex #{t.name.chomp(".aux")}" end rule ".toc" => [".aux"] rule ".dvi" => [".toc",".blg",".bbl"] do | t | sh "latex #{t.name.chomp(".dvi")}" end rule ".bbl" => [".aux",".bib"] do | t | sh "bibtex #{t.name.chomp(".bbl")}" end rule ".blg" => [".bbl"] rule ".pdf" => [".dvi"] do | t | sh "pdflatex #{t.name.chomp(".pdf")}" end task :pdf => [$file+".pdf"] ---------------------end rakefile--------------- It seams that for generating ".dvi" rake only seems to need ".toc" but not the other sources. -------------------console output---------------- emanuel at laptop$ rake -n pdf /usr/bin/rake:17:Warning: require_gem is obsolete. Use gem instead. (in /home/emanuel/office/Hilfsassistenz1/sub-and-optimal-GM) ** Invoke pdf (first_time) ** Invoke optimal_and_suboptimal_gm.pdf (first_time) ** Invoke optimal_and_suboptimal_gm.dvi (first_time) ** Invoke optimal_and_suboptimal_gm.toc (first_time) ** Invoke optimal_and_suboptimal_gm.aux (first_time) ** Invoke optimal_and_suboptimal_gm.tex (first_time, not_needed) ** Execute (dry run) optimal_and_suboptimal_gm.aux ** Execute (dry run) optimal_and_suboptimal_gm.toc ** Execute (dry run) optimal_and_suboptimal_gm.dvi ** Execute (dry run) optimal_and_suboptimal_gm.pdf ** Execute (dry run) pdf ----------------------end console output---------- I think there is a bug in the rake.rb file on line 1592 of the rake version 0.7.3 ------------------rake.rb:1592------------------ prereqs = sources.collect { |source| if File.exist?(source) || Rake::Task.task_defined?(source) source elsif parent = enhance_with_matching_rule(sources.first, level+1) <--- parent.name else return nil end } ------------------end rake.rb:1592----------------- it think it should be ------------------rake.rb.patched:1592------------------ prereqs = sources.collect { |source| if File.exist?(source) || Rake::Task.task_defined?(source) source elsif parent = enhance_with_matching_rule(source, level+1) <--- parent.name else return nil end } ------------------end rake.rb.patched:1592----------------- It worked for me with this patch best regards emanuel From kim.toms at gmail.com Tue Aug 28 22:23:08 2007 From: kim.toms at gmail.com (Kim Toms) Date: Tue, 28 Aug 2007 22:23:08 -0400 Subject: [Rake-devel] Patches to fix [607] test failures Message-ID: <1513b3110708281923n329e0000x645d0138f481128d@mail.gmail.com> This does not have anything to do with the functional tests; only the ones run by 'rake' in the checkout directory. I include the text of the patch; the patch as an attachment, and the results of running 'rake' on my system. PATCH TEXT: Index: test/test_filelist.rb =================================================================== --- test/test_filelist.rb (revision 607) +++ test/test_filelist.rb (working copy) @@ -196,11 +196,11 @@ def test_to_s_pending fl = FileList['testdata/abc.*'] - assert_equal %{testdata/abc.c testdata/abc.h testdata/abc.x}.sort, fl.to_s.sort + assert_equal %{testdata/abc.c testdata/abc.h testdata/abc.x}, fl.sort.to_s end def test_inspect_pending - fl = FileList['testdata/abc.*'] + fl = FileList['testdata/abc.*'].sort assert_equal %{["testdata/abc.c", "testdata/abc.h", "testdata/abc.x"]}, fl.inspect end Index: lib/rake.rb =================================================================== --- lib/rake.rb (revision 607) +++ lib/rake.rb (working copy) @@ -1799,6 +1799,8 @@ "Display the tasks (matching optional PATTERN) with descriptions, then exit."], ['--trace', '-t', GetoptLong::NO_ARGUMENT, "Turn on invoke/execute tracing, enable full backtrace."], + ['--usage', '-u', GetoptLong::NO_ARGUMENT, + "Print single line usage message"], ['--verbose', '-v', GetoptLong::NO_ARGUMENT, "Log message to standard output (default)."], ['--version', '-V', GetoptLong::NO_ARGUMENT, -------------------------------------------- Results of runnign 'rake:' on version 607 with this patch kim at dreg:~/ruby/rake$ svn update At revision 607. kim at dreg:~/ruby/rake$ rake (in /home/kim/ruby/rake) UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.3 /lib/rake/rake_test_loader Started ..................................................................................................................................................................................................................................................................................................... Finished in 9.703078 seconds. 293 tests, 821 assertions, 0 failures, 0 errors kim at dreg:~/ruby/rake$ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20070828/71d29217/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.rake Type: application/octet-stream Size: 1294 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20070828/71d29217/attachment.obj