diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2017-11-15 07:38:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-15 07:38:14 +0900 |
commit | 874dae1fd48ffa6a4febdce36059b21070b9ba13 (patch) | |
tree | 20883baa30df3531c8f00d1254dbd7b6cac147ba | |
parent | ba1e153e4a083b4a09c97211e0ebea36c5c2d8d7 (diff) | |
parent | 5345b61f29568c80bee6f8d0000a61e35d93429a (diff) | |
download | rails-874dae1fd48ffa6a4febdce36059b21070b9ba13.tar.gz rails-874dae1fd48ffa6a4febdce36059b21070b9ba13.tar.bz2 rails-874dae1fd48ffa6a4febdce36059b21070b9ba13.zip |
Merge pull request #30004 from npenzin/patch-1
Update plugin_generator.rb
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 4762dfddd4..786aea503c 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -167,7 +167,7 @@ task default: :test gemfile_in_app_path = File.join(rails_app_path, "Gemfile") if File.exist? gemfile_in_app_path - entry = "gem '#{name}', path: '#{relative_path}'" + entry = "\ngem '#{name}', path: '#{relative_path}'" append_file gemfile_in_app_path, entry end end diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 2723f5b256..06f59ee33d 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -515,10 +515,11 @@ class PluginGeneratorTest < Rails::Generators::TestCase gemfile_path = "#{Rails.root}/Gemfile" Object.const_set("APP_PATH", Rails.root) FileUtils.touch gemfile_path + File.write(gemfile_path, "#foo") run_generator - assert_file gemfile_path, /gem 'bukkits', path: 'tmp\/bukkits'/ + assert_file gemfile_path, /^gem 'bukkits', path: 'tmp\/bukkits'/ ensure Object.send(:remove_const, "APP_PATH") FileUtils.rm gemfile_path |