diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-04-15 12:47:04 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-04-15 15:36:15 +0900 |
commit | ed149dbf46d1a8b16e6de9c3dbbcc10f72c9c019 (patch) | |
tree | 1c8c755fa592e280dc7718dc8a9317d1ac368394 /lib/bundler/injector.rb | |
parent | 0d9496f924d36534bd524791554d49dc0026b0e0 (diff) |
Merge the master branch of Bundler
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4383
Diffstat (limited to 'lib/bundler/injector.rb')
-rw-r--r-- | lib/bundler/injector.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb index e9aa13a357..613bda4f84 100644 --- a/lib/bundler/injector.rb +++ b/lib/bundler/injector.rb @@ -128,7 +128,7 @@ module Bundler # evaluates a gemfile to remove the specified gem # from it. def remove_deps(gemfile_path) - initial_gemfile = IO.readlines(gemfile_path) + initial_gemfile = File.readlines(gemfile_path) Bundler.ui.info "Removing gems from #{gemfile_path}" @@ -181,7 +181,7 @@ module Bundler patterns = /gem\s+(['"])#{Regexp.union(gems)}\1|gem\s*\((['"])#{Regexp.union(gems)}\2\)/ new_gemfile = [] multiline_removal = false - IO.readlines(gemfile_path).each do |line| + File.readlines(gemfile_path).each do |line| match_data = line.match(patterns) if match_data && is_not_within_comment?(line, match_data) multiline_removal = line.rstrip.end_with?(",") |