Skip to content
Browse files

Fixes #1470 by only appending to a Gemfile that exists (dummy doesn't…

… have one).
  • Loading branch information...
1 parent 89fd637 commit b7ad001499f1b9847f8a369090115c0e96eda089 @parndt parndt committed Mar 17, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 core/lib/generators/refinery/cms/cms_generator.rb
View
12 core/lib/generators/refinery/cms/cms_generator.rb
@@ -24,6 +24,8 @@ def generate
stop_pretending?
+ append_gemfile!
+
append_gitignore!
forced_overwriting?
@@ -45,6 +47,12 @@ def generate
protected
+ def append_gemfile!
+ gsub_file 'Gemfile', %q{gem 'sqlite3'}, %q{group :development, :test do
+ gem 'sqlite3'
+end} if destination_path.join('Gemfile').file?
+ end
+
def append_gitignore!
# Ensure .gitignore exists and append our rules to it.
create_file ".gitignore" unless destination_path.join('.gitignore').file?
@@ -160,10 +168,6 @@ def manage_roadblocks!
end
end
end
-
- gsub_file 'Gemfile', %q{gem 'sqlite3'}, %q{group :development, :test do
- gem 'sqlite3'
-end}
end
def migrate_database!

0 comments on commit b7ad001

Please sign in to comment.
Something went wrong with that request. Please try again.