Skip to content

Commit

Permalink
Merge pull request #25182 from rails/remove-public-files-for-api-apps
Browse files Browse the repository at this point in the history
Remove public/ files for API apps
  • Loading branch information
dhh committed May 30, 2016
1 parent a1443bc commit 2a81f60
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -305,6 +305,17 @@ def delete_application_layout_file_if_api_option
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'
Expand Down
8 changes: 7 additions & 1 deletion railties/test/generators/api_app_generator_test.rb
Expand Up @@ -105,6 +105,12 @@ def skipped_files
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

0 comments on commit 2a81f60

Please sign in to comment.