[Ironruby-core] custom rake task

Shay Friedman shay.friedman at gmail.com
Tue Jul 27 15:08:20 EDT 2010


You're missing an ampersand (&) on the define_task call. It should be:
Rake::Task.define_task(*args, *&*body)

Shay.
--------------------------------------------------------
Shay Friedman | Microsoft Visual C#/IronRuby MVP | Author of IronRuby
Unleashed
Blog: http://IronShay.com | Twitter: http://twitter.com/ironshay


On Tue, Jul 27, 2010 at 9:40 PM, Goode, Troy <Troy.Goode at nreca.coop> wrote:

> I was following Derek Bailey’s article from yesterday entitled “How to
> Build Custom Rake Tasks; The Right Way”<http://www.lostechies.com/blogs/derickbailey/archive/2010/07/26/how-to-build-custom-rake-tasks-the-right-way.aspx>and tried to replicate some of his code in IronRuby. Now I’ve run into a
> snag that I’m hoping somebody can help with.
>
>
>
> My .rb file looks like so:
>
>
>
> *require 'rake'*
>
> * *
>
> *def foo(*args)*
>
> *  body = proc {*
>
> *    puts 'hello world'*
>
> *  }*
>
> *  Rake::Task.define_task(*args, body)*
>
> *end*
>
> * *
>
> *foo :bar*
>
> * *
>
> *task :default => [:bar]*
>
>
>
> Pretty simple, right? Well, when I run it using rake, I get the following
> error:
>
>
>
> *C:\Users\txg0\Desktop>rake -f test1.rb --trace*
>
> *(in C:/Users/txg0/Desktop)*
>
> *rake aborted!*
>
> *syntax error, unexpected IDENTIFIER, expecting AMPERSAND*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in
> `raw_load_rakefile'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in
> `load_rakefile'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> `standard_exception_handling'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in
> `load_rakefile'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> `standard_exception_handling'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'*
>
> *C:/Program Files (x86)/IronRuby
> 1.0v4/lib/ironruby/gems/1.8/gems/rake-0.8.7/bin/rake:31*
>
> *C:/Program Files (x86)/IronRuby 1.0v4/bin/rake:19:in `load'*
>
> *C:/Program Files (x86)/IronRuby 1.0v4/bin/rake:19*
>
>
>
> Anyone have any clues?
>
> Confidentiality Notice: This e-mail message, including any attachments, is
> for the sole use of the intended recipient(s) and may contain confidential
> and privileged information. Any unauthorized review, copy, use, disclosure,
> or distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100727/8a310f40/attachment.html>


More information about the Ironruby-core mailing list