[Rake-devel] Environment changes in the beta

Jim Weirich jim.weirich at gmail.com
Sat Mar 5 15:36:34 EST 2011

On Mar 3, 2011, at 4:29 PM, James M. Lawrence wrote:

> Thus my proposal is that bin/rake simply extend Rake::DSL at the top
> level rather than include it. The readme would cover how to use the
> DSL in one's own classes with examples like the above.

I've had time to look over your email and I must say ... it's brilliant!  I would have never thought of just extending the actual top level "main" object.  This puts the rake DSL at the top level for Rakefile without polluting the namespace of all objects.  This solves all the problems I was trying to fix with the environment hack, except for ... (see below).

> I'm guessing that environment.rb was a noble effort to keep 'import'
> alive, resolving the jruby conflict while maintaining backward
> compatibility. Perhaps 'import' can be left out of Rake::DSL when
> RUBY_ENGINE == "jruby", and/or deprecate import in favor of
> Rake.import. Such a conflict may have no good solution. (Even though
> it's not fair because you had it first :)

Your guess is accurate.  I don't like the explicit test for JRuby (that means some rakefile wouldn't run in JRuby, yuck).  Instead I'm going to deprecate 'import' and promote the use of Rake.import.  I think that's best.

Thanks so much.

-- Jim Weirich
-- jim.weirich at gmail.com

More information about the Rake-devel mailing list