diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-14 06:01:35 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-14 06:01:35 +0000 |
commit | 68ddd4d300e9a88737c4f37af74e1a0312949b2f (patch) | |
tree | 787e1e83d76934ce039eb336995a8d5bb53a89e6 /lib/bundler/injector.rb | |
parent | d636809c057432e8d42abe30c6c6785eb0721d77 (diff) | |
download | ruby-68ddd4d300e9a88737c4f37af74e1a0312949b2f.tar.gz |
Merge Bundler 2.1.0.pre.1 as developed version from upstream.
https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/bundler/injector.rb')
-rw-r--r-- | lib/bundler/injector.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb index 1bb29f0b36..e67469f2dd 100644 --- a/lib/bundler/injector.rb +++ b/lib/bundler/injector.rb @@ -123,7 +123,7 @@ module Bundler end end - # evalutes a gemfile to remove the specified gem + # evaluates a gemfile to remove the specified gem # from it. def remove_deps(gemfile_path) initial_gemfile = IO.readlines(gemfile_path) @@ -136,8 +136,8 @@ module Bundler removed_deps = remove_gems_from_dependencies(builder, @deps, gemfile_path) - # abort the opertion if no gems were removed - # no need to operate on gemfile furthur + # abort the operation if no gems were removed + # no need to operate on gemfile further return [] if removed_deps.empty? cleaned_gemfile = remove_gems_from_gemfile(@deps, gemfile_path) @@ -153,8 +153,8 @@ module Bundler # @param [Dsl] builder Dsl object of current Gemfile. # @param [Array] gems Array of names of gems to be removed. - # @param [Pathname] path of the Gemfile - # @return [Array] removed_deps Array of removed dependencies. + # @param [Pathname] gemfile_path Path of the Gemfile. + # @return [Array] Array of removed dependencies. def remove_gems_from_dependencies(builder, gems, gemfile_path) removed_deps = [] @@ -206,7 +206,7 @@ module Bundler nested_blocks -= 1 gemfile.each_with_index do |line, index| - next unless !line.nil? && line.include?(block_name) + next unless !line.nil? && line.strip.start_with?(block_name) if gemfile[index + 1] =~ /^\s*end\s*$/ gemfile[index] = nil gemfile[index + 1] = nil @@ -222,7 +222,7 @@ module Bundler # @param [Array] removed_deps Array of removed dependencies. # @param [Array] initial_gemfile Contents of original Gemfile before any operation. def cross_check_for_errors(gemfile_path, original_deps, removed_deps, initial_gemfile) - # evalute the new gemfile to look for any failure cases + # evaluate the new gemfile to look for any failure cases builder = Dsl.new builder.eval_gemfile(gemfile_path) |