Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed Commands from DeprecatedObjectDSL module

(and hence from top level namespace)
  • Loading branch information...
commit 5fc927c85db1b71b165df5feb54ad56cdc34b2ed 1 parent ac24187
@jimweirich authored
Showing with 9 additions and 3 deletions.
  1. +5 −3 lib/rake/dsl_definition.rb
  2. +4 −0 test/test_rake_dsl.rb
View
8 lib/rake/dsl_definition.rb
@@ -144,10 +144,12 @@ def import(*fns)
Rake.application.add_import(fn)
end
end
+
end
+ DeprecatedCommands = Object.new.extend(DSL)
+
module DeprecatedObjectDSL # :nodoc:
- Commands = Object.new.extend DSL
DSL.private_instance_methods(false).each do |name|
line = __LINE__+1
class_eval %{
@@ -160,8 +162,8 @@ def #{name}(*args, &block)
end
$stderr.puts "WARNING: DSL method \#{self.class}##{name} called at \#{caller.first}"
end
- Rake::DeprecatedObjectDSL::Commands.send(:#{name}, *args, &block)
- end
+ Rake::DeprecatedCommands.send(:#{name}, *args, &block)
+ end
private :#{name}
}, __FILE__, line
end
View
4 test/test_rake_dsl.rb
@@ -56,6 +56,10 @@ def test_deprecated_object_dsl
assert_match(/test_rake_dsl\.rb:\d+/, err)
end
+ def test_no_commands_constant
+ assert ! defined?(Commands), "should not define Commands"
+ end
+
def test_deprecated_object_dsl_with_suppressed_warnings
Rake.application.options.ignore_deprecate = true
out, err = capture_io do
Please sign in to comment.
Something went wrong with that request. Please try again.