static public Method

Object.lookup_missing_generator(class_id)

Lookup missing generators using const_missing. This allows any generator to reference another without having to know its location: RubyGems, ~/.rails/generators, and RAILS_ROOT/generators.

Source Code

# File rails_generator/lookup.rb, line 8
def lookup_missing_generator(class_id)
  if md = /(.+)Generator$/.match(class_id.to_s)
    name = md.captures.first.demodulize.underscore
    Rails::Generator::Base.lookup(name).klass
  else
    const_missing_before_generators(class_id)
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.