Tilman Sauerbeck | 6 Aug 2006 21:25
Picon
Favicon

Re: Building Ruby extensions with Rake

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.
(Continue reading)

Tilman Sauerbeck | 7 Aug 2006 18:13
Picon
Favicon

Re: Building Ruby extensions with Rake

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
(Continue reading)

Tilman Sauerbeck | 12 Aug 2006 19:04
Picon
Favicon

[PATCH] Better pattern support for FileList

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?
Index: test/test_filelist.rb
===================================================================
--- test/test_filelist.rb	(revision 565)
+++ test/test_filelist.rb	(working copy)
 <at>  <at>  -106,6 +106,14  <at>  <at> 
     ].sort, fl.sort
   end

(Continue reading)

Tilman Sauerbeck | 12 Aug 2006 20:07
Picon
Favicon

Re: [PATCH] Better pattern support for FileList

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?
_______________________________________________
Rake-devel mailing list
Rake-devel <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/rake-devel
Jim Weirich | 12 Aug 2006 20:24

Re: [PATCH] Better pattern support for FileList

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
Tilman Sauerbeck | 12 Aug 2006 20:37
Picon
Favicon

Re: [PATCH] Better pattern support for FileList

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?
Index: test/test_filelist.rb
===================================================================
--- test/test_filelist.rb	(revision 565)
(Continue reading)

Jim Weirich | 12 Aug 2006 20:40

Re: [PATCH] Better pattern support for FileList

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
Jim Weirich | 12 Aug 2006 20:44

Re: [PATCH] Better pattern support for FileList

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
Jim Weirich | 12 Aug 2006 20:45

Rake respoository is now SubVersion

Oh, and while I'm at it, I should announce that the Rake repository is 
now subversion.

-- Jim Weirich
Tilman Sauerbeck | 12 Aug 2006 20:47
Picon
Favicon

Re: [PATCH] Better pattern support for FileList

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?
_______________________________________________
Rake-devel mailing list
Rake-devel <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/rake-devel

Gmane