Skip to content

Commit aeea881

Browse files
committed
Merge RubyGems and Bundler HEAD
ruby/rubygems@1254155
1 parent bd8df25 commit aeea881

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+121
-95
lines changed

lib/bundler/cli/common.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def self.without_groups_message(command)
4040
end
4141

4242
def self.verbalize_groups(groups)
43-
groups.map!{|g| "'#{g}'" }
43+
groups.map! {|g| "'#{g}'" }
4444
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
4545
reject {|s| s.to_s.empty? }.join(" and ")
4646
group_str = groups.size == 1 ? "group" : "groups"

lib/bundler/definition.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def resolve
261261
@locked_specs
262262
elsif !unlocking? && nothing_changed?
263263
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
264-
SpecSet.new(filter_specs(@locked_specs, @dependencies.select{|dep| @locked_specs[dep].any? }))
264+
SpecSet.new(filter_specs(@locked_specs, @dependencies.select {|dep| @locked_specs[dep].any? }))
265265
else
266266
last_resolve = converge_locked_specs
267267
# Run a resolve against the locally available gems
@@ -731,7 +731,7 @@ def converge_specs(specs)
731731
end
732732
end
733733

734-
SpecSet.new(filter_specs(converged, deps).reject{|s| @unlock[:gems].include?(s.name) })
734+
SpecSet.new(filter_specs(converged, deps).reject {|s| @unlock[:gems].include?(s.name) })
735735
end
736736

737737
def metadata_dependencies

lib/bundler/dsl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def eval_gemfile(gemfile, contents = nil)
4646
@gemfile = expanded_gemfile_path
4747
@gemfiles << expanded_gemfile_path
4848
contents ||= Bundler.read_file(@gemfile.to_s)
49-
instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1)
49+
instance_eval(contents.dup.tap {|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1)
5050
rescue Exception => e # rubocop:disable Lint/RescueException
5151
message = "There was an error " \
5252
"#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \

lib/bundler/gem_helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def select_best_platform_match(specs, platform)
4848
sorted_matching = matching.sort_by {|spec| platform_specificity_match(spec.platform, platform) }
4949
exemplary_spec = sorted_matching.first
5050

51-
sorted_matching.take_while{|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
51+
sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
5252
end
5353
module_function :select_best_platform_match
5454

lib/bundler/resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def self.resolve(requirements, source_requirements = {}, base = [], gem_version_
2121
base = SpecSet.new(base) unless base.is_a?(SpecSet)
2222
resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
2323
result = resolver.start(requirements)
24-
SpecSet.new(SpecSet.new(result).for(requirements.reject{|dep| dep.name.end_with?("\0") }))
24+
SpecSet.new(SpecSet.new(result).for(requirements.reject {|dep| dep.name.end_with?("\0") }))
2525
end
2626

2727
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)

lib/bundler/rubygems_ext.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def source
3434

3535
def full_gem_path
3636
if source.respond_to?(:root)
37-
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
37+
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
3838
else
3939
rg_full_gem_path
4040
end

lib/bundler/shared_helpers.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ module SharedHelpers
1313
def root
1414
gemfile = find_gemfile
1515
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
16-
Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent
16+
Pathname.new(gemfile).tap {|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent
1717
end
1818

1919
def default_gemfile
2020
gemfile = find_gemfile
2121
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
22-
Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path
22+
Pathname.new(gemfile).tap {|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path
2323
end
2424

2525
def default_lockfile
@@ -28,7 +28,7 @@ def default_lockfile
2828
case gemfile.basename.to_s
2929
when "gems.rb" then Pathname.new(gemfile.sub(/.rb$/, ".locked"))
3030
else Pathname.new("#{gemfile}.lock")
31-
end.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
31+
end.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
3232
end
3333

3434
def default_bundle_dir
@@ -100,7 +100,7 @@ def set_bundle_environment
100100
#
101101
# @see {Bundler::PermissionError}
102102
def filesystem_access(path, action = :write, &block)
103-
yield(path.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" })
103+
yield(path.dup.tap {|x| x.untaint if RUBY_VERSION < "2.7" })
104104
rescue Errno::EACCES
105105
raise PermissionError.new(path, action)
106106
rescue Errno::EAGAIN
@@ -236,7 +236,7 @@ def find_directory(*names)
236236

237237
def search_up(*names)
238238
previous = nil
239-
current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
239+
current = File.expand_path(SharedHelpers.pwd).tap {|x| x.untaint if RUBY_VERSION < "2.7" }
240240

241241
until !File.directory?(current) || current == previous
242242
if ENV["BUNDLER_SPEC_RUN"]

lib/bundler/source/git.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def validate_spec(_spec); end
336336

337337
def load_gemspec(file)
338338
stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
339-
stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
339+
stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap {|x| x.untaint if RUBY_VERSION < "2.7" }
340340
StubSpecification.from_stub(stub)
341341
end
342342

lib/bundler/spec_set.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def for(dependencies, check = false, match_current_platform = false)
1818

1919
loop do
2020
break unless dep = deps.shift
21-
next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"
21+
next if handled.any? {|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"
2222

2323
handled << dep
2424

@@ -174,7 +174,7 @@ def tsort_each_node
174174
def spec_for_dependency(dep, match_current_platform)
175175
specs_for_platforms = lookup[dep.name]
176176
if match_current_platform
177-
GemHelpers.select_best_platform_match(specs_for_platforms.select{|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
177+
GemHelpers.select_best_platform_match(specs_for_platforms.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
178178
else
179179
GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
180180
end

lib/rubygems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ module Gem
117117
# Taint support is deprecated in Ruby 2.7.
118118
# This allows switching ".untaint" to ".tap(&Gem::UNTAINT)",
119119
# to avoid deprecation warnings in Ruby 2.7.
120-
UNTAINT = RUBY_VERSION < '2.7' ? :untaint.to_sym : proc{}
120+
UNTAINT = RUBY_VERSION < '2.7' ? :untaint.to_sym : proc {}
121121

122122
# When https://bugs.ruby-lang.org/issues/17259 is available, there is no need to override Kernel#warn
123123
KERNEL_WARN_IGNORES_INTERNAL_ENTRIES = RUBY_ENGINE == "truffleruby" ||

0 commit comments

Comments
 (0)