diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-05-20 17:15:15 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-05-20 17:32:19 +0900 |
commit | aeea88174d88264469b406003765c7efdcd53edf (patch) | |
tree | a4d9de6d1a0027f5b9c2f2050bca2586b87596bb /lib/bundler | |
parent | bd8df25cdc8e0e94cbc2eacc492a764e6b90833c (diff) | |
download | ruby-aeea88174d88264469b406003765c7efdcd53edf.tar.gz |
Merge RubyGems and Bundler HEAD
https://github.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli/common.rb | 2 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 4 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | lib/bundler/gem_helpers.rb | 2 | ||||
-rw-r--r-- | lib/bundler/resolver.rb | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 2 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 10 | ||||
-rw-r--r-- | lib/bundler/source/git.rb | 2 | ||||
-rw-r--r-- | lib/bundler/spec_set.rb | 4 |
9 files changed, 15 insertions, 15 deletions
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb index 1a469f1d34..b547619c6a 100644 --- a/lib/bundler/cli/common.rb +++ b/lib/bundler/cli/common.rb @@ -40,7 +40,7 @@ module Bundler end def self.verbalize_groups(groups) - groups.map!{|g| "'#{g}'" } + groups.map! {|g| "'#{g}'" } group_list = [groups[0...-1].join(", "), groups[-1..-1]]. reject {|s| s.to_s.empty? }.join(" and ") group_str = groups.size == 1 ? "group" : "groups" diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index d862877c2e..4fca763bcc 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -261,7 +261,7 @@ module Bundler @locked_specs elsif !unlocking? && nothing_changed? Bundler.ui.debug("Found no changes, using resolution from the lockfile") - SpecSet.new(filter_specs(@locked_specs, @dependencies.select{|dep| @locked_specs[dep].any? })) + SpecSet.new(filter_specs(@locked_specs, @dependencies.select {|dep| @locked_specs[dep].any? })) else last_resolve = converge_locked_specs # Run a resolve against the locally available gems @@ -731,7 +731,7 @@ module Bundler end end - SpecSet.new(filter_specs(converged, deps).reject{|s| @unlock[:gems].include?(s.name) }) + SpecSet.new(filter_specs(converged, deps).reject {|s| @unlock[:gems].include?(s.name) }) end def metadata_dependencies diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index f7922b1fba..8983ef3e2b 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -46,7 +46,7 @@ module Bundler @gemfile = expanded_gemfile_path @gemfiles << expanded_gemfile_path contents ||= Bundler.read_file(@gemfile.to_s) - instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1) + instance_eval(contents.dup.tap {|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1) rescue Exception => e # rubocop:disable Lint/RescueException message = "There was an error " \ "#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \ diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb index b271b8d229..632698482f 100644 --- a/lib/bundler/gem_helpers.rb +++ b/lib/bundler/gem_helpers.rb @@ -48,7 +48,7 @@ module Bundler sorted_matching = matching.sort_by {|spec| platform_specificity_match(spec.platform, platform) } exemplary_spec = sorted_matching.first - sorted_matching.take_while{|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) } + sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) } end module_function :select_best_platform_match diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 433a5e53e1..2285114c57 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -21,7 +21,7 @@ module Bundler base = SpecSet.new(base) unless base.is_a?(SpecSet) resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms) result = resolver.start(requirements) - SpecSet.new(SpecSet.new(result).for(requirements.reject{|dep| dep.name.end_with?("\0") })) + SpecSet.new(SpecSet.new(result).for(requirements.reject {|dep| dep.name.end_with?("\0") })) end def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms) diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index b0e35e005e..af669d7d0b 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -34,7 +34,7 @@ module Gem def full_gem_path if source.respond_to?(:root) - Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" } + Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" } else rg_full_gem_path end diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index ffdbdee503..8c4e26f074 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -13,13 +13,13 @@ module Bundler def root gemfile = find_gemfile raise GemfileNotFound, "Could not locate Gemfile" unless gemfile - Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent + Pathname.new(gemfile).tap {|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent end def default_gemfile gemfile = find_gemfile raise GemfileNotFound, "Could not locate Gemfile" unless gemfile - Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path + Pathname.new(gemfile).tap {|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path end def default_lockfile @@ -28,7 +28,7 @@ module Bundler case gemfile.basename.to_s when "gems.rb" then Pathname.new(gemfile.sub(/.rb$/, ".locked")) else Pathname.new("#{gemfile}.lock") - end.tap{|x| x.untaint if RUBY_VERSION < "2.7" } + end.tap {|x| x.untaint if RUBY_VERSION < "2.7" } end def default_bundle_dir @@ -100,7 +100,7 @@ module Bundler # # @see {Bundler::PermissionError} def filesystem_access(path, action = :write, &block) - yield(path.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }) + yield(path.dup.tap {|x| x.untaint if RUBY_VERSION < "2.7" }) rescue Errno::EACCES raise PermissionError.new(path, action) rescue Errno::EAGAIN @@ -236,7 +236,7 @@ module Bundler def search_up(*names) previous = nil - current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" } + current = File.expand_path(SharedHelpers.pwd).tap {|x| x.untaint if RUBY_VERSION < "2.7" } until !File.directory?(current) || current == previous if ENV["BUNDLER_SPEC_RUN"] diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index f174120706..eb82544b86 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -336,7 +336,7 @@ module Bundler def load_gemspec(file) stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent) - stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" } + stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" } StubSpecification.from_stub(stub) end diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 44715c3567..0dfaed9807 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -18,7 +18,7 @@ module Bundler loop do break unless dep = deps.shift - next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler" + next if handled.any? {|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler" handled << dep @@ -174,7 +174,7 @@ module Bundler def spec_for_dependency(dep, match_current_platform) specs_for_platforms = lookup[dep.name] if match_current_platform - GemHelpers.select_best_platform_match(specs_for_platforms.select{|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform) + GemHelpers.select_best_platform_match(specs_for_platforms.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform) else GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform) end |