% 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
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel