diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-05-28 09:59:40 -0400 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-05-28 09:59:40 -0400 |
commit | 985d8b25623dfd11972fa6966d0e47695c347084 (patch) | |
tree | 8dc8ccf67cd28542c64f1b5e234c8a4987abcd99 | |
parent | f5f1caa0a74284a78eee00cdf1a322e8e3205103 (diff) | |
download | rails-985d8b25623dfd11972fa6966d0e47695c347084.tar.gz rails-985d8b25623dfd11972fa6966d0e47695c347084.tar.bz2 rails-985d8b25623dfd11972fa6966d0e47695c347084.zip |
Remove public/ files for API apps
- Fixes #25180
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 11 | ||||
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 8 |
2 files changed, 18 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 4d5bb364b2..1ac6fae908 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -305,6 +305,17 @@ module Rails end end + def delete_public_files_if_api_option + if options[:api] + remove_file 'public/404.html' + remove_file 'public/422.html' + remove_file 'public/500.html' + remove_file 'public/apple-touch-icon-precomposed.png' + remove_file 'public/apple-touch-icon.png' + remove_file 'public/favicon.ico' + end + end + def delete_js_folder_skipping_javascript if options[:skip_javascript] remove_dir 'app/assets/javascripts' diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 8e1cd0891a..46efa3856c 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -105,6 +105,12 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase lib/assets vendor/assets test/helpers - tmp/cache/assets) + tmp/cache/assets + public/404.html + public/422.html + public/500.html + public/apple-touch-icon-precomposed.png + public/apple-touch-icon.png + public/favicon.ico) end end |