Discussion:
New loading behavior
James M. Lawrence
2010-06-07 16:26:42 UTC
Permalink
task :default do
end

extra = "Rakefile.extra"
File.open(extra, "w") { |f| f.puts "p SPEC" }
SPEC = 99

# OK in rake-0.8.7; error in rake-0.8.99 (uninitialized constant SPEC)
load extra

# OK in rake-0.8.99; error in rake-0.8.7 (load_rakefile not present)
load_rakefile extra

Is this the expected behavior?
Luis Lavena
2010-06-07 16:40:02 UTC
Permalink
On Mon, Jun 7, 2010 at 12:26 PM, James M. Lawrence
Post by James M. Lawrence
task :default do
end
extra = "Rakefile.extra"
File.open(extra, "w") { |f| f.puts "p SPEC" }
SPEC = 99
# OK in rake-0.8.7; error in rake-0.8.99 (uninitialized constant SPEC)
load extra
# OK in rake-0.8.99; error in rake-0.8.7 (load_rakefile not present)
load_rakefile extra
Is this the expected behavior?
What about Rake.import?
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
James M. Lawrence
2010-06-07 17:23:01 UTC
Permalink
Post by Luis Lavena
What about Rake.import?
The issue is whether breaking load was intended. Rake.import is not
interchangeable with load.

task :default do
end

extra = "Rakefile.extra"
File.open(extra, "w") { |f| f.puts "SPEC = 99" }

# need load instead
import extra

p SPEC # => uninitialized constant

Loading...