From Daniel.Berger at qwest.com Fri Feb 2 17:40:00 2007 From: Daniel.Berger at qwest.com (Daniel Berger) Date: Fri, 02 Feb 2007 15:40:00 -0700 Subject: [Rake-devel] [PATCH] clean.rb, directories Message-ID: <45C3BDC0.5070700@qwest.com> Hi, This is a patch for the clean task, so that it only deletes files, not directories. --- clean.orig Fri Feb 2 15:30:56 2007 +++ clean.rb Fri Feb 2 15:35:18 2007 @@ -20,7 +20,10 @@ desc "Remove any temporary products." task :clean do - CLEAN.each { |fn| rm_r fn rescue nil } + CLEAN.each { |fn| + next if File.directory?(fn) + rm_r fn rescue nil + } end CLOBBER = Rake::FileList.new This addresses an earlier email where someone brought up the fact that "rake clean" deletes a directory named 'core', not just core files. Since I hit it myself recently, I figure I should submit a patch. :) Regards, Dan From jim at weirichhouse.org Sun Feb 4 21:51:34 2007 From: jim at weirichhouse.org (Jim Weirich) Date: Sun, 04 Feb 2007 21:51:34 -0500 Subject: [Rake-devel] Incresing GemPackageTask Efficiency In-Reply-To: <4b6f054f0701310725l1827d0d0q9f002bd2a03b2dcf@mail.gmail.com> References: <4b6f054f0701310725l1827d0d0q9f002bd2a03b2dcf@mail.gmail.com> Message-ID: <45C69BB6.6000509@weirichhouse.org> TRANS wrote: > Note the difference in 'platform' and more importantly 'files'. The > GemPackageTask would work those out and build the GemSpec at runtime > rather then definition time. Thanks for the idea. I see your point. I'm going to ponder this for a bit. -- Jim Weirich From jim at weirichhouse.org Sun Feb 4 21:52:58 2007 From: jim at weirichhouse.org (Jim Weirich) Date: Sun, 04 Feb 2007 21:52:58 -0500 Subject: [Rake-devel] Observer mode: new option --observe In-Reply-To: <45C0F961.4050009@rubychan.de> References: <45C0F961.4050009@rubychan.de> Message-ID: <45C69C0A.3010402@weirichhouse.org> murphy wrote: > hi list! > > I've implemented a new feature to Rake that seems very useful to me. > > You can use the --observe (-O) option and an optional interval to start > Rake in an endless loop, like this: > > % rake -O compile What an interesting idea. Let me mull this over a bit, but I very well may work this into the system. Thanks. -- -- Jim Weirich jim at weirichhouse.org http://onestepback.org -- In theory, practice and theory are the same. -- In practice, they are different. From jim at weirichhouse.org Sun Feb 4 21:55:35 2007 From: jim at weirichhouse.org (Jim Weirich) Date: Sun, 04 Feb 2007 21:55:35 -0500 Subject: [Rake-devel] [PATCH] clean.rb, directories In-Reply-To: <45C3BDC0.5070700@qwest.com> References: <45C3BDC0.5070700@qwest.com> Message-ID: <45C69CA7.1070004@weirichhouse.org> Daniel Berger wrote: > Hi, > > This is a patch for the clean task, so that it only deletes files, not > directories. [...] > This addresses an earlier email where someone brought up the fact that > "rake clean" deletes a directory named 'core', not just core files. > Since I hit it myself recently, I figure I should submit a patch. :) Thanks for the suggestion. However, prohibiting CLEAN from deleting directories feels like it is cutting off the arm to fix a hangnail. CLEAN should be able to delete any temporary files created during a build process, and that might include directories. I would rather see a solution targeted explicitly at the "core" directory issue. Thanks Daniel. -- Jim Weirich From transfire at gmail.com Sun Feb 4 22:39:13 2007 From: transfire at gmail.com (TRANS) Date: Sun, 4 Feb 2007 22:39:13 -0500 Subject: [Rake-devel] [PATCH] clean.rb, directories In-Reply-To: <45C69CA7.1070004@weirichhouse.org> References: <45C3BDC0.5070700@qwest.com> <45C69CA7.1070004@weirichhouse.org> Message-ID: <4b6f054f0702041939h6c2b6096lfda66e2822bc57f2@mail.gmail.com> On 2/4/07, Jim Weirich wrote: > Daniel Berger wrote: > > Hi, > > > > This is a patch for the clean task, so that it only deletes files, not > > directories. > [...] > > This addresses an earlier email where someone brought up the fact that > > "rake clean" deletes a directory named 'core', not just core files. > > Since I hit it myself recently, I figure I should submit a patch. :) > > Thanks for the suggestion. However, prohibiting CLEAN from deleting > directories feels like it is cutting off the arm to fix a hangnail. > CLEAN should be able to delete any temporary files created during a > build process, and that might include directories. > > I would rather see a solution targeted explicitly at the "core" > directory issue. Perhaps it would be a good time to bring this up. In setting up my rake tasks I've sort of took the opposite approach to CLEAN and created IGNORE. When building, say a package, I just have it include everything but what's in IGNORE, so there's no need to run 'clean' first. T. From transfire at gmail.com Sun Feb 4 22:59:14 2007 From: transfire at gmail.com (TRANS) Date: Sun, 4 Feb 2007 22:59:14 -0500 Subject: [Rake-devel] Eleminating the need for repackage and rerdoc ? Message-ID: <4b6f054f0702041959oeff9755t3adaa7698213df38@mail.gmail.com> The PackageTask and the RdocTask both create re-renditions of the main task in order to force the creation of packages or rdocs that already exist. Personally, I just did Rake::Task['rerdoc'].comment = nil task :rdoc => [:clobber_rdoc] Perhaps that's considered dangerous for some reason? If so why not just ask the user if they're sure if they want to contiue or not? Another possibility. What about using a --force option on the command line to do a re-task. Example: $ rake rdoc rdocs at doc/ already exist. Use --force to rerdoc. $ rake rdoc --force ... Not sure, but it does seem kind of a waste to have two tasks that essentailly do the very same thing. Food for thought, T. From djberg96 at gmail.com Sun Feb 4 23:23:41 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 4 Feb 2007 21:23:41 -0700 Subject: [Rake-devel] [PATCH] clean.rb, directories In-Reply-To: <4b6f054f0702041939h6c2b6096lfda66e2822bc57f2@mail.gmail.com> References: <45C3BDC0.5070700@qwest.com> <45C69CA7.1070004@weirichhouse.org> <4b6f054f0702041939h6c2b6096lfda66e2822bc57f2@mail.gmail.com> Message-ID: <6037b70c0702042023n4b8a6cefoa3890fd38833a295@mail.gmail.com> On 2/4/07, TRANS wrote: > On 2/4/07, Jim Weirich wrote: > > Daniel Berger wrote: > > > Hi, > > > > > > This is a patch for the clean task, so that it only deletes files, not > > > directories. > > [...] > > > This addresses an earlier email where someone brought up the fact that > > > "rake clean" deletes a directory named 'core', not just core files. > > > Since I hit it myself recently, I figure I should submit a patch. :) > > > > Thanks for the suggestion. However, prohibiting CLEAN from deleting > > directories feels like it is cutting off the arm to fix a hangnail. > > CLEAN should be able to delete any temporary files created during a > > build process, and that might include directories. > > > > I would rather see a solution targeted explicitly at the "core" > > directory issue. > > Perhaps it would be a good time to bring this up. In setting up my > rake tasks I've sort of took the opposite approach to CLEAN and > created IGNORE. When building, say a package, I just have it include > everything but what's in IGNORE, so there's no need to run 'clean' > first. That seems like a reasonable suggestion, and I don't think it's mutually exclusive to dealing with directories named "core". We can do both. But, to deal with just the 'core' issue for now: --- clean.orig Sun Jun 06 00:51:00 2004 +++ clean.rb Sun Feb 04 21:22:10 2007 @@ -20,7 +20,11 @@ desc "Remove any temporary products." task :clean do - CLEAN.each { |fn| rm_r fn rescue nil } + CLEAN.each { |fn| + unless fn.downcase == 'core' && File.directory?(fn) + rm_r fn rescue nil + end + } end CLOBBER = Rake::FileList.new Regards, Dan From transfire at gmail.com Mon Feb 5 15:09:19 2007 From: transfire at gmail.com (TRANS) Date: Mon, 5 Feb 2007 15:09:19 -0500 Subject: [Rake-devel] backwards dependency? Message-ID: <4b6f054f0702051209s113e64bfi6ad8c688385c8814@mail.gmail.com> I'm confused. I'm trying to alter the dependencies of a premade rake task, and while it accepts it, it's actully running the dependcy after the task rather than before it. With this: Rake::GemPackageTask.new(spec) do |pkg| ... end # Don't show the clobber task, just always clobber when # creating packages. Maybe in future ask to make sure. Rake::Task['clobber_package'].comment = nil Rake::Task['repackage'].comment = nil task :package => [:clobber_package] Shouldn't it invoke clobber_package BEFORE package? I ran it with -- trace and it's clearly doing the opposite. What's up? Thanks, T. From transfire at gmail.com Tue Feb 6 16:04:07 2007 From: transfire at gmail.com (TRANS) Date: Tue, 6 Feb 2007 16:04:07 -0500 Subject: [Rake-devel] backwards dependency? In-Reply-To: <4b6f054f0702051209s113e64bfi6ad8c688385c8814@mail.gmail.com> References: <4b6f054f0702051209s113e64bfi6ad8c688385c8814@mail.gmail.com> Message-ID: <4b6f054f0702061304y59220dfbr467343c3a45d9852@mail.gmail.com> > Rake::GemPackageTask.new(spec) do |pkg| > ... > end > > task :package => [:clobber_package] No one can tell me why this isn't working? T. From jim at weirichhouse.org Sat Feb 10 14:40:26 2007 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 10 Feb 2007 14:40:26 -0500 Subject: [Rake-devel] backwards dependency? In-Reply-To: <4b6f054f0702051209s113e64bfi6ad8c688385c8814@mail.gmail.com> References: <4b6f054f0702051209s113e64bfi6ad8c688385c8814@mail.gmail.com> Message-ID: <45CE1FAA.5000704@weirichhouse.org> TRANS wrote: > I'm confused. I'm trying to alter the dependencies of a premade rake > task, and while it accepts it, it's actully running the dependcy after > the task rather than before it. With this: > > Rake::GemPackageTask.new(spec) do |pkg| > ... > end > > # Don't show the clobber task, just always clobber when > # creating packages. Maybe in future ask to make sure. > Rake::Task['clobber_package'].comment = nil > Rake::Task['repackage'].comment = nil > task :package => [:clobber_package] > > Shouldn't it invoke clobber_package BEFORE package? I ran it with -- > trace and it's clearly doing the opposite. What's up? It does. But the package task body is entirely empty. So after it has satisfied all of its other dependencies (which do the work of building the packaages), then it invokes its last dependency (your clobber_package). Finally it runs the body (which is empty). The trick is to get clobber_package to be first in the list of package's dependencies. Just move the task :package line to be before the creation of the Rake::GemPackageTask. -- -- Jim Weirich jim at weirichhouse.org http://onestepback.org -- In theory, practice and theory are the same. -- In practice, they are different. From transfire at gmail.com Sat Feb 10 18:08:50 2007 From: transfire at gmail.com (TRANS) Date: Sat, 10 Feb 2007 18:08:50 -0500 Subject: [Rake-devel] backwards dependency? In-Reply-To: <45CE1FAA.5000704@weirichhouse.org> References: <4b6f054f0702051209s113e64bfi6ad8c688385c8814@mail.gmail.com> <45CE1FAA.5000704@weirichhouse.org> Message-ID: <4b6f054f0702101508h515d1fbdid7efe046637d6af4@mail.gmail.com> On 2/10/07, Jim Weirich wrote: > It does. But the package task body is entirely empty. So after it has > satisfied all of its other dependencies (which do the work of building > the packaages), then it invokes its last dependency (your > clobber_package). Finally it runs the body (which is empty). > > The trick is to get clobber_package to be first in the list of package's > dependencies. Just move the task :package line to be before the > creation of the Rake::GemPackageTask. ah, I see. thanks! t. From zimbatm at oree.ch Sat Feb 10 20:24:36 2007 From: zimbatm at oree.ch (Jonas Pfenniger) Date: Sun, 11 Feb 2007 02:24:36 +0100 Subject: [Rake-devel] about the tasklib DSL Message-ID: Hello, I really enjoy using Rake but somehow, I'm not able to "get" the tasklib extension's principles. IMHO, the DSL is not as expressive as the simple task definition. Why can't I, for example define a test task like that : test_task, :test_all do |t| ... end or task TestTask, :test_all instead of TestTask.new(:test_all)... ? -- Cheers, zimbatm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20070211/1aa73c8d/attachment-0001.html From murphy at rubychan.de Sat Feb 17 16:34:58 2007 From: murphy at rubychan.de (murphy) Date: Sat, 17 Feb 2007 22:34:58 +0100 Subject: [Rake-devel] Invoke tasks more than once In-Reply-To: <45C0F961.4050009@rubychan.de> References: <45C0F961.4050009@rubychan.de> Message-ID: <45D77502.1070703@rubychan.de> I wrote: > ... As you can see, I had > to tweak Task#invoke to allow them to be called repeatedly. I just noticed that this is handy for other things, like: namespace :db do desc 'Delete all tables, and migrate DB to latest version.' task :reload do ENV['VERSION'] = '0' Rake::Task['db:migrate'].invoke ENV.delete 'VERSION' Rake::Task['db:migrate'].invoke false end end ...which is not possible with the current invoke method. So, independent from the Observer Mode patch, it would be nice to have this in Rake 0.8 :) Actually, it might be preferable to change the semantics of #invoke to skip the only-once check by default, and check only if the option "true" is given. If rake is started from the shell, it would act as usual, but if you use it manually (like in the above example), you would get the expected result (two invocations), without a parameter. Alternatively, an invoke_once method might be even better. [murphy] From Daniel.Berger at qwest.com Mon Feb 26 10:28:00 2007 From: Daniel.Berger at qwest.com (Daniel Berger) Date: Mon, 26 Feb 2007 08:28:00 -0700 Subject: [Rake-devel] Rake 0.7.2 and Ruby 1.8.6 Message-ID: <45E2FC80.3040300@qwest.com> Hi Jim, As was brought up on ruby-core, I think it would be wise to put out the next release of rake before 1.8.6 goes final. Otherwise, there are going to be a LOT of unhappy Rails users. Any ideas for a release date? Thanks, Dan