aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-11-25 09:44:14 -0800
committerJosé Valim <jose.valim@gmail.com>2011-11-25 09:44:14 -0800
commit2dab493867d35d27015e3ba00d20ee6d2337320e (patch)
treeda6299cf2d9bcde99187f725d572832ef6b278ee /railties/lib
parent6f5fdf81799d3d7596ca3821b1c04ce2b36fcd87 (diff)
parent95e9b5fbfd87b81bf2d2b16a6df6d9ddbfdb686d (diff)
downloadrails-2dab493867d35d27015e3ba00d20ee6d2337320e.tar.gz
rails-2dab493867d35d27015e3ba00d20ee6d2337320e.tar.bz2
rails-2dab493867d35d27015e3ba00d20ee6d2337320e.zip
Merge pull request #3756 from johnmdonahue/update-gem-action-linebreaks-and-indentation
Updating newline fix to maintain existing linebreaks and indentation and...
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/actions.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb
index 184cb2866b..ca93f9ef9d 100644
--- a/railties/lib/rails/generators/actions.rb
+++ b/railties/lib/rails/generators/actions.rb
@@ -68,8 +68,9 @@ module Rails
end
in_root do
- str = "\ngem #{parts.join(", ")}\n"
+ str = "gem #{parts.join(", ")}"
str = " " + str if @in_group
+ str = "\n" + str
append_file "Gemfile", str, :verbose => false
end
end
@@ -87,13 +88,13 @@ module Rails
log :gemfile, "group #{name}"
in_root do
- append_file "Gemfile", "\ngroup #{name} do\n", :force => true
+ append_file "Gemfile", "\ngroup #{name} do", :force => true
@in_group = true
instance_eval(&block)
@in_group = false
- append_file "Gemfile", "end\n", :force => true
+ append_file "Gemfile", "\nend\n", :force => true
end
end