Permalink
Browse files

Merge pull request #3591 from tylercoville/fix-plugin-new

Fixed error with 'rails generate new plugin' where the .gitignore was not
  • Loading branch information...
2 parents c778f4e + 4934908 commit 909e5cc32d0bd47dad2f5c5404670a074a9dabbd @josevalim josevalim committed Nov 10, 2011
View
2 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -39,7 +39,7 @@ def gemspec
end
def gitignore
- copy_file "gitignore", ".gitignore"
+ template "gitignore", ".gitignore"
end
def lib
View
6 railties/lib/rails/generators/rails/plugin_new/templates/gitignore
@@ -1,6 +1,6 @@
.bundle/
log/*.log
pkg/
-test/dummy/db/*.sqlite3
-test/dummy/log/*.log
-test/dummy/tmp/
+<%= dummy_path %>/db/*.sqlite3
+<%= dummy_path %>/log/*.log
+<%= dummy_path %>/tmp/
View
8 railties/test/generators/plugin_new_generator_test.rb
@@ -236,6 +236,14 @@ def test_creating_dummy_without_tests_but_with_dummy_path
assert_file "spec/dummy/config/application.rb"
assert_no_file "test"
end
+
+ def test_ensure_that_gitignore_can_be_generated_from_a_template_for_dummy_path
+ FileUtils.cd(Rails.root)
+ run_generator([destination_root, "--dummy_path", "spec/dummy" "--skip-test-unit"])
+ assert_file ".gitignore" do |contents|
+ assert_match(/spec\/dummy/, contents)
+ end
+ end
def test_skipping_test_unit
run_generator [destination_root, "--skip-test-unit"]

0 comments on commit 909e5cc

Please sign in to comment.