Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ruby/rake
...
head fork: evanphx/rake
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/rake/dsl_definition.rb
View
10 lib/rake/dsl_definition.rb
@@ -140,17 +140,19 @@ def import(*fns)
end
module DeprecatedObjectDSL
- dsl = Object.new.extend DSL
+ Wrapper = Object.new.extend DSL
DSL.private_instance_methods(false).each do |name|
- define_method name do |*args, &block|
+ class_eval <<-CODE
+ def #{name}(*args, &block)
unless @rake_dsl_warning
$stderr.puts "WARNING: Global access to Rake DSL methods is deprecated. Please Include"
$stderr.puts " ... Rake::DSL into classes and modules which use the Rake DSL methods."
@rake_dsl_warning = true
end
- $stderr.puts "WARNING: DSL method #{self.class}##{name} called at #{caller.first}"
- dsl.send(name, *args, &block)
+ $stderr.puts "WARNING: DSL method \#{self.class}##{name} called at \#{caller.first}"
+ Wrapper.send(:#{name}, *args, &block)
end
+ CODE
private name
end
end

No commit comments for this range

Something went wrong with that request. Please try again.