1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rake/ext/module.rb
drbrain 9c66bad9f3 * lib/rake*: Updated to rake 0.9.3
* test/rake*:  ditto
* bin/rake:  ditto
* NEWS:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-15 21:59:37 +00:00

39 lines
1.2 KiB
Ruby

require 'rake/ext/core'
require 'rake/task'
require 'rake/file_task'
require 'rake/file_creation_task'
require 'rake/application'
require 'rake/task_manager'
######################################################################
# Rake extensions to Module.
#
class Module
# Rename the original handler to make it available.
alias :rake_original_const_missing :const_missing
# Check for deprecated uses of top level (i.e. in Object) uses of
# Rake class names. If someone tries to reference the constant
# name, display a warning and return the proper object. Using the
# --classic-namespace command line option will define these
# constants in Object and avoid this handler.
def const_missing(const_name)
case const_name
when :Task
Rake.application.const_warning(const_name)
Rake::Task
when :FileTask
Rake.application.const_warning(const_name)
Rake::FileTask
when :FileCreationTask
Rake.application.const_warning(const_name)
Rake::FileCreationTask
when :RakeApp
Rake.application.const_warning(const_name)
Rake::Application
else
rake_original_const_missing(const_name)
end
end
end unless defined? Rake::REDUCE_COMPAT