[Rake-devel] Environment changes in the beta

Jim Weirich jim.weirich at gmail.com
Wed Mar 2 16:03:08 EST 2011


I've not had time to go over your email in detail, but I'm not getting the behavior I want out of the beta.1 in this area either.  I'll review when I get a chance.

On Mar 1, 2011, at 10:55 PM, James M. Lawrence wrote:

> % cat mystuff.rb
> module MyStuff
>  CONST_B = 44
> end
> 
> % cat Rakefile
> require 'rake'
> require './mystuff'
> 
> module MyStuff
>  CONST_A = 33
> end
> 
> p MyStuff::CONST_A
> p MyStuff::CONST_B
> # => uninitialized constant Rake::Environment::MyStuff::CONST_B
> 
> task :default
> 
> % rake --version
> rake, version 0.9.0.beta.1
> 
> % rake
> 33
> rake aborted!
> uninitialized constant Rake::Environment::MyStuff::CONST_B
> 
> Writing ::MyStuff::CONST_B instead works, and conversely
> ::MyStuff::CONST_A is an error.
> 
> It seems that Rake::DSL already provides the necessary partitioning.
> If I wanted to keep the global scope clean, I would do
> 
> module MyStuff
>  extend Rake::DSL
> 
>  task :default do
>    # ...
>  end
> end
> 
> Could an example like that in the README replace the need for
> environment.rb?
> _______________________________________________
> Rake-devel mailing list
> Rake-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel

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






More information about the Rake-devel mailing list