diff options
author | Hiroshi SHIBATA <[email protected]> | 2022-05-20 17:15:15 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-05-20 17:32:19 +0900 |
commit | aeea88174d88264469b406003765c7efdcd53edf () | |
tree | a4d9de6d1a0027f5b9c2f2050bca2586b87596bb /lib | |
parent | bd8df25cdc8e0e94cbc2eacc492a764e6b90833c (diff) |
Merge RubyGems and Bundler HEAD
https://.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
-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 | ||||
-rw-r--r-- | lib/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/specification_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/ext/builder.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/gemcutter_utilities.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/installer.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/local_remote_options.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/query_utils.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/spec_fetcher.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification_policy.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/util.rb | 2 |
22 files changed, 31 insertions, 31 deletions
@@ -40,7 +40,7 @@ module Bundler end def self.verbalize_groups(groups) - 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" @@ -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? })) 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) }) end def metadata_dependencies @@ -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) rescue Exception => e # rubocop:disable Lint/RescueException message = "There was an error " \ "#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \ @@ -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) } end module_function :select_best_platform_match @@ -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") })) end def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms) @@ -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" } else rg_full_gem_path end @@ -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 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 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 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" }) 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" } until !File.directory?(current) || current == previous if ENV["BUNDLER_SPEC_RUN"] @@ -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" } StubSpecification.from_stub(stub) end @@ -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" 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) else GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform) end @@ -117,7 +117,7 @@ module Gem # Taint support is deprecated in Ruby 2.7. # This allows switching ".untaint" to ".tap(&Gem::UNTAINT)", # to avoid deprecation warnings in Ruby 2.7. - UNTAINT = RUBY_VERSION < '2.7' ? :untaint.to_sym : proc{} # When https://bugs.ruby-lang.org/issues/17259 is available, there is no need to override Kernel#warn KERNEL_WARN_IGNORES_INTERNAL_ENTRIES = RUBY_ENGINE == "truffleruby" || @@ -113,7 +113,7 @@ extensions will be restored. end.flatten end - specs = specs.select{|spec| RUBY_ENGINE == spec.platform || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY } if specs.to_a.empty? raise Gem::Exception, @@ -475,7 +475,7 @@ By default, this RubyGems will install gem as: def files_in(dir) Dir.chdir dir do Dir.glob(File.join('**', '*'), File::FNM_DOTMATCH). - select{|f| !File.directory?(f) } end end @@ -129,7 +129,7 @@ Specific fields in the specification can be extracted in YAML format: platform = get_platform_from_requirements(options) if platform - specs = specs.select{|s| s.platform.to_s == platform } end unless options[:all] @@ -63,7 +63,7 @@ class Gem::Ext::Builder require "open3" # Set $SOURCE_DATE_EPOCH for the subprocess. - env = {'SOURCE_DATE_EPOCH' => Gem.source_date_epoch_string} output, status = begin Open3.capture2e(env, *command, :chdir => dir) rescue => error @@ -135,7 +135,7 @@ module Gem::GemcutterUtilities sign_in_host, scope: scope) do |request| request.basic_auth email, password request["OTP"] = otp if otp - request.body = URI.encode_www_form({:api_key => api_key }.merge(update_scope_params)) end with_response response do |resp| @@ -725,11 +725,11 @@ class Gem::Installer raise Gem::InstallError, "#{spec} has an invalid name" end - if spec.raw_require_paths.any?{|path| path =~ /\R/ } raise Gem::InstallError, "#{spec} has an invalid require_paths" end - if spec.extensions.any?{|ext| ext =~ /\R/ } raise Gem::InstallError, "#{spec} has an invalid extensions" end @@ -26,7 +26,7 @@ module Gem::LocalRemoteOptions valid_uri_schemes = ["http", "https", "file", "s3"] unless valid_uri_schemes.include?(uri.scheme) - msg = "Invalid uri scheme for #{value}\nPreface URLs with one of #{valid_uri_schemes.map{|s| "#{s}://" }}" raise ArgumentError, msg end @@ -61,7 +61,7 @@ module Gem::QueryUtils gem_names = if args.empty? [options[:name]] else - options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/i } end terminate_interaction(check_installed_gems(gem_names)) if check_installed_gems? @@ -91,8 +91,8 @@ class Gem::SpecFetcher list.each do |source, specs| if dependency.name.is_a?(String) && specs.respond_to?(:bsearch) - start_index = (0 ... specs.length).bsearch{|i| specs[i].name >= dependency.name } - end_index = (0 ... specs.length).bsearch{|i| specs[i].name > dependency.name } specs = specs[start_index ... end_index] if start_index && end_index end @@ -157,7 +157,7 @@ class Gem::Specification < Gem::BasicSpecification }.freeze # rubocop:disable Style/MutableConstant - INITIALIZE_CODE_FOR_DEFAULTS = { } # :nodoc: # rubocop:enable Style/MutableConstant @@default_value.each do |k,v| @@ -1110,7 +1110,7 @@ class Gem::Specification < Gem::BasicSpecification result[spec.name] = spec end - result.map(&:last).flatten.sort_by{|tup| tup.name } end ## @@ -154,7 +154,7 @@ class Gem::SpecificationPolicy def validate_duplicate_dependencies # :nodoc: # NOTE: see REFACTOR note in Gem::Dependency about types - this might be brittle - seen = Gem::Dependency::TYPES.inject({}) {|types, type| types.merge({ type => {}}) } error_messages = [] @specification.dependencies.each do |dep| @@ -60,7 +60,7 @@ module Gem::Util # Invokes system, but silences all output. def self.silent_system(*command) - opt = {:out => IO::NULL, :err => [:child, :out]} if Hash === command.last opt.update(command.last) cmds = command[0...-1] |