Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/rake.rb

Instance Method Summary collapse

Instance Method Details

#const_missing(const_name) ⇒ Object

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 –class-namespace will define these constants in Object and avoid this handler.



1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
# File 'lib/rake.rb', line 1482

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

#rake_original_const_missingObject

Rename the original handler to make it available.



1475
# File 'lib/rake.rb', line 1475

alias :rake_original_const_missing :const_missing