1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #41432 from p8/commands/improve-find-by-namespace-docs

Improve documentation of Rails::Command.find_by_namespace [skip ci]
This commit is contained in:
Kasper Timm Hansen 2021-02-13 12:01:12 +01:00 committed by GitHub
commit 5585c375d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,14 +60,12 @@ module Rails
# Command names must end with "_command.rb". This is required because Rails
# looks in load paths and loads the command just before it's going to be used.
#
# find_by_namespace :webrat, :rails, :integration
# find_by_namespace :webrat, :integration
#
# Will search for the following commands:
#
# "rails:webrat", "webrat:integration", "webrat"
# "webrat", "webrat:integration", "rails:webrat", "rails:webrat:integration"
#
# Notice that "rails:commands:webrat" could be loaded as well, what
# Rails looks for is the first and last parts of the namespace.
def find_by_namespace(namespace, command_name = nil) # :nodoc:
lookups = [ namespace ]
lookups << "#{namespace}:#{command_name}" if command_name