diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-03 17:56:04 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-03 17:56:04 +0900 |
commit | fe006083ea0843ee37fb0259fb706a9ac5562066 (patch) | |
tree | 1f9ca477b2bd6e7b681f2aba72fffcef135b9ca6 /railties/lib/rails | |
parent | 1799d9103555a6c33f1239ae59bc3ced764826cc (diff) | |
download | rails-fe006083ea0843ee37fb0259fb706a9ac5562066.tar.gz rails-fe006083ea0843ee37fb0259fb706a9ac5562066.tar.bz2 rails-fe006083ea0843ee37fb0259fb706a9ac5562066.zip |
Don't normalize `original_app_name`
`original_app_name` is used to show error message if giving app name is
invalid, it should be shown raw app name.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/app_name.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/app_name.rb b/railties/lib/rails/generators/app_name.rb index c4f71694d8..5bb735c4e8 100644 --- a/railties/lib/rails/generators/app_name.rb +++ b/railties/lib/rails/generators/app_name.rb @@ -7,11 +7,11 @@ module Rails private def app_name - @app_name ||= original_app_name.tr("-", "_") + @app_name ||= original_app_name.tr('\\', "").tr("-. ", "_") end def original_app_name - @original_app_name ||= (defined_app_const_base? ? defined_app_name : File.basename(destination_root)).tr('\\', "").tr(". ", "_") + @original_app_name ||= defined_app_const_base? ? defined_app_name : File.basename(destination_root) end def defined_app_name |