diff options
author | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-07-05 13:07:26 -0400 |
---|---|---|
committer | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-07-05 13:07:26 -0400 |
commit | 4d737a41ecf22cfd81930b9cb4637e769d5c1e66 (patch) | |
tree | 299c3ae5ad5e8e3d9f7a38e905332dbde8cef2d9 /railties/lib/rails | |
parent | a05e245ca58d2ab864c8043f2159886f4089499f (diff) | |
parent | 42b5906523669ba7b80a9fef1c57abd83f1428e8 (diff) | |
download | rails-4d737a41ecf22cfd81930b9cb4637e769d5c1e66.tar.gz rails-4d737a41ecf22cfd81930b9cb4637e769d5c1e66.tar.bz2 rails-4d737a41ecf22cfd81930b9cb4637e769d5c1e66.zip |
Merge pull request #20748 from robin850/reserved-names
Display a more human readable list of reserved names
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 4b73313388..b813b083f4 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -356,7 +356,9 @@ module Rails if app_const =~ /^\d/ raise Error, "Invalid application name #{app_name}. Please give a name which does not start with numbers." elsif RESERVED_NAMES.include?(app_name) - raise Error, "Invalid application name #{app_name}. Please give a name which does not match one of the reserved rails words: #{RESERVED_NAMES}" + raise Error, "Invalid application name #{app_name}. Please give a " \ + "name which does not match one of the reserved rails " \ + "words: #{RESERVED_NAMES.join(", ")}" elsif Object.const_defined?(app_const_base) raise Error, "Invalid application name #{app_name}, constant #{app_const_base} is already in use. Please choose another application name." end diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 7f5bf0c8b8..66111004aa 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -364,7 +364,9 @@ task default: :test elsif camelized =~ /^\d/ raise Error, "Invalid plugin name #{original_name}. Please give a name which does not start with numbers." elsif RESERVED_NAMES.include?(name) - raise Error, "Invalid plugin name #{original_name}. Please give a name which does not match one of the reserved rails words: #{RESERVED_NAMES}" + raise Error, "Invalid plugin name #{original_name}. Please give a " \ + "name which does not match one of the reserved rails " \ + "words: #{RESERVED_NAMES.join(", ")}" elsif Object.const_defined?(camelized) raise Error, "Invalid plugin name #{original_name}, constant #{camelized} is already in use. Please choose another plugin name." end |