Rakefile are evaluated in the Rake::Environment module space. Top level rake
functions (e.g. :task, :file) are available in this environment.
Public Class Methods
load_rakefile(rakefile_path)click to toggle source
Load a rakefile from the given path. The Rakefile is loaded in an
environment that includes the RakeDSL methods.
# File lib/rake/environment.rb, line 14
14: defload_rakefile(rakefile_path)
15: rakefile = open(rakefile_path) { |f|f.read }
16: load_string(rakefile, rakefile_path)
17: end
load_string(code, file_name=nil)click to toggle source
Load a string of code in the RakeDSL environment. If the string comes from a file,
include the file path so that proper line numbers references may be
retained.
# File lib/rake/environment.rb, line 22
22: defload_string(code, file_name=nil)
23: module_eval(code, file_name||"(eval)")
24: end