From 290866cb934ecddb377e2aef3873e8e930647802 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 5 Dec 2015 21:28:59 +0100 Subject: Move `command_name_for` to private section. Users shouldn't have to lookup the command name for a task. Put it in the private section, so it doesn't show up in any generated documentation. --- railties/lib/rails/commands/command.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/commands/command.rb b/railties/lib/rails/commands/command.rb index ffd1a50c79..2e99046e9a 100644 --- a/railties/lib/rails/commands/command.rb +++ b/railties/lib/rails/commands/command.rb @@ -27,10 +27,6 @@ module Rails @@command_options[command_name] = options_to_parse end - def self.command_name_for(task_name) - task_name.gsub(':', '_').to_sym - end - def self.set_banner(command_name, banner) options_for(command_name) { |opts, _| opts.banner = banner } end @@ -61,6 +57,10 @@ module Rails @@commands << command end + def self.command_name_for(task_name) + task_name.gsub(':', '_').to_sym + end + def command_for(command_name) klass = @@commands.find do |command| command_instance_methods = command.public_instance_methods -- cgit v1.2.3