From tilman at code-monkey.de Sun Aug 6 15:25:37 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sun, 6 Aug 2006 21:25:37 +0200 Subject: [Rake-devel] Building Ruby extensions with Rake In-Reply-To: <44663CBA.703@finagle.org> References: <445E82F0.4040200@finagle.org> <20060513133330.GA10419@code-monkey.de> <44663CBA.703@finagle.org> Message-ID: <20060806192536.GA27412@code-monkey.de> Steve Sloan [2006-05-13 13:08]: > BTW, I've made some significant changes since that early version (mostly > involving dependencies). It's currently checked into the RDBXML project on > RubyForge (http://rubyforge.org/projects/rdbxml) and you can get the latest > version of the Rake tasks via anonymous SVN from > svn://rubyforge.org/var/svn/rdbxml/trunk/rake . The example in the comment header is bad. The syntax is ExtensionTask.new :foo => [:bar] If the dependencies aren't specified as an array, rake will crash. The bigger problem is the following. What if there's another task that defines some properties that are to be used in my_ext_task.link_libs for example? link_libs is set up in the block that's passed to ExtensionTask.new, but at that point, the other task that defines these properties isn't run yet (even if the order in which the tasks are run is correct). Is there some good way around this problem? This isn't a question specific to ExtensionTask, but a general one. Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060806/9c00f29f/attachment.bin From tilman at code-monkey.de Mon Aug 7 12:13:04 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Mon, 7 Aug 2006 18:13:04 +0200 Subject: [Rake-devel] Building Ruby extensions with Rake In-Reply-To: <20060806192536.GA27412@code-monkey.de> References: <445E82F0.4040200@finagle.org> <20060513133330.GA10419@code-monkey.de> <44663CBA.703@finagle.org> <20060806192536.GA27412@code-monkey.de> Message-ID: <20060807161303.GA4275@code-monkey.de> Tilman Sauerbeck [2006-08-06 21:25]: > The bigger problem is the following. What if there's another task that > defines some properties that are to be used in my_ext_task.link_libs > for example? > > link_libs is set up in the block that's passed to ExtensionTask.new, but > at that point, the other task that defines these properties isn't run > yet (even if the order in which the tasks are run is correct). > > Is there some good way around this problem? This isn't a question > specific to ExtensionTask, but a general one. Solved. The following code shows how to fix that problem: ext_task = nil # this one goes first, so pre_ext is the very first prerequisite for the # ext task task :ext => [:pre_ext] task :pre_ext do ext_task.more_properties = ... end ext_task = ExtensionTask.new :ext do |t| # just the minimal setup here t.dir = "ext" t.lib_name = ... end Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060807/1a4f1b54/attachment.bin From tilman at code-monkey.de Sat Aug 12 13:04:37 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 12 Aug 2006 19:04:37 +0200 Subject: [Rake-devel] [PATCH] Better pattern support for FileList Message-ID: <20060812170436.GA19378@code-monkey.de> Hi, atm, FileList only recognizes strings with at least one '*' character as a pattern. ie, patterns that only make use of ? or [] or {} aren't working in FileList, although they are supported by Dir.glob. Attached patch fixes that by passing any string through Dir.glob. I don't think the overhead of calling Dir.glob is big enough to warrant more extensive checking for any wildcard characters in resolve_add. Note that I didn't actually test the unit test that I added, cause I'm too lazy to install rcov right now :P Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- Index: test/test_filelist.rb =================================================================== --- test/test_filelist.rb (revision 565) +++ test/test_filelist.rb (working copy) @@ -106,6 +106,14 @@ ].sort, fl.sort end + def test_non_star_patterns + fl = FileList.new + fl.include("foo.[ch]") + assert fl.size == 2 + assert fl.include?("foo.c") + assert fl.include?("foo.h") + end + def test_reject fl = FileList.new fl.include %w(testdata/x.c testdata/abc.c testdata/xyz.c testdata/existing) Index: lib/rake.rb =================================================================== --- lib/rake.rb (revision 565) +++ lib/rake.rb (working copy) @@ -1132,12 +1132,7 @@ end def resolve_add(fn) - case fn - when %r{[*?]} - add_matching(fn) - else - self << fn - end + add_matching(fn) end private :resolve_add -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060812/69f5f6ae/attachment.bin From tilman at code-monkey.de Sat Aug 12 14:07:22 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 12 Aug 2006 20:07:22 +0200 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <20060812170436.GA19378@code-monkey.de> References: <20060812170436.GA19378@code-monkey.de> Message-ID: <20060812180721.GA29454@code-monkey.de> Tilman Sauerbeck [2006-08-12 19:04]: > Note that I didn't actually test the unit test that I added, cause I'm > too lazy to install rcov right now :P That tought me! The patch is useless, as Dir.glob will not find files that don't exist ;) Looks like we do have to check for braces and brackets and stuff :( Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060812/53a66d4d/attachment.bin From jim at weirichhouse.org Sat Aug 12 14:24:35 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 14:24:35 -0400 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <20060812180721.GA29454@code-monkey.de> References: <20060812170436.GA19378@code-monkey.de> <20060812180721.GA29454@code-monkey.de> Message-ID: <44DE1CE3.4050309@weirichhouse.org> Tilman Sauerbeck wrote: > Tilman Sauerbeck [2006-08-12 19:04]: >> Note that I didn't actually test the unit test that I added, cause I'm >> too lazy to install rcov right now :P > > That tought me! > > The patch is useless, as Dir.glob will not find files that don't exist > ;) > > Looks like we do have to check for braces and brackets and stuff :( yeah, I noticed that too. I'm working through it right now. -- Jim Weirich From tilman at code-monkey.de Sat Aug 12 14:37:56 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 12 Aug 2006 20:37:56 +0200 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <44DE1CE3.4050309@weirichhouse.org> References: <20060812170436.GA19378@code-monkey.de> <20060812180721.GA29454@code-monkey.de> <44DE1CE3.4050309@weirichhouse.org> Message-ID: <20060812183755.GA7117@code-monkey.de> Jim Weirich [2006-08-12 14:24]: > Tilman Sauerbeck wrote: > > Tilman Sauerbeck [2006-08-12 19:04]: > >> Note that I didn't actually test the unit test that I added, cause I'm > >> too lazy to install rcov right now :P > > > > That tought me! > > > > The patch is useless, as Dir.glob will not find files that don't exist > > ;) > > > > Looks like we do have to check for braces and brackets and stuff :( > > yeah, I noticed that too. I'm working through it right now. I hope you're not done yet. I attached a fixed patch. Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- Index: test/test_filelist.rb =================================================================== --- test/test_filelist.rb (revision 565) +++ test/test_filelist.rb (working copy) @@ -106,6 +106,25 @@ ].sort, fl.sort end + def test_bracket_patterns + touch "testdata/foo.c" + touch "testdata/foo.h" + + fl = FileList.new + fl.include("testdata/foo.[ch]") + assert_equal 2, fl.size + assert fl.include?("testdata/foo.c") + assert fl.include?("testdata/foo.h") + end + + def test_brace_patterns + fl = FileList.new + fl.include("testdata/{xyz,abc}.c") + assert_equal 2, fl.size + assert fl.include?("testdata/xyz.c") + assert fl.include?("testdata/abc.c") + end + def test_reject fl = FileList.new fl.include %w(testdata/x.c testdata/abc.c testdata/xyz.c testdata/existing) Index: lib/rake.rb =================================================================== --- lib/rake.rb (revision 565) +++ lib/rake.rb (working copy) @@ -1133,7 +1133,7 @@ def resolve_add(fn) case fn - when %r{[*?]} + when %r{[*?]}, %r{\[.*\]}, %r{\{.*\}} add_matching(fn) else self << fn -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060812/69530785/attachment.bin From jim at weirichhouse.org Sat Aug 12 14:40:56 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 14:40:56 -0400 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <44DE1CE3.4050309@weirichhouse.org> References: <20060812170436.GA19378@code-monkey.de> <20060812180721.GA29454@code-monkey.de> <44DE1CE3.4050309@weirichhouse.org> Message-ID: <44DE20B8.7030809@weirichhouse.org> Jim Weirich wrote: > Tilman Sauerbeck wrote: >> Tilman Sauerbeck [2006-08-12 19:04]: >>> Note that I didn't actually test the unit test that I added, cause I'm >>> too lazy to install rcov right now :P >> That tought me! >> >> The patch is useless, as Dir.glob will not find files that don't exist >> ;) >> >> Looks like we do have to check for braces and brackets and stuff :( > > yeah, I noticed that too. I'm working through it right now. The improved pattern is implemented and a new beta Rake 0.7.1.3 is available: gem install rake --source=http://onestepback.org/betagems -- Jim Weirich From jim at weirichhouse.org Sat Aug 12 14:44:44 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 14:44:44 -0400 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <20060812183755.GA7117@code-monkey.de> References: <20060812170436.GA19378@code-monkey.de> <20060812180721.GA29454@code-monkey.de> <44DE1CE3.4050309@weirichhouse.org> <20060812183755.GA7117@code-monkey.de> Message-ID: <44DE219C.6010605@weirichhouse.org> Tilman Sauerbeck wrote: > I hope you're not done yet. I attached a fixed patch. Oops, looks like our emails passed each other. See, sometimes I wait months before applying a patch, and sometimes I do it before you are even done :) Nothing like consistancy. BTW, thanks for the test cases. I really appreciate test cases with patches. -- Jim Weirich From jim at weirichhouse.org Sat Aug 12 14:45:45 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 14:45:45 -0400 Subject: [Rake-devel] Rake respoository is now SubVersion Message-ID: <44DE21D9.4010200@weirichhouse.org> Oh, and while I'm at it, I should announce that the Rake repository is now subversion. -- Jim Weirich From tilman at code-monkey.de Sat Aug 12 14:47:13 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 12 Aug 2006 20:47:13 +0200 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <44DE219C.6010605@weirichhouse.org> References: <20060812170436.GA19378@code-monkey.de> <20060812180721.GA29454@code-monkey.de> <44DE1CE3.4050309@weirichhouse.org> <20060812183755.GA7117@code-monkey.de> <44DE219C.6010605@weirichhouse.org> Message-ID: <20060812184712.GA7309@code-monkey.de> Jim Weirich [2006-08-12 14:44]: > Tilman Sauerbeck wrote: > > I hope you're not done yet. I attached a fixed patch. > > Oops, looks like our emails passed each other. Your patch is nicer than mine anyway :) > See, sometimes I wait months before applying a patch, and sometimes I do > it before you are even done :) Nothing like consistancy. Hehe :) Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060812/69ad1b5d/attachment-0001.bin From tilman at code-monkey.de Sat Aug 12 14:49:05 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 12 Aug 2006 20:49:05 +0200 Subject: [Rake-devel] Rake respoository is now SubVersion In-Reply-To: <44DE21D9.4010200@weirichhouse.org> References: <44DE21D9.4010200@weirichhouse.org> Message-ID: <20060812184904.GB7309@code-monkey.de> Jim Weirich [2006-08-12 14:45]: > Oh, and while I'm at it, I should announce that the Rake repository is > now subversion. At least the trunk still has the CVSROOT directory. Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060812/81eb2785/attachment.bin From jim at weirichhouse.org Sat Aug 12 14:53:02 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 14:53:02 -0400 Subject: [Rake-devel] Rake respoository is now SubVersion In-Reply-To: <20060812184904.GB7309@code-monkey.de> References: <44DE21D9.4010200@weirichhouse.org> <20060812184904.GB7309@code-monkey.de> Message-ID: <44DE238E.3090102@weirichhouse.org> Tilman Sauerbeck wrote: > Jim Weirich [2006-08-12 14:45]: >> Oh, and while I'm at it, I should announce that the Rake repository is >> now subversion. > > At least the trunk still has the CVSROOT directory. Yeah, the RubyForge conversion process leaves the project nested in a single directory with the CVSROOT directory as a sibling. I don't like that, so the first thing I did on RubyGems and Rake was to bring up all the project files into the top level directory. I deleted the CVSROOT in RubyGems immediately, but I wondered if there was any interesting information in it I should have preserved. So when I did the Rake one, I left it in for later perusing. ... I'll delete it later. -- Jim Weirich From tilman at code-monkey.de Sat Aug 12 14:55:57 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 12 Aug 2006 20:55:57 +0200 Subject: [Rake-devel] Duplicated publisher code Message-ID: <20060812185557.GA7375@code-monkey.de> Hi, contrib/publisher.rb contains the code from both compositepublisher.rb and sshpublisher.rb. Is this a mistake or some backwards compatibility thing? Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060812/7f373b19/attachment.bin From jim at weirichhouse.org Sat Aug 12 14:58:53 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 14:58:53 -0400 Subject: [Rake-devel] Duplicated publisher code In-Reply-To: <20060812185557.GA7375@code-monkey.de> References: <20060812185557.GA7375@code-monkey.de> Message-ID: <44DE24ED.2050007@weirichhouse.org> Tilman Sauerbeck wrote: > Hi, > contrib/publisher.rb contains the code from both compositepublisher.rb > and sshpublisher.rb. > > Is this a mistake or some backwards compatibility thing? Probably a cut and paste error. -- Jim Weirich From jim at weirichhouse.org Sat Aug 12 15:07:48 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 12 Aug 2006 15:07:48 -0400 Subject: [Rake-devel] Duplicated publisher code In-Reply-To: <44DE24ED.2050007@weirichhouse.org> References: <20060812185557.GA7375@code-monkey.de> <44DE24ED.2050007@weirichhouse.org> Message-ID: <44DE2704.8050609@weirichhouse.org> Jim Weirich wrote: > Tilman Sauerbeck wrote: >> Hi, >> contrib/publisher.rb contains the code from both compositepublisher.rb >> and sshpublisher.rb. >> >> Is this a mistake or some backwards compatibility thing? > > Probably a cut and paste error. Hmmm ... looks like publisher is the early version. The others have been moved into the Rake module. Contrib has always been kinda a dumping ground for half-baked ideas. It is stuff I really don't want to support, but I want to keep around for future inspiration. -- Jim Weirich From shimbo at is.naist.jp Tue Aug 15 02:01:58 2006 From: shimbo at is.naist.jp (Masashi Shimbo) Date: Tue, 15 Aug 2006 15:01:58 +0900 Subject: [Rake-devel] [PATCH] Methods in rule dependencies Message-ID: <8764guh6zt.wl%shimbo@is.naist.jp> Hi, Attached is a two-line patch (against Rake 0.7.1) that allows you to specify Methods in rule dependencies. Currently, only Strings and Procs are accepted. Regards, Masashi Shimbo -------------- next part -------------- A non-text attachment was scrubbed... Name: rake.rb.patch Type: application/octet-stream Size: 644 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060815/e83cf13f/attachment.obj -------------- next part -------------- From tilman at code-monkey.de Sat Aug 19 12:40:49 2006 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat, 19 Aug 2006 18:40:49 +0200 Subject: [Rake-devel] [PATCH] Better pattern support for FileList In-Reply-To: <44DE20B8.7030809@weirichhouse.org> References: <20060812170436.GA19378@code-monkey.de> <20060812180721.GA29454@code-monkey.de> <44DE1CE3.4050309@weirichhouse.org> <44DE20B8.7030809@weirichhouse.org> Message-ID: <20060819164047.GA28772@code-monkey.de> Jim Weirich [2006-08-12 14:40]: > Jim Weirich wrote: > > Tilman Sauerbeck wrote: > >> Tilman Sauerbeck [2006-08-12 19:04]: > >>> Note that I didn't actually test the unit test that I added, cause I'm > >>> too lazy to install rcov right now :P > >> That tought me! > >> > >> The patch is useless, as Dir.glob will not find files that don't exist > >> ;) > >> > >> Looks like we do have to check for braces and brackets and stuff :( > > > > yeah, I noticed that too. I'm working through it right now. > > The improved pattern is implemented and a new beta Rake 0.7.1.3 is > available: Do you plan to make a new stable release anytime soon? I'm about to do a release myself, and I'm wondering whether I should wait for Rake 0.7.2 or whether I should change my FileList patterns so it works with 0.7.1... Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060819/47d3a61d/attachment.bin