aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-01-17 22:42:41 -0500
committerGitHub <noreply@github.com>2017-01-17 22:42:41 -0500
commit9f6f51be78f8807e18fc6562c57af2fdbf8ccb56 (patch)
tree22f9d9b0b633f3b702ff9717b4f48c9465820218 /railties
parentaf5dd491b5e204570aac84eb828ea7d5b1e6f7e9 (diff)
parent073f4ecb14927fcb884f8f06fb2a7d0d1a5f3d10 (diff)
downloadrails-9f6f51be78f8807e18fc6562c57af2fdbf8ccb56.tar.gz
rails-9f6f51be78f8807e18fc6562c57af2fdbf8ccb56.tar.bz2
rails-9f6f51be78f8807e18fc6562c57af2fdbf8ccb56.zip
Merge pull request #27706 from y-yagi/allow_to_pass_describe_option_to_rake
allow to pass describe option to rake
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/command.rb4
-rw-r--r--railties/lib/rails/command/base.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/rails/command.rb b/railties/lib/rails/command.rb
index 9012ceb274..13f3b90b6d 100644
--- a/railties/lib/rails/command.rb
+++ b/railties/lib/rails/command.rb
@@ -15,6 +15,8 @@ module Rails
include Behavior
+ HELP_MAPPINGS = %w(-h -? --help)
+
class << self
def hidden_commands # :nodoc:
@hidden_commands ||= []
@@ -27,7 +29,7 @@ module Rails
# Receives a namespace, arguments and the behavior to invoke the command.
def invoke(namespace, args = [], **config)
namespace = namespace.to_s
- namespace = "help" if namespace.blank? || Thor::HELP_MAPPINGS.include?(namespace)
+ namespace = "help" if namespace.blank? || HELP_MAPPINGS.include?(namespace)
namespace = "version" if %w( -v --version ).include? namespace
if command = find_by_namespace(namespace)
diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb
index 7ae190433a..1435792536 100644
--- a/railties/lib/rails/command/base.rb
+++ b/railties/lib/rails/command/base.rb
@@ -56,7 +56,7 @@ module Rails
end
def perform(command, args, config) # :nodoc:
- command = nil if Thor::HELP_MAPPINGS.include?(args.first)
+ command = nil if Rails::Command::HELP_MAPPINGS.include?(args.first)
dispatch(command, args.dup, nil, config)
end