diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-02-23 19:22:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 19:22:55 +0100 |
commit | 8f59a1dd878f56798f88369fa5b448f17a29679d (patch) | |
tree | 5ba674c73ffb5e2f246e7a2d0a8db579733d37f5 /railties/lib/rails/command/base.rb | |
parent | 4734d23c74fb4193aafe7cb04256bb745680d97f (diff) | |
parent | 9fdf326a5f6f7e10594dd6205cfc8e0425fb3e67 (diff) | |
download | rails-8f59a1dd878f56798f88369fa5b448f17a29679d.tar.gz rails-8f59a1dd878f56798f88369fa5b448f17a29679d.tar.bz2 rails-8f59a1dd878f56798f88369fa5b448f17a29679d.zip |
Merge pull request #28128 from rails/revert-28127-revert-28038-encrypted-secrets
Revert "Revert "Add encrypted secrets""
Diffstat (limited to 'railties/lib/rails/command/base.rb')
-rw-r--r-- | railties/lib/rails/command/base.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb index 1435792536..db20c71861 100644 --- a/railties/lib/rails/command/base.rb +++ b/railties/lib/rails/command/base.rb @@ -56,7 +56,9 @@ module Rails end def perform(command, args, config) # :nodoc: - command = nil if Rails::Command::HELP_MAPPINGS.include?(args.first) + if Rails::Command::HELP_MAPPINGS.include?(args.first) + command, args = "help", [] + end dispatch(command, args.dup, nil, config) end @@ -111,7 +113,7 @@ module Rails # For a `Rails::Command::TestCommand` placed in `rails/command/test_command.rb` # would return `rails/test`. def default_command_root - path = File.expand_path(File.join("../commands", command_name), __dir__) + path = File.expand_path(File.join("../commands", command_root_namespace), __dir__) path if File.exist?(path) end @@ -129,6 +131,10 @@ module Rails super end end + + def command_root_namespace + (namespace.split(":") - %w( rails )).first + end end def help |