Permalink
Browse files

Removed the option to include the DSL in the top level.

  • Loading branch information...
jimweirich committed Mar 5, 2011
1 parent 6f2d8e8 commit 5ca24baaa1ae114f80d6dca723b28a9c66e03a87
Showing with 1 addition and 28 deletions.
  1. +0 −13 lib/rake/application.rb
  2. +0 −5 lib/rake/dsl_definition.rb
  3. +1 −10 test/functional/session_based_tests.rb
View
@@ -370,16 +370,6 @@ def standard_rake_options
Rake::TaskManager.record_task_metadata = true
}
],
['--no-top-level-dsl', '-X', "Do not put Rake DSL commands in the top level scope.",
lambda { |value|
options.top_level_dsl = value
}
],
['--top-level-dsl', "Put Rake DSL commands in the top level scope (default).",
lambda { |value|
options.top_level_dsl = value
}
],
['--trace', '-t', "Turn on invoke/execute tracing, enable full backtrace.",
lambda { |value|
options.trace = true
@@ -408,7 +398,6 @@ def standard_rake_options
# Read and handle the command line options.
def handle_options
options.rakelib = ['rakelib']
options.top_level_dsl = true
OptionParser.new do |opts|
opts.banner = "rake [-f rakefile] {options} targets..."
@@ -424,8 +413,6 @@ def handle_options
opts.environment('RAKEOPT')
end.parse!
Rake::DSL.include_in_top_scope if options.top_level_dsl
# If class namespaces are requested, set the global options
# according to the values in the options structure.
if options.classic_namespace
@@ -135,11 +135,6 @@ def import(*fns)
Rake.application.add_import(fn)
end
end
# Include the Rake DSL commands in the top level Ruby scope.
def self.include_in_top_scope
Object.send(:include, Rake::DSL)
end
end
extend FileUtilsExt
@@ -91,19 +91,10 @@ def test_long_description
assert_no_match %r{^rake c\n}m, @out
end
def test_proper_namespace_access_old_style
def test_proper_namespace_access
in_environment("PWD" => "test/data/access") do
rake
end
assert_match %r{^GOOD:M}, @out
assert_match %r{^BAD:D}, @out
assert_match %r{^GOOD:C}, @out
end
def test_proper_namespace_access_experimental
in_environment("PWD" => "test/data/access") do
rake "--no-top-level-dsl"
end
assert_not_match %r{^BAD:}, @out
end

0 comments on commit 5ca24ba

Please sign in to comment.