In Files

Parent

Module

                                                                    

Rake extensions to Module.

Public Instance Methods

const_missing(const_name) click to toggle source

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.

      # File lib/rake.rb, line 2488
2488:   def const_missing(const_name)
2489:     case const_name
2490:     when :Task
2491:       Rake.application.const_warning(const_name)
2492:       Rake::Task
2493:     when :FileTask
2494:       Rake.application.const_warning(const_name)
2495:       Rake::FileTask
2496:     when :FileCreationTask
2497:       Rake.application.const_warning(const_name)
2498:       Rake::FileCreationTask
2499:     when :RakeApp
2500:       Rake.application.const_warning(const_name)
2501:       Rake::Application
2502:     else
2503:       rake_original_const_missing(const_name)
2504:     end
2505:   end
Also aliased as: rake_original_const_missing
rake_extension(method) click to toggle source

Check for an existing method in the current class before extending. IF the method already exists, then a warning is printed and the extension is not added. Otherwise the block is yielded and any definitions in the block will take effect.

Usage:

  class String
    rake_extension("xyz") do
      def xyz
        ...
      end
    end
  end
    # File lib/rake.rb, line 64
64:   def rake_extension(method)
65:     if method_defined?(method)
66:       $stderr.puts "WARNING: Possible conflict with Rake extension: #{self}##{method} already exists"
67:     else
68:       yield
69:     end
70:   end
rake_original_const_missing(const_name) click to toggle source

Rename the original handler to make it available.

Alias for: const_missing

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.