aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authormasakazutakewaka <takewakamma@gmail.com>2019-07-21 21:04:01 -0700
committermasakazutakewaka <takewakamma@gmail.com>2019-07-21 21:04:01 -0700
commit386c116fb4932e7a105034ceb8435f65249a3ab7 (patch)
treece222f201b8eed4ddf0f917dd228ec83c99cfbf7 /railties/lib
parentef4d3215b1198c456780b8d18aa62be7795b9b8c (diff)
downloadrails-386c116fb4932e7a105034ceb8435f65249a3ab7.tar.gz
rails-386c116fb4932e7a105034ceb8435f65249a3ab7.tar.bz2
rails-386c116fb4932e7a105034ceb8435f65249a3ab7.zip
create a newline between blocks when gem_group, github and add_source was called.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/actions.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb
index c3a43d5398..b6225cd8c0 100644
--- a/railties/lib/rails/generators/actions.rb
+++ b/railties/lib/rails/generators/actions.rb
@@ -57,7 +57,7 @@ module Rails
log :gemfile, "group #{str}"
in_root do
- append_file_with_newline "Gemfile", "group #{str} do", force: true
+ append_file_with_newline "Gemfile", "\ngroup #{str} do", force: true
with_indentation(&block)
append_file_with_newline "Gemfile", "end", force: true
end
@@ -70,7 +70,11 @@ module Rails
log :github, "github #{str}"
in_root do
- append_file_with_newline "Gemfile", "#{indentation}github #{str} do", force: true
+ if @indentation.zero?
+ append_file_with_newline "Gemfile", "\ngithub #{str} do", force: true
+ else
+ append_file_with_newline "Gemfile", "#{indentation}github #{str} do", force: true
+ end
with_indentation(&block)
append_file_with_newline "Gemfile", "#{indentation}end", force: true
end
@@ -90,7 +94,7 @@ module Rails
in_root do
if block
- append_file_with_newline "Gemfile", "source #{quote(source)} do", force: true
+ append_file_with_newline "Gemfile", "\nsource #{quote(source)} do", force: true
with_indentation(&block)
append_file_with_newline "Gemfile", "end", force: true
else