Skip to content

Commit

Permalink
Merge pull request #30004 from npenzin/patch-1
Browse files Browse the repository at this point in the history
Update plugin_generator.rb
  • Loading branch information
y-yagi committed Nov 14, 2017
2 parents ba1e153 + 5345b61 commit 874dae1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -167,7 +167,7 @@ def gemfile_entry

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
Expand Down
3 changes: 2 additions & 1 deletion railties/test/generators/plugin_generator_test.rb
Expand Up @@ -515,10 +515,11 @@ def test_creating_plugin_in_app_directory_adds_gemfile_entry
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
Expand Down

0 comments on commit 874dae1

Please sign in to comment.