On 2011-06-22 06:13, Nick Sabalausky wrote:
"Jacob Carlborg"<[email protected]> wrote in message news:[email protected]..."target" works like this: 1. You call "target" passing in the name of the target and a block 2. "target" then call the block passing in an instance of a Target class (or similar) 3. In the block you then specify all the necessary settings you need for this particular target. You should only call "target" once for each target. So, if you pass in "name2" instead of "name" you would create a new target. I haven't figured out what should happen if you call "target" twice with the same name. Also note that this would be sufficient: target "name" do flags "-l-lz" end In that case you wouldn't even have to care about "t" or that it even exists an instance behind the since. It would just be syntax. You can have a look at how Rake and Rubgems do this: If you look at the Rake examples: http://en.wikipedia.org/wiki/Rake_%28software%29 then a target would work the same as a Rake task. Have a look at the top example of: http://rubygems.rubyforge.org/rubygems-update/Gem/Specification.htmlFWIW, I've been using Rake heavily on a non-D project for about a year or so, and the more I use it the more I keep wishing I could just use D instead of of Ruby. That may have a lot to do with why I'm so interested in seeing Dake use D. Of course, I realize that Dake isn't Rake and isn't going to be exactly the same, but it's still Ruby instead of D and that's proven to be the #1 issue that I have with Rake.
Too bad you feel that about Ruby, I think it's a great language. Maybe you don't have a choice of using Rake or not but the reason I see why anyone would choose Rake is because the rakefiles are in Ruby.
-- /Jacob Carlborg
