diff options
author | Ivan Vanderbyl <ivanvanderbyl@me.com> | 2011-08-23 20:10:37 +1000 |
---|---|---|
committer | Malcolm Locke <malc@wholemeal.co.nz> | 2012-03-21 13:19:14 +1300 |
commit | 5c1109a68e098188803a6232be55dfff1e5e12eb (patch) | |
tree | 0d91285ccb4db477de821ffdf2d5c9ef352ae730 /railties/lib/rails/generators | |
parent | b49a7ddce18a35a39fd5b3f6003d4a02cbd09b0e (diff) | |
download | rails-5c1109a68e098188803a6232be55dfff1e5e12eb.tar.gz rails-5c1109a68e098188803a6232be55dfff1e5e12eb.tar.bz2 rails-5c1109a68e098188803a6232be55dfff1e5e12eb.zip |
Added a generator option to remove the public/index.html file when generating a new Rails application
The option is:
-i, [--skip-index-html] # Skip public/index.html file
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index bb2a9fcf22..59e7ad2430 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -49,6 +49,9 @@ module Rails class_option :skip_javascript, :type => :boolean, :aliases => "-J", :default => false, :desc => "Skip JavaScript files" + class_option :skip_index_html, :type => :boolean, :aliases => "-I", :default => false, + :desc => "Skip public/index.html and app/assets/images/rails.png files" + class_option :dev, :type => :boolean, :default => false, :desc => "Setup the #{name} with Gemfile pointing to your Rails checkout" diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index f0745df667..c06b0f8994 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -97,6 +97,11 @@ module Rails def public_directory directory "public", "public", :recursive => false + if options[:skip_index_html] + remove_file "public/index.html" + remove_file 'app/assets/images/rails.png' + git_keep 'app/assets/images' + end end def script |