[EMAIL PROTECTED] wrote:
> hi list -
>
> i'm wondering if there is a good way to dynamically create
> namespaces and tasks. currently, i have an ugly string
> generation to eval code that wraps an Xcode project's
> targets/configurations, but i would have to imagine
> there is a better way. looking at the rdocs (for the first
> time), i see a define_task method which sounds good, are there
> any examples of this in use?
Actually, it's much easier than that.
The following bit of code synthesizes creates 10 tasks where task t(n)
depends on t(n-1), except for t0 which depends on nothing:
task :t0
(1..9).each do |i|
task "t#{i}" => "t#{i-1}" do |t|
puts t.name
end
end
No need to delve into define_task and all that.
--
-- Jim Weirich [EMAIL PROTECTED] http://onestepback.org
-- In theory, practice and theory are the same.
-- In practice, they are different.
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel