diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-04-24 19:56:25 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-25 15:30:58 +0800 |
commit | a1c31eca47f19b14161b275ad6432da562a11438 (patch) | |
tree | e7c2f9dd5ee60d714007a120586864d8e8d71900 | |
parent | 05ce0007db9361a2b777bc7378e395dafb199fd3 (diff) | |
download | rails-a1c31eca47f19b14161b275ad6432da562a11438.tar.gz rails-a1c31eca47f19b14161b275ad6432da562a11438.tar.bz2 rails-a1c31eca47f19b14161b275ad6432da562a11438.zip |
Add `app/assets/images` directory to plugin new generator
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 10 | ||||
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index 12921f47b6..5abb8d0e35 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -135,6 +135,12 @@ task :default => :test end end + def images + if mountable? || full? + empty_directory_with_gitkeep "app/assets/images" + end + end + def script(force = false) directory "script", :force => force do |content| "#{shebang}\n" + content @@ -199,6 +205,10 @@ task :default => :test build(:javascripts) end + def create_images_directory + build(:images) + end + def create_script_files build(:script) end diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index d20335ad95..d12dc6925a 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -147,6 +147,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase run_generator [destination_root, "--full"] assert_file "app/assets/javascripts" assert_file "app/assets/stylesheets" + assert_file "app/assets/images" assert_file "app/models" assert_file "app/controllers" assert_file "app/views" @@ -162,6 +163,9 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase def test_create_mountable_application_with_mountable_option run_generator [destination_root, "--mountable"] + assert_file "app/assets/javascripts" + assert_file "app/assets/stylesheets" + assert_file "app/assets/images" assert_file "config/routes.rb", /Bukkits::Engine.routes.draw do/ assert_file "lib/bukkits/engine.rb", /isolate_namespace Bukkits/ assert_file "test/dummy/config/routes.rb", /mount Bukkits::Engine => "\/bukkits"/ |