From jim at weirichhouse.org Tue Oct 3 01:19:10 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Tue, 03 Oct 2006 01:19:10 -0400 Subject: [Rake-devel] fileutils.rb In-Reply-To: <4520FAB0.7040505@weirichhouse.org> References: <20061001.182939.1649764742.aamine@loveruby.net> <086FAA46-8744-4874-9496-56F44CBA0525@zenspider.com> <4520FAB0.7040505@weirichhouse.org> Message-ID: <4521F2CE.30707@weirichhouse.org> Jim Weirich wrote: > Ryan Davis wrote: >> >> On Oct 1, 2006, at 2:29 AM, Minero Aoki wrote: >> >>> I don't now about Rake, but why Rake calls fu_check_options? >>> Adding new methods to FileUtils module? >> >> Yes. In particular: #sh, #ruby, and #safe_ln. >> >>> I think fu_* method is library private (so I explicitly use >>> :nodoc: directive), other library should not depend them... [...] > It looks like rake's dependency on fu_check_options and > fu_output_message is pretty lightweight. I can remove those dependencies. Latest beta version (0.7.1.5) of Rake does not depend upon fu_xxxx. method in FileUtils. If you are interested in trying it, you can get it via: gem update --source http://onestepback.org/betagems rake -- Jim Weirich From zach.dennis at gmail.com Fri Oct 13 00:30:23 2006 From: zach.dennis at gmail.com (Zach Dennis) Date: Fri, 13 Oct 2006 00:30:23 -0400 Subject: [Rake-devel] Accessing TestTask's Message-ID: <85d99afe0610122130m2bf3af9q9017b92046e998df@mail.gmail.com> HI, I am extending another library which has it's own rakefile of tasks and testtasks. I want hook into those TestTasks and supply some additional options so I can verify my extended functionality doesn't break functionality in the original library. I know in my Rakefile I can load the other Rakefile, and access it's Rake::Tasks, but I cannot access any TestTasks. I have done a small hack to rake's testtask.rb file which makes use of the RUBYOPTS variable (much like TESTOPTS). This works, however it requires that I modify rake. Is there an existing solution to do this, or could I ask for feature request / submit a patch for this to get added to Rake? The exact scenario I have is I am extending ActiveRecord. ActiveRecord defines many of its own Rake::TestTask's for use with several database adapter. For example to test ActiveRecord with mysql you run "rake test_mysql". In my application I am defining a task "test:activerecord:mysql" which tests my library against the same rake tasks as the "rake test_mysql" ran. Since the default TestTask loader just runs a new ruby interpretor I wanted to add that it required my 'init.rb' file before running the tests. I ultimately am looking for behavior where running a TestTask which would run "ruby -Ilib test_file.rb" would possibly run "ruby -r init.rb -Ilib test_file.rb". Thanks, Zach Dennis -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20061013/cd21c534/attachment-0001.html From esad at esse.at Mon Oct 16 14:36:38 2006 From: esad at esse.at (Esad Hajdarevic) Date: Mon, 16 Oct 2006 20:36:38 +0200 Subject: [Rake-devel] rakelibdir? Message-ID: <4533D136.2000405@esse.at> Hi, I'm trying to use -R (--rakelibdir) option to specify a directory where my rake scripts containing some admin tasks reside. Basically these tasks (contained within .rake files) should be available from everywere, even if there's no Rakefile in the directory I'm executing it from. However (I'm using Windows XP), when I call rake like this: rake -R=c:\utils\rake -T I get following output C:\>rake -R=c:\utils\rake -T rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) Is -R option made for this at all? Does it support absolute pathnames? I looked at the rake source and Rake::Application#load_rakefile seems to search for the Rakefile first, and then imports the tasks. Greetings, Esad From zach.dennis at gmail.com Mon Oct 16 16:32:49 2006 From: zach.dennis at gmail.com (Zach Dennis) Date: Mon, 16 Oct 2006 16:32:49 -0400 Subject: [Rake-devel] Accessing TestTasks (did this post?) Message-ID: <85d99afe0610161332q4bacb6a7idf94de10eb13ffb6@mail.gmail.com> I dont' know if this posted. I tried to send it last week, but I never saw it come through.. .if this is a double post I apologize. If you do see this could someone reply so I know that I am actually getting through? Thanks, Zach --- ORIGINAL MESSAGE ---- I am extending another library which has it's own rakefile of tasks and testtasks. I want hook into those TestTasks and supply some additional options so I can verify my extended functionality doesn't break functionality in the original library. I know in my Rakefile I can load the other Rakefile, and access it's Rake::Tasks, but I cannot access any TestTasks. I have done a small hack to rake's testtask.rb file which makes use of the RUBYOPTS variable (much like TESTOPTS). This works, however it requires that I modify rake. Is there an existing solution to do this, or could I ask for feature request / submit a patch for this to get added to Rake? The exact scenario I have is I am extending ActiveRecord. ActiveRecord defines many of its own Rake::TestTask's for use with several database adapter. For example to test ActiveRecord with mysql you run "rake test_mysql". In my application I am defining a task "test:activerecord:mysql" which tests my library against the same rake tasks as the "rake test_mysql" ran. Since the default TestTask loader just runs a new ruby interpretor I wanted to add that it required my ' init.rb' file before running the tests. I ultimately am looking for behavior where running a TestTask which would run "ruby -Ilib test_file.rb" would possibly run "ruby -r init.rb -Ilib test_file.rb". Thanks, Zach Dennis From jim at weirichhouse.org Mon Oct 16 17:12:02 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Mon, 16 Oct 2006 17:12:02 -0400 Subject: [Rake-devel] rakelibdir? In-Reply-To: <4533D136.2000405@esse.at> References: <4533D136.2000405@esse.at> Message-ID: <4533F5A2.70105@weirichhouse.org> Esad Hajdarevic wrote: > Hi, I'm trying to use -R (--rakelibdir) option to specify a directory > where my rake scripts containing some admin tasks reside. > Basically these tasks (contained within .rake files) should be available > from everywere, even if there's no Rakefile in the directory > I'm executing it from. > > However (I'm using Windows XP), when I call rake like this: > > rake -R=c:\utils\rake -T > > I get following output > > C:\>rake -R=c:\utils\rake -T > rake aborted! > No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, > Rakefile.rb) > > Is -R option made for this at all? Does it support absolute pathnames? I > looked at the rake source and > Rake::Application#load_rakefile seems to search for the Rakefile first, > and then imports the tasks. Even though you supplied rake libraries, rake is still looking for a main rakefile. -- Jim Weirich From esad at esse.at Mon Oct 16 18:32:41 2006 From: esad at esse.at (Esad Hajdarevic) Date: Tue, 17 Oct 2006 00:32:41 +0200 Subject: [Rake-devel] rakelibdir? In-Reply-To: <4533F5A2.70105@weirichhouse.org> References: <4533D136.2000405@esse.at> <4533F5A2.70105@weirichhouse.org> Message-ID: <45340889.7050206@esse.at> Hi, >> Is -R option made for this at all? Does it support absolute pathnames? I >> looked at the rake source and >> Rake::Application#load_rakefile seems to search for the Rakefile first, >> and then imports the tasks. >> > > Even though you supplied rake libraries, rake is still looking for a > main rakefile. > Is there a possibility to support the behaviour I want out of the box with rake? I even tried specified an empty or existing Rakefile, the .rake files from the directory I specified don't get included! Esad From zach.dennis at gmail.com Mon Oct 16 18:45:02 2006 From: zach.dennis at gmail.com (Zach Dennis) Date: Mon, 16 Oct 2006 18:45:02 -0400 Subject: [Rake-devel] Accessing TestTasks (did this post?) In-Reply-To: <85d99afe0610161332q4bacb6a7idf94de10eb13ffb6@mail.gmail.com> References: <85d99afe0610161332q4bacb6a7idf94de10eb13ffb6@mail.gmail.com> Message-ID: <85d99afe0610161545j6e37e7aydf714c8f01784817@mail.gmail.com> Please ignore this, I was making a silly mistake. I can alter the RUBYOPT environment variable without needing to change rake. Sorry for the noise, Zach On 10/16/06, Zach Dennis wrote: > > I dont' know if this posted. I tried to send it last week, but I never > saw it come through.. .if this is a double post I apologize. If you do > see this could someone reply so I know that I am actually getting > through? > > Thanks, Zach > > --- ORIGINAL MESSAGE ---- > > I am extending another library which has it's own rakefile of tasks > and testtasks. I want hook into those TestTasks and supply some > additional options so I can verify my extended functionality doesn't > break functionality in the original library. > > I know in my Rakefile I can load the other Rakefile, and access it's > Rake::Tasks, but I cannot access any TestTasks. I have done a small > hack to rake's testtask.rb file which makes use of the RUBYOPTS > variable (much like TESTOPTS). This works, however it requires that I > modify rake. > > Is there an existing solution to do this, or could I ask for feature > request / submit a patch for this to get added to Rake? > > The exact scenario I have is I am extending ActiveRecord. ActiveRecord > defines many of its own Rake::TestTask's for use with several database > adapter. For example to test ActiveRecord with mysql you run "rake > test_mysql". In my application I am defining a task > "test:activerecord:mysql" which tests my library against the same rake > tasks as the "rake test_mysql" ran. Since the default TestTask loader > just runs a new ruby interpretor I wanted to add that it required my ' > init.rb' file before running the tests. > > I ultimately am looking for behavior where running a TestTask which > would run "ruby -Ilib test_file.rb" would possibly run "ruby -r > init.rb -Ilib test_file.rb". > > Thanks, > > Zach Dennis > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20061016/a9134536/attachment.html From jim at weirichhouse.org Mon Oct 16 20:30:48 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Mon, 16 Oct 2006 20:30:48 -0400 Subject: [Rake-devel] rakelibdir? In-Reply-To: <45340889.7050206@esse.at> References: <4533D136.2000405@esse.at> <4533F5A2.70105@weirichhouse.org> <45340889.7050206@esse.at> Message-ID: <45342438.7040101@weirichhouse.org> Esad Hajdarevic wrote: > Hi, >>> Is -R option made for this at all? Does it support absolute pathnames? I >>> looked at the rake source and >>> Rake::Application#load_rakefile seems to search for the Rakefile first, >>> and then imports the tasks. >>> >> Even though you supplied rake libraries, rake is still looking for a >> main rakefile. >> > Is there a possibility to support the behaviour I want out of the box > with rake? I even tried specified an empty or > existing Rakefile, the .rake files from the directory I specified don't > get included! I just tried this on windows and it works fine. However, I reviewed your command line: rake -R=c:\utils\rake -T Drop the = in the -R option. One of the following options will work: rake -Rc:\utils\rake -T rake -R c:\utils\rake -T rake --rakelib=c:\utils\rake -T The = form only works with the double-dash long version. -- Jim Weirich From esad at esse.at Mon Oct 16 21:32:50 2006 From: esad at esse.at (Esad Hajdarevic) Date: Tue, 17 Oct 2006 03:32:50 +0200 Subject: [Rake-devel] rakelibdir? In-Reply-To: <45342438.7040101@weirichhouse.org> References: <4533D136.2000405@esse.at> <4533F5A2.70105@weirichhouse.org> <45340889.7050206@esse.at> <45342438.7040101@weirichhouse.org> Message-ID: <453432C2.5010308@esse.at> Hi Jim! > Drop the = in the -R option. One of the following options will work: > > rake -Rc:\utils\rake -T > rake -R c:\utils\rake -T > rake --rakelib=c:\utils\rake -T > > Indeed, they seem to work, however only if I run rake from a path on the same drive. See below: C:\>rake -R c:\utils\rake -f c:\utils\rake\rakefile -T (in C:/) rake svn:tag # Tag the trunk as VERSION=n C:\>d: D:\>rake -R c:\utils\rake -f c:\utils\rake\rakefile -T (in D:/) D:\> Greetings, Esad