Sha256: c26aa72d300f93c5119b26d6c28e3d91642c92171f3729f39ce7999018b01677

Contents?: true

Size: 1.19 KB

Versions: 10

Compression:

Stored size: 1.19 KB

Contents

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ext/module.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ext/module.rb
rake-0.9.6 lib/rake/ext/module.rb
rake-0.9.5 lib/rake/ext/module.rb
rake-0.9.4 lib/rake/ext/module.rb
rake-0.9.3 lib/rake/ext/module.rb
rake-0.9.3.beta.4 lib/rake/ext/module.rb
rake-0.9.3.beta.3 lib/rake/ext/module.rb
rake-0.9.3.beta.2 lib/rake/ext/module.rb
rake-0.9.3.beta.1 lib/rake/ext/module.rb