命名空间
- 模块 Rails::Command::Actions
- 模块 Rails::Command::App
- 模块 Rails::Command::Db
- 模块 Rails::Command::Helpers
- 类 Rails::Command::Base
- 类 Rails::Command::UnusedRoutesCommand
方法
- C
- F
- I
- L
- R
常量
HELP_MAPPINGS | = | %w(-h -? --help).to_set |
VERSION_MAPPINGS | = | %w(-v --version).to_set |
类公开方法
invoke(full_namespace, args = [], **config) 链接
接收命名空间、参数和行为来调用命令。
来源: 显示 | 在 GitHub 上
# File railties/lib/rails/command.rb, line 56 def invoke(full_namespace, args = [], **config) args = ["--help"] if rails_new_with_no_path?(args) full_namespace = full_namespace.to_s namespace, command_name = split_namespace(full_namespace) command = find_by_namespace(namespace, command_name) with_argv(args) do if command && command.all_commands[command_name] command.perform(command_name, args, config) else invoke_rake(full_namespace, args, config) end end rescue UnrecognizedCommandError => error if error.name == full_namespace && command && command_name == full_namespace command.perform("help", [], config) else puts error.detailed_message end exit(1) end
root() 链接
返回运行命令的 Rails 引擎或应用程序的根目录。
来源: 显示 | 在 GitHub 上
# File railties/lib/rails/command.rb, line 102 def root if defined?(ENGINE_ROOT) Pathname.new(ENGINE_ROOT) else application_root end end
类私有方法
command_type() 链接
来源: 显示 | 在 GitHub 上
# File railties/lib/rails/command.rb, line 153 def command_type # :doc: @command_type ||= "command" end
file_lookup_paths() 链接
来源: 显示 | 在 GitHub 上
# File railties/lib/rails/command.rb, line 161 def file_lookup_paths # :doc: @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_command.rb" ] end
lookup_paths() 链接
来源: 显示 | 在 GitHub 上
# File railties/lib/rails/command.rb, line 157 def lookup_paths # :doc: @lookup_paths ||= %w( rails/commands commands ) end