From e3d7751b54112d226ea5ebac65cf0551a9cf00ba Mon Sep 17 00:00:00 2001 From: Stefan Sprenger Date: Tue, 24 May 2011 08:22:25 +0200 Subject: Add folders app and config to the engine's gemspec if they're available --- railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec index 3d9bfb22c7..15299ddb9f 100644 --- a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec +++ b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec @@ -4,6 +4,6 @@ Gem::Specification.new do |s| s.name = "<%= name %>" s.summary = "Insert <%= camelized %> summary." s.description = "Insert <%= camelized %> description." - s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] + s.files = Dir["{app,config,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.version = "0.0.1" end -- cgit v1.2.3 From 855d14dd945c6d341242a0d8fd48cb4d424af8d1 Mon Sep 17 00:00:00 2001 From: Stefan Sprenger Date: Tue, 24 May 2011 09:30:23 +0200 Subject: Add test for gemspec of the generated engine --- railties/test/generators/plugin_new_generator_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 297ac5d238..49537d6511 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -169,6 +169,12 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "app/views/layouts/bukkits/application.html.erb", /Bukkits<\/title>/ end + def test_creating_gemspec + assert_file "bukkits.gemspec", /s.name = "bukkits"/ + assert_file "bukkits.gemspec", /s.files = Dir["{app,config,lib}\/**\/*"]/ + assert_file "bukkits.gemspec", /s.version = "0.0.1"/ + end + def test_passing_dummy_path_as_a_parameter run_generator [destination_root, "--dummy_path", "spec/dummy"] assert_file "spec/dummy" -- cgit v1.2.3