Flowdock
method

find_by_namespace

Importance_1
Ruby on Rails latest stable (v4.1.8) - 0 notes - Class: Rails::Generators
find_by_namespace(name, base=nil, context=nil) public

Rails finds namespaces similar to thor, it only adds one rule:

Generators names must end with “_generator.rb”. This is required because Rails looks in load paths and loads the generator just before it’s going to be used.

find_by_namespace :webrat, :rails, :integration

Will search for the following generators:

"rails:webrat", "webrat:integration", "webrat"

Notice that “rails:generators:webrat” could be loaded as well, what Rails looks for is the first and last parts of the namespace.

Show source
Register or log in to add new notes.