mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.
It supports to enable frozen string literal and add `--norc` option for
  disable to `.gemrc` configuration.
  See 2.5.2 release notes for other fixes and enhancements.
  a8aa3bac72/History.txt (L3)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
			
			
This commit is contained in:
		
							parent
							
								
									94cfa2893c
								
							
						
					
					
						commit
						a21d403f21
					
				
					 304 changed files with 966 additions and 624 deletions
				
			
		| 
						 | 
					@ -1,3 +1,11 @@
 | 
				
			||||||
 | 
					Mon Feb  1 21:41:58 2016  SHIBATA Hiroshi  <hsbt@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.
 | 
				
			||||||
 | 
						  It supports to enable frozen string literal and add `--norc` option for
 | 
				
			||||||
 | 
						  disable to `.gemrc` configuration.
 | 
				
			||||||
 | 
						  See 2.5.2 release notes for other fixes and enhancements.
 | 
				
			||||||
 | 
						  https://github.com/rubygems/rubygems/blob/a8aa3bac723f045c52471c7b9328310a048561e0/History.txt#L3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Sun Jan 31 12:33:13 2016  Dan Kreiger  <dan@dankreiger.com>
 | 
					Sun Jan 31 12:33:13 2016  Dan Kreiger  <dan@dankreiger.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* test/drb/ut_large.rb (multiply, avg, median): add additional
 | 
						* test/drb/ut_large.rb (multiply, avg, median): add additional
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# -*- ruby -*-
 | 
					# -*- ruby -*-
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@ require 'rbconfig'
 | 
				
			||||||
require 'thread'
 | 
					require 'thread'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module Gem
 | 
					module Gem
 | 
				
			||||||
  VERSION = '2.5.1'
 | 
					  VERSION = '2.5.2'
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Must be first since it unloads the prelude from 1.9.2
 | 
					# Must be first since it unloads the prelude from 1.9.2
 | 
				
			||||||
| 
						 | 
					@ -239,7 +239,7 @@ module Gem
 | 
				
			||||||
    specs = dep.matching_specs(true)
 | 
					    specs = dep.matching_specs(true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    raise Gem::GemNotFoundException,
 | 
					    raise Gem::GemNotFoundException,
 | 
				
			||||||
          "can't find gem #{name} (#{requirements})" if specs.empty?
 | 
					          "can't find gem #{dep}" if specs.empty?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    specs = specs.find_all { |spec|
 | 
					    specs = specs.find_all { |spec|
 | 
				
			||||||
      spec.executables.include? exec_name
 | 
					      spec.executables.include? exec_name
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
class Gem::AvailableSet
 | 
					class Gem::AvailableSet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  include Enumerable
 | 
					  include Enumerable
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# BasicSpecification is an abstract class which implements some common code
 | 
					# BasicSpecification is an abstract class which implements some common code
 | 
				
			||||||
# used by both Specification and StubSpecification.
 | 
					# used by both Specification and StubSpecification.
 | 
				
			||||||
| 
						 | 
					@ -125,9 +125,9 @@ class Gem::BasicSpecification
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def full_name
 | 
					  def full_name
 | 
				
			||||||
    if platform == Gem::Platform::RUBY or platform.nil? then
 | 
					    if platform == Gem::Platform::RUBY or platform.nil? then
 | 
				
			||||||
      "#{name}-#{version}".untaint
 | 
					      "#{name}-#{version}".dup.untaint
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      "#{name}-#{version}-#{platform}".untaint
 | 
					      "#{name}-#{version}-#{platform}".dup.untaint
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -282,7 +282,7 @@ class Gem::BasicSpecification
 | 
				
			||||||
             self.require_paths.first
 | 
					             self.require_paths.first
 | 
				
			||||||
           end
 | 
					           end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "#{self.full_gem_path}/#{dirs}".untaint
 | 
					    "#{self.full_gem_path}/#{dirs}".dup.untaint
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
| 
						 | 
					@ -326,4 +326,3 @@ class Gem::BasicSpecification
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -154,7 +154,7 @@ class Gem::Command
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def show_lookup_failure(gem_name, version, errors, domain)
 | 
					  def show_lookup_failure(gem_name, version, errors, domain)
 | 
				
			||||||
    if errors and !errors.empty?
 | 
					    if errors and !errors.empty?
 | 
				
			||||||
      msg = "Could not find a valid gem '#{gem_name}' (#{version}), here is why:\n"
 | 
					      msg = "Could not find a valid gem '#{gem_name}' (#{version}), here is why:\n".dup
 | 
				
			||||||
      errors.each { |x| msg << "          #{x.wordy}\n" }
 | 
					      errors.each { |x| msg << "          #{x.wordy}\n" }
 | 
				
			||||||
      alert_error msg
 | 
					      alert_error msg
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
| 
						 | 
					@ -540,6 +540,11 @@ class Gem::Command
 | 
				
			||||||
                    'Turn on Ruby debugging') do
 | 
					                    'Turn on Ruby debugging') do
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  add_common_option('--norc',
 | 
				
			||||||
 | 
					                    'Avoid loading any .gemrc file') do
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # :stopdoc:
 | 
					  # :stopdoc:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  HELP = <<-HELP
 | 
					  HELP = <<-HELP
 | 
				
			||||||
| 
						 | 
					@ -580,4 +585,3 @@ end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module Gem::Commands
 | 
					module Gem::Commands
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/package'
 | 
					require 'rubygems/package'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,6 +42,10 @@ with gem spec:
 | 
				
			||||||
  def execute
 | 
					  def execute
 | 
				
			||||||
    gemspec = get_one_gem_name
 | 
					    gemspec = get_one_gem_name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    unless File.exist? gemspec
 | 
				
			||||||
 | 
					      gemspec += '.gemspec' if File.exist? gemspec + '.gemspec'
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if File.exist? gemspec then
 | 
					    if File.exist? gemspec then
 | 
				
			||||||
      spec = Gem::Specification.load gemspec
 | 
					      spec = Gem::Specification.load gemspec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/security'
 | 
					require 'rubygems/security'
 | 
				
			||||||
begin
 | 
					begin
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
require 'rubygems/validator'
 | 
					require 'rubygems/validator'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/dependency_list'
 | 
					require 'rubygems/dependency_list'
 | 
				
			||||||
require 'rubygems/uninstaller'
 | 
					require 'rubygems/uninstaller'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'English'
 | 
					require 'English'
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					@ -100,7 +100,7 @@ use with other commands.
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def display_readable specs, reverse # :nodoc:
 | 
					  def display_readable specs, reverse # :nodoc:
 | 
				
			||||||
    response = ''
 | 
					    response = String.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    specs.each do |spec|
 | 
					    specs.each do |spec|
 | 
				
			||||||
      response << print_dependencies(spec)
 | 
					      response << print_dependencies(spec)
 | 
				
			||||||
| 
						 | 
					@ -153,7 +153,7 @@ use with other commands.
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def print_dependencies(spec, level = 0) # :nodoc:
 | 
					  def print_dependencies(spec, level = 0) # :nodoc:
 | 
				
			||||||
    response = ''
 | 
					    response = String.new
 | 
				
			||||||
    response << '  ' * level + "Gem #{spec.full_name}\n"
 | 
					    response << '  ' * level + "Gem #{spec.full_name}\n"
 | 
				
			||||||
    unless spec.dependencies.empty? then
 | 
					    unless spec.dependencies.empty? then
 | 
				
			||||||
      spec.dependencies.sort_by { |dep| dep.name }.each do |dep|
 | 
					      spec.dependencies.sort_by { |dep| dep.name }.each do |dep|
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Commands::EnvironmentCommand < Gem::Command
 | 
					class Gem::Commands::EnvironmentCommand < Gem::Command
 | 
				
			||||||
| 
						 | 
					@ -72,7 +72,7 @@ lib/rubygems/defaults/operating_system.rb
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def execute
 | 
					  def execute
 | 
				
			||||||
    out = ''
 | 
					    out = String.new
 | 
				
			||||||
    arg = options[:args][0]
 | 
					    arg = options[:args][0]
 | 
				
			||||||
    out <<
 | 
					    out <<
 | 
				
			||||||
      case arg
 | 
					      case arg
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,7 @@ lib/rubygems/defaults/operating_system.rb
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def show_environment # :nodoc:
 | 
					  def show_environment # :nodoc:
 | 
				
			||||||
    out = "RubyGems Environment:\n"
 | 
					    out = "RubyGems Environment:\n".dup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    out << "  - RUBYGEMS VERSION: #{Gem::VERSION}\n"
 | 
					    out << "  - RUBYGEMS VERSION: #{Gem::VERSION}\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -158,4 +158,3 @@ lib/rubygems/defaults/operating_system.rb
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/indexer'
 | 
					require 'rubygems/indexer'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Commands::HelpCommand < Gem::Command
 | 
					class Gem::Commands::HelpCommand < Gem::Command
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/install_update_options'
 | 
					require 'rubygems/install_update_options'
 | 
				
			||||||
require 'rubygems/dependency_installer'
 | 
					require 'rubygems/dependency_installer'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/commands/query_command'
 | 
					require 'rubygems/commands/query_command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Commands::LockCommand < Gem::Command
 | 
					class Gem::Commands::LockCommand < Gem::Command
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unless defined? Gem::Commands::MirrorCommand
 | 
					unless defined? Gem::Commands::MirrorCommand
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'English'
 | 
					require 'English'
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/spec_fetcher'
 | 
					require 'rubygems/spec_fetcher'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/gemcutter_utilities'
 | 
					require 'rubygems/gemcutter_utilities'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/package'
 | 
					require 'rubygems/package'
 | 
				
			||||||
require 'rubygems/installer'
 | 
					require 'rubygems/installer'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/gemcutter_utilities'
 | 
					require 'rubygems/gemcutter_utilities'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/spec_fetcher'
 | 
					require 'rubygems/spec_fetcher'
 | 
				
			||||||
| 
						 | 
					@ -50,6 +50,12 @@ class Gem::Commands::QueryCommand < Gem::Command
 | 
				
			||||||
      options[:all] = value
 | 
					      options[:all] = value
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    add_option('-e', '--exact',
 | 
				
			||||||
 | 
					               'Name of gem(s) to query on matches the',
 | 
				
			||||||
 | 
					               'provided STRING') do |value, options|
 | 
				
			||||||
 | 
					      options[:exact] = value
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add_option(      '--[no-]prerelease',
 | 
					    add_option(      '--[no-]prerelease',
 | 
				
			||||||
               'Display prerelease versions') do |value, options|
 | 
					               'Display prerelease versions') do |value, options|
 | 
				
			||||||
      options[:prerelease] = value
 | 
					      options[:prerelease] = value
 | 
				
			||||||
| 
						 | 
					@ -79,7 +85,8 @@ is too hard to use.
 | 
				
			||||||
    elsif !options[:name].source.empty?
 | 
					    elsif !options[:name].source.empty?
 | 
				
			||||||
      name = Array(options[:name])
 | 
					      name = Array(options[:name])
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      name = options[:args].to_a.map{|arg| /#{arg}/i }
 | 
					      args = options[:args].to_a
 | 
				
			||||||
 | 
					      name = options[:exact] ? args : args.map{|arg| /#{arg}/i }
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    prerelease = options[:prerelease]
 | 
					    prerelease = options[:prerelease]
 | 
				
			||||||
| 
						 | 
					@ -162,7 +169,7 @@ is too hard to use.
 | 
				
			||||||
               :latest
 | 
					               :latest
 | 
				
			||||||
             end
 | 
					             end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if name.source.empty?
 | 
					      if name.respond_to?(:source) && name.source.empty?
 | 
				
			||||||
        spec_tuples = fetcher.detect(type) { true }
 | 
					        spec_tuples = fetcher.detect(type) { true }
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        spec_tuples = fetcher.detect(type) do |name_tuple|
 | 
					        spec_tuples = fetcher.detect(type) do |name_tuple|
 | 
				
			||||||
| 
						 | 
					@ -277,7 +284,7 @@ is too hard to use.
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def spec_authors entry, spec
 | 
					  def spec_authors entry, spec
 | 
				
			||||||
    authors = "Author#{spec.authors.length > 1 ? 's' : ''}: "
 | 
					    authors = "Author#{spec.authors.length > 1 ? 's' : ''}: ".dup
 | 
				
			||||||
    authors << spec.authors.join(', ')
 | 
					    authors << spec.authors.join(', ')
 | 
				
			||||||
    entry << format_text(authors, 68, 4)
 | 
					    entry << format_text(authors, 68, 4)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					@ -291,7 +298,7 @@ is too hard to use.
 | 
				
			||||||
  def spec_license entry, spec
 | 
					  def spec_license entry, spec
 | 
				
			||||||
    return if spec.license.nil? or spec.license.empty?
 | 
					    return if spec.license.nil? or spec.license.empty?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: "
 | 
					    licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: ".dup
 | 
				
			||||||
    licenses << spec.licenses.join(', ')
 | 
					    licenses << spec.licenses.join(', ')
 | 
				
			||||||
    entry << "\n" << format_text(licenses, 68, 4)
 | 
					    entry << "\n" << format_text(licenses, 68, 4)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					@ -341,4 +348,3 @@ is too hard to use.
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
require 'rubygems/rdoc'
 | 
					require 'rubygems/rdoc'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/commands/query_command'
 | 
					require 'rubygems/commands/query_command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/server'
 | 
					require 'rubygems/server'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/remote_fetcher'
 | 
					require 'rubygems/remote_fetcher'
 | 
				
			||||||
require 'rubygems/spec_fetcher'
 | 
					require 'rubygems/spec_fetcher'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Commands::StaleCommand < Gem::Command
 | 
					class Gem::Commands::StaleCommand < Gem::Command
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
require 'rubygems/uninstaller'
 | 
					require 'rubygems/uninstaller'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/installer'
 | 
					require 'rubygems/installer'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/command_manager'
 | 
					require 'rubygems/command_manager'
 | 
				
			||||||
require 'rubygems/dependency_installer'
 | 
					require 'rubygems/dependency_installer'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Commands::WhichCommand < Gem::Command
 | 
					class Gem::Commands::WhichCommand < Gem::Command
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
require 'rubygems/local_remote_options'
 | 
					require 'rubygems/local_remote_options'
 | 
				
			||||||
require 'rubygems/version_option'
 | 
					require 'rubygems/version_option'
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ as the reason for the removal request.
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def usage # :nodoc:
 | 
					  def usage # :nodoc:
 | 
				
			||||||
    "#{program_name} GEM -v VERSION [-p PLATFORM] [--undo] [--key KEY_NAME]"
 | 
					    "#{program_name} GEM -v VERSION [-p PLATFORM] [--key KEY_NAME] [--host HOST]"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize
 | 
					  def initialize
 | 
				
			||||||
| 
						 | 
					@ -41,25 +41,25 @@ as the reason for the removal request.
 | 
				
			||||||
    add_version_option("remove")
 | 
					    add_version_option("remove")
 | 
				
			||||||
    add_platform_option("remove")
 | 
					    add_platform_option("remove")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add_option('--undo') do |value, options|
 | 
					    add_option('--host HOST',
 | 
				
			||||||
      options[:undo] = true
 | 
					               'Yank from another gemcutter-compatible host') do |value, options|
 | 
				
			||||||
 | 
					      options[:host] = value
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add_key_option
 | 
					    add_key_option
 | 
				
			||||||
 | 
					    @host = nil
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def execute
 | 
					  def execute
 | 
				
			||||||
    sign_in
 | 
					    @host = options[:host]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    sign_in @host
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    version   = get_version_from_requirements(options[:version])
 | 
					    version   = get_version_from_requirements(options[:version])
 | 
				
			||||||
    platform  = get_platform_from_requirements(options)
 | 
					    platform  = get_platform_from_requirements(options)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if version then
 | 
					    if version then
 | 
				
			||||||
      if options[:undo] then
 | 
					 | 
				
			||||||
        unyank_gem(version, platform)
 | 
					 | 
				
			||||||
      else
 | 
					 | 
				
			||||||
      yank_gem(version, platform)
 | 
					      yank_gem(version, platform)
 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      say "A version argument is required: #{usage}"
 | 
					      say "A version argument is required: #{usage}"
 | 
				
			||||||
      terminate_interaction
 | 
					      terminate_interaction
 | 
				
			||||||
| 
						 | 
					@ -71,16 +71,11 @@ as the reason for the removal request.
 | 
				
			||||||
    yank_api_request(:delete, version, platform, "api/v1/gems/yank")
 | 
					    yank_api_request(:delete, version, platform, "api/v1/gems/yank")
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def unyank_gem(version, platform)
 | 
					 | 
				
			||||||
    say "Unyanking gem from #{host}..."
 | 
					 | 
				
			||||||
    yank_api_request(:put, version, platform, "api/v1/gems/unyank")
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def yank_api_request(method, version, platform, api)
 | 
					  def yank_api_request(method, version, platform, api)
 | 
				
			||||||
    name = get_one_gem_name
 | 
					    name = get_one_gem_name
 | 
				
			||||||
    response = rubygems_api_request(method, api) do |request|
 | 
					    response = rubygems_api_request(method, api, host) do |request|
 | 
				
			||||||
      request.add_field("Authorization", api_key)
 | 
					      request.add_field("Authorization", api_key)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      data = {
 | 
					      data = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# :stopdoc:
 | 
					# :stopdoc:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -201,11 +201,12 @@ class Gem::ConfigFile
 | 
				
			||||||
      result.merge load_file file
 | 
					      result.merge load_file file
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @hash = operating_system_config.merge platform_config
 | 
					    @hash = operating_system_config.merge platform_config
 | 
				
			||||||
 | 
					    unless arg_list.index '--norc'
 | 
				
			||||||
      @hash = @hash.merge system_config
 | 
					      @hash = @hash.merge system_config
 | 
				
			||||||
      @hash = @hash.merge user_config
 | 
					      @hash = @hash.merge user_config
 | 
				
			||||||
      @hash = @hash.merge environment_config
 | 
					      @hash = @hash.merge environment_config
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # HACK these override command-line args, which is bad
 | 
					    # HACK these override command-line args, which is bad
 | 
				
			||||||
    @backtrace                  = @hash[:backtrace]                  if @hash.key? :backtrace
 | 
					    @backtrace                  = @hash[:backtrace]                  if @hash.key? :backtrace
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# RubyGems adds the #gem method to allow activation of specific gem versions
 | 
					# RubyGems adds the #gem method to allow activation of specific gem versions
 | 
				
			||||||
# and overrides the #require method on Kernel to make gems appear as if they
 | 
					# and overrides the #require method on Kernel to make gems appear as if they
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
module Gem
 | 
					module Gem
 | 
				
			||||||
  DEFAULT_HOST = "https://rubygems.org"
 | 
					  DEFAULT_HOST = "https://rubygems.org"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# The Dependency class holds a Gem name and a Gem::Requirement.
 | 
					# The Dependency class holds a Gem name and a Gem::Requirement.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -307,9 +307,9 @@ class Gem::Dependency
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if specs.empty?
 | 
					      if specs.empty?
 | 
				
			||||||
        total = Gem::Specification.to_a.size
 | 
					        total = Gem::Specification.to_a.size
 | 
				
			||||||
        msg   = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
 | 
					        msg   = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n".dup
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        msg   = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n"
 | 
					        msg   = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n".dup
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
 | 
					      msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/dependency_list'
 | 
					require 'rubygems/dependency_list'
 | 
				
			||||||
require 'rubygems/package'
 | 
					require 'rubygems/package'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Provides a single method +deprecate+ to be used to declare when
 | 
					# Provides a single method +deprecate+ to be used to declare when
 | 
				
			||||||
# something is going away.
 | 
					# something is going away.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/user_interaction'
 | 
					require 'rubygems/user_interaction'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# This file contains all the various exceptions and other errors that are used
 | 
					# This file contains all the various exceptions and other errors that are used
 | 
				
			||||||
# inside of RubyGems.
 | 
					# inside of RubyGems.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# TODO: the documentation in here is terrible.
 | 
					# TODO: the documentation in here is terrible.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Each exception needs a brief description and the scenarios where it is
 | 
					# Each exception needs a brief description and the scenarios where it is
 | 
				
			||||||
| 
						 | 
					@ -138,7 +138,7 @@ class Gem::ImpossibleDependenciesError < Gem::Exception
 | 
				
			||||||
    requester  = requester ? requester.spec.full_name : 'The user'
 | 
					    requester  = requester ? requester.spec.full_name : 'The user'
 | 
				
			||||||
    dependency = @request.dependency
 | 
					    dependency = @request.dependency
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    message = "#{requester} requires #{dependency} but it conflicted:\n"
 | 
					    message = "#{requester} requires #{dependency} but it conflicted:\n".dup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @conflicts.each do |_, conflict|
 | 
					    @conflicts.each do |_, conflict|
 | 
				
			||||||
      message << conflict.explanation
 | 
					      message << conflict.explanation
 | 
				
			||||||
| 
						 | 
					@ -268,4 +268,3 @@ end
 | 
				
			||||||
# Backwards compatible typo'd exception class for early RubyGems 2.0.x
 | 
					# Backwards compatible typo'd exception class for early RubyGems 2.0.x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Gem::UnsatisfiableDepedencyError = Gem::UnsatisfiableDependencyError # :nodoc:
 | 
					Gem::UnsatisfiableDepedencyError = Gem::UnsatisfiableDependencyError # :nodoc:
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Raised when there is an error while building extensions.
 | 
					# Raised when there is an error while building extensions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/command'
 | 
					require 'rubygems/command'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
 | 
					class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -12,9 +12,20 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
 | 
				
			||||||
  FileEntry = FileUtils::Entry_ # :nodoc:
 | 
					  FileEntry = FileUtils::Entry_ # :nodoc:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil)
 | 
					  def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil)
 | 
				
			||||||
    # relative path required as some versions of mktmpdir return an absolute
 | 
					    tmp_dest = Dir.mktmpdir(".gem.", ".")
 | 
				
			||||||
    # path which breaks make if it includes a space in the name
 | 
					
 | 
				
			||||||
    tmp_dest = get_relative_path(Dir.mktmpdir(".gem.", "."))
 | 
					    # Some versions of `mktmpdir` return absolute paths, which will break make
 | 
				
			||||||
 | 
					    # if the paths contain spaces. However, on Ruby 1.9.x on Windows, relative
 | 
				
			||||||
 | 
					    # paths cause all C extension builds to fail.
 | 
				
			||||||
 | 
					    #
 | 
				
			||||||
 | 
					    # As such, we convert to a relative path unless we are using Ruby 1.9.x on
 | 
				
			||||||
 | 
					    # Windows. This means that when using Ruby 1.9.x on Windows, paths with
 | 
				
			||||||
 | 
					    # spaces do not work.
 | 
				
			||||||
 | 
					    #
 | 
				
			||||||
 | 
					    # Details: https://github.com/rubygems/rubygems/issues/977#issuecomment-171544940
 | 
				
			||||||
 | 
					    #
 | 
				
			||||||
 | 
					    # TODO: Make this unconditional when rubygems no longer supports Ruby 1.9.x.
 | 
				
			||||||
 | 
					    tmp_dest = get_relative_path(tmp_dest) unless Gem.win_platform? && RUBY_VERSION <= '2.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = nil
 | 
					    t = nil
 | 
				
			||||||
    Tempfile.open %w"siteconf .rb", "." do |siteconf|
 | 
					    Tempfile.open %w"siteconf .rb", "." do |siteconf|
 | 
				
			||||||
| 
						 | 
					@ -81,4 +92,3 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/remote_fetcher'
 | 
					require 'rubygems/remote_fetcher'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
| 
						 | 
					@ -69,10 +69,15 @@ module Gem::GemcutterUtilities
 | 
				
			||||||
      terminate_interaction 1 # TODO: question this
 | 
					      terminate_interaction 1 # TODO: question this
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if allowed_push_host and self.host != allowed_push_host
 | 
					    if allowed_push_host
 | 
				
			||||||
 | 
					      allowed_host_uri = URI.parse(allowed_push_host)
 | 
				
			||||||
 | 
					      host_uri         = URI.parse(self.host)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      unless (host_uri.scheme == allowed_host_uri.scheme) && (host_uri.host == allowed_host_uri.host)
 | 
				
			||||||
        alert_error "#{self.host.inspect} is not allowed by the gemspec, which only allows #{allowed_push_host.inspect}"
 | 
					        alert_error "#{self.host.inspect} is not allowed by the gemspec, which only allows #{allowed_push_host.inspect}"
 | 
				
			||||||
        terminate_interaction 1
 | 
					        terminate_interaction 1
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    uri = URI.parse "#{self.host}/#{path}"
 | 
					    uri = URI.parse "#{self.host}/#{path}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/package'
 | 
					require 'rubygems/package'
 | 
				
			||||||
require 'time'
 | 
					require 'time'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/user_interaction'
 | 
					require 'rubygems/user_interaction'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/user_interaction'
 | 
					require 'rubygems/user_interaction'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -174,6 +174,11 @@ module Gem::InstallUpdateOptions
 | 
				
			||||||
                "meet version requirements") do |value, options|
 | 
					                "meet version requirements") do |value, options|
 | 
				
			||||||
      options[:minimal_deps] = true
 | 
					      options[:minimal_deps] = true
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    add_option(:"Install/Update", "--[no-]post-install-message",
 | 
				
			||||||
 | 
					                "Print post install message") do |value, options|
 | 
				
			||||||
 | 
					      options[:post_install_message] = value
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -213,7 +213,13 @@ class Gem::Installer
 | 
				
			||||||
      next unless io.gets =~ /This file was generated by RubyGems/
 | 
					      next unless io.gets =~ /This file was generated by RubyGems/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      ruby_executable = true
 | 
					      ruby_executable = true
 | 
				
			||||||
      existing = io.read.slice(/^gem (['"])(.*?)(\1),/, 2)
 | 
					      existing = io.read.slice(%r{
 | 
				
			||||||
 | 
					          ^(
 | 
				
			||||||
 | 
					            gem \s |
 | 
				
			||||||
 | 
					            load \s Gem\.bin_path\(
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
 | 
					          (['"])(.*?)(\2),
 | 
				
			||||||
 | 
					        }x, 3)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return if spec.name == existing
 | 
					    return if spec.name == existing
 | 
				
			||||||
| 
						 | 
					@ -221,7 +227,7 @@ class Gem::Installer
 | 
				
			||||||
    # somebody has written to RubyGems' directory, overwrite, too bad
 | 
					    # somebody has written to RubyGems' directory, overwrite, too bad
 | 
				
			||||||
    return if Gem.default_bindir != @bin_dir and not ruby_executable
 | 
					    return if Gem.default_bindir != @bin_dir and not ruby_executable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    question = "#{spec.name}'s executable \"#{filename}\" conflicts with "
 | 
					    question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ruby_executable then
 | 
					    if ruby_executable then
 | 
				
			||||||
      question << existing
 | 
					      question << existing
 | 
				
			||||||
| 
						 | 
					@ -297,7 +303,7 @@ class Gem::Installer
 | 
				
			||||||
      write_cache_file
 | 
					      write_cache_file
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    say spec.post_install_message unless spec.post_install_message.nil?
 | 
					    say spec.post_install_message if options[:post_install_message] && !spec.post_install_message.nil?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Gem::Installer.install_lock.synchronize { Gem::Specification.reset }
 | 
					    Gem::Installer.install_lock.synchronize { Gem::Specification.reset }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -627,7 +633,8 @@ class Gem::Installer
 | 
				
			||||||
      :bin_dir      => nil,
 | 
					      :bin_dir      => nil,
 | 
				
			||||||
      :env_shebang  => false,
 | 
					      :env_shebang  => false,
 | 
				
			||||||
      :force        => false,
 | 
					      :force        => false,
 | 
				
			||||||
      :only_install_dir => false
 | 
					      :only_install_dir => false,
 | 
				
			||||||
 | 
					      :post_install_message => true
 | 
				
			||||||
    }.merge options
 | 
					    }.merge options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @env_shebang         = options[:env_shebang]
 | 
					    @env_shebang         = options[:env_shebang]
 | 
				
			||||||
| 
						 | 
					@ -712,7 +719,6 @@ if ARGV.first
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gem '#{spec.name}', version
 | 
					 | 
				
			||||||
load Gem.bin_path('#{spec.name}', '#{bin_file_name}', version)
 | 
					load Gem.bin_path('#{spec.name}', '#{bin_file_name}', version)
 | 
				
			||||||
TEXT
 | 
					TEXT
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/test_case'
 | 
					require 'rubygems/test_case'
 | 
				
			||||||
require 'rubygems/installer'
 | 
					require 'rubygems/installer'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@ module Gem::LocalRemoteOptions
 | 
				
			||||||
        raise OptionParser::InvalidArgument, value
 | 
					        raise OptionParser::InvalidArgument, value
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      unless ['http', 'https', 'file'].include?(uri.scheme)
 | 
					      unless ['http', 'https', 'file', 's3'].include?(uri.scheme)
 | 
				
			||||||
         raise OptionParser::InvalidArgument, value
 | 
					         raise OptionParser::InvalidArgument, value
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'stringio'
 | 
					require 'stringio'
 | 
				
			||||||
require 'rubygems/user_interaction'
 | 
					require 'rubygems/user_interaction'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Represents a gem of name +name+ at +version+ of +platform+. These
 | 
					# Represents a gem of name +name+ at +version+ of +platform+. These
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ class Gem::NameTuple
 | 
				
			||||||
      "#{@name}-#{@version}"
 | 
					      "#{@name}-#{@version}"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      "#{@name}-#{@version}-#{@platform}"
 | 
					      "#{@name}-#{@version}-#{@platform}"
 | 
				
			||||||
    end.untaint
 | 
					    end.dup.untaint
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
# frozen_string_literal: false
 | 
					 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
					# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
				
			||||||
# See LICENSE.txt for additional licensing information.
 | 
					# See LICENSE.txt for additional licensing information.
 | 
				
			||||||
| 
						 | 
					@ -59,7 +59,7 @@ class Gem::Package
 | 
				
			||||||
      if source
 | 
					      if source
 | 
				
			||||||
        @path = source.path
 | 
					        @path = source.path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        message << " in #{path}" if path
 | 
					        message = message + " in #{path}" if path
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      super message
 | 
					      super message
 | 
				
			||||||
| 
						 | 
					@ -383,7 +383,7 @@ EOM
 | 
				
			||||||
          FileUtils.chmod entry.header.mode, destination
 | 
					          FileUtils.chmod entry.header.mode, destination
 | 
				
			||||||
        end if entry.file?
 | 
					        end if entry.file?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        File.symlink(install_location(entry.header.linkname, destination_dir), destination) if entry.symlink?
 | 
					        File.symlink(entry.header.linkname, destination) if entry.symlink?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        verbose destination
 | 
					        verbose destination
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# IO wrapper that creates digests of contents written to the IO it wraps.
 | 
					# IO wrapper that creates digests of contents written to the IO it wraps.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# The primary source of gems is a file on disk, including all usages
 | 
					# The primary source of gems is a file on disk, including all usages
 | 
				
			||||||
# internal to rubygems.
 | 
					# internal to rubygems.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Supports reading and writing gems from/to a generic IO object.  This is
 | 
					# Supports reading and writing gems from/to a generic IO object.  This is
 | 
				
			||||||
# useful for other applications built on top of rubygems, such as
 | 
					# useful for other applications built on top of rubygems, such as
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
					# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 | 
				
			||||||
# All rights reserved.
 | 
					# All rights reserved.
 | 
				
			||||||
| 
						 | 
					@ -64,7 +64,7 @@ class Gem::Package::Old < Gem::Package
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        destination = install_location full_name, destination_dir
 | 
					        destination = install_location full_name, destination_dir
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        file_data = ''
 | 
					        file_data = String.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        read_until_dashes io do |line|
 | 
					        read_until_dashes io do |line|
 | 
				
			||||||
          file_data << line
 | 
					          file_data << line
 | 
				
			||||||
| 
						 | 
					@ -95,7 +95,7 @@ class Gem::Package::Old < Gem::Package
 | 
				
			||||||
  # Reads the file list section from the old-format gem +io+
 | 
					  # Reads the file list section from the old-format gem +io+
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def file_list io # :nodoc:
 | 
					  def file_list io # :nodoc:
 | 
				
			||||||
    header = ''
 | 
					    header = String.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    read_until_dashes io do |line|
 | 
					    read_until_dashes io do |line|
 | 
				
			||||||
      header << line
 | 
					      header << line
 | 
				
			||||||
| 
						 | 
					@ -135,7 +135,7 @@ class Gem::Package::Old < Gem::Package
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return @spec if @spec
 | 
					    return @spec if @spec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    yaml = ''
 | 
					    yaml = String.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @gem.with_read_io do |io|
 | 
					    @gem.with_read_io do |io|
 | 
				
			||||||
      skip_ruby io
 | 
					      skip_ruby io
 | 
				
			||||||
| 
						 | 
					@ -176,4 +176,3 @@ class Gem::Package::Old < Gem::Package
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
class Gem::Package::Source # :nodoc:
 | 
					class Gem::Package::Source # :nodoc:
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
# frozen_string_literal: false
 | 
					 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
					# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
				
			||||||
# See LICENSE.txt for additional licensing information.
 | 
					# See LICENSE.txt for additional licensing information.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
# frozen_string_literal: false
 | 
					 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
					# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
				
			||||||
# See LICENSE.txt for additional licensing information.
 | 
					# See LICENSE.txt for additional licensing information.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
# frozen_string_literal: false
 | 
					 | 
				
			||||||
#++
 | 
					#++
 | 
				
			||||||
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
					# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
				
			||||||
# See LICENSE.txt for additional licensing information.
 | 
					# See LICENSE.txt for additional licensing information.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/test_case'
 | 
					require 'rubygems/test_case'
 | 
				
			||||||
require 'rubygems/package'
 | 
					require 'rubygems/package'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# -*- coding: utf-8 -*-
 | 
					# -*- coding: utf-8 -*-
 | 
				
			||||||
# frozen_string_literal: false
 | 
					 | 
				
			||||||
#--
 | 
					#--
 | 
				
			||||||
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
					# Copyright (C) 2004 Mauricio Julio Fernández Pradier
 | 
				
			||||||
# See LICENSE.txt for additional licensing information.
 | 
					# See LICENSE.txt for additional licensing information.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
 | 
					# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Permission is hereby granted, free of charge, to any person obtaining
 | 
					# Permission is hereby granted, free of charge, to any person obtaining
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings
 | 
					# Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings
 | 
				
			||||||
| 
						 | 
					@ -59,6 +59,9 @@ class Gem::PathSupport
 | 
				
			||||||
        gem_path = gpaths.dup
 | 
					        gem_path = gpaths.dup
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        gem_path = gpaths.split(Gem.path_separator)
 | 
					        gem_path = gpaths.split(Gem.path_separator)
 | 
				
			||||||
 | 
					        if gpaths.end_with?(Gem.path_separator)
 | 
				
			||||||
 | 
					          gem_path += default_path
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if File::ALT_SEPARATOR then
 | 
					      if File::ALT_SEPARATOR then
 | 
				
			||||||
| 
						 | 
					@ -69,13 +72,19 @@ class Gem::PathSupport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      gem_path << @home
 | 
					      gem_path << @home
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
 | 
					      gem_path = default_path
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @path = gem_path.uniq
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Return the default Gem path
 | 
				
			||||||
 | 
					  def default_path
 | 
				
			||||||
    gem_path = Gem.default_path + [@home]
 | 
					    gem_path = Gem.default_path + [@home]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if defined?(APPLE_GEM_HOME)
 | 
					    if defined?(APPLE_GEM_HOME)
 | 
				
			||||||
      gem_path << APPLE_GEM_HOME
 | 
					      gem_path << APPLE_GEM_HOME
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    end
 | 
					    gem_path
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @path = gem_path.uniq
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require "rubygems/deprecate"
 | 
					require "rubygems/deprecate"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
# This exists just to satisfy bugs in marshal'd gemspecs that
 | 
					# This exists just to satisfy bugs in marshal'd gemspecs that
 | 
				
			||||||
# contain a reference to YAML::PrivateType. We prune these out
 | 
					# contain a reference to YAML::PrivateType. We prune these out
 | 
				
			||||||
# in Specification._load, but if we don't have the constant, Marshal
 | 
					# in Specification._load, but if we don't have the constant, Marshal
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
module Gem
 | 
					module Gem
 | 
				
			||||||
  if defined? ::Psych::Visitors
 | 
					  if defined? ::Psych::Visitors
 | 
				
			||||||
    class NoAliasYAMLTree < Psych::Visitors::YAMLTree
 | 
					    class NoAliasYAMLTree < Psych::Visitors::YAMLTree
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/user_interaction'
 | 
					require 'rubygems/user_interaction'
 | 
				
			||||||
require 'fileutils'
 | 
					require 'fileutils'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems'
 | 
					require 'rubygems'
 | 
				
			||||||
require 'rubygems/request'
 | 
					require 'rubygems/request'
 | 
				
			||||||
require 'rubygems/uri_formatter'
 | 
					require 'rubygems/uri_formatter'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'net/http'
 | 
					require 'net/http'
 | 
				
			||||||
require 'thread'
 | 
					require 'thread'
 | 
				
			||||||
require 'time'
 | 
					require 'time'
 | 
				
			||||||
| 
						 | 
					@ -156,7 +156,7 @@ class Gem::Request
 | 
				
			||||||
          if Net::HTTPOK === incomplete_response
 | 
					          if Net::HTTPOK === incomplete_response
 | 
				
			||||||
            reporter.fetch(file_name, incomplete_response.content_length)
 | 
					            reporter.fetch(file_name, incomplete_response.content_length)
 | 
				
			||||||
            downloaded = 0
 | 
					            downloaded = 0
 | 
				
			||||||
            data = ''
 | 
					            data = String.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            incomplete_response.read_body do |segment|
 | 
					            incomplete_response.read_body do |segment|
 | 
				
			||||||
              data << segment
 | 
					              data << segment
 | 
				
			||||||
| 
						 | 
					@ -223,7 +223,7 @@ class Gem::Request
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def user_agent
 | 
					  def user_agent
 | 
				
			||||||
    ua = "RubyGems/#{Gem::VERSION} #{Gem::Platform.local}"
 | 
					    ua = "RubyGems/#{Gem::VERSION} #{Gem::Platform.local}".dup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ruby_version = RUBY_VERSION
 | 
					    ruby_version = RUBY_VERSION
 | 
				
			||||||
    ruby_version += 'dev' if RUBY_PATCHLEVEL == -1
 | 
					    ruby_version += 'dev' if RUBY_PATCHLEVEL == -1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'thread'
 | 
					require 'thread'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Gem::Request::ConnectionPools # :nodoc:
 | 
					class Gem::Request::ConnectionPools # :nodoc:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# A connection "pool" that only manages one connection for now.  Provides
 | 
					# A connection "pool" that only manages one connection for now.  Provides
 | 
				
			||||||
# thread safe `checkout` and `checkin` methods.  The pool consists of one
 | 
					# thread safe `checkout` and `checkin` methods.  The pool consists of one
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
class Gem::Request::HTTPSPool < Gem::Request::HTTPPool # :nodoc:
 | 
					class Gem::Request::HTTPSPool < Gem::Request::HTTPPool # :nodoc:
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'tsort'
 | 
					require 'tsort'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
| 
						 | 
					@ -77,6 +77,11 @@ class Gem::RequestSet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  attr_reader :vendor_set # :nodoc:
 | 
					  attr_reader :vendor_set # :nodoc:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ##
 | 
				
			||||||
 | 
					  # The set of source gems imported via load_gemdeps.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  attr_reader :source_set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
  # Creates a RequestSet for a list of Gem::Dependency objects, +deps+.  You
 | 
					  # Creates a RequestSet for a list of Gem::Dependency objects, +deps+.  You
 | 
				
			||||||
  # can then #resolve and #install the resolved list of dependencies.
 | 
					  # can then #resolve and #install the resolved list of dependencies.
 | 
				
			||||||
| 
						 | 
					@ -106,6 +111,7 @@ class Gem::RequestSet
 | 
				
			||||||
    @sorted              = nil
 | 
					    @sorted              = nil
 | 
				
			||||||
    @specs               = nil
 | 
					    @specs               = nil
 | 
				
			||||||
    @vendor_set          = nil
 | 
					    @vendor_set          = nil
 | 
				
			||||||
 | 
					    @source_set          = nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    yield self if block_given?
 | 
					    yield self if block_given?
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					@ -143,7 +149,6 @@ class Gem::RequestSet
 | 
				
			||||||
      return requests
 | 
					      return requests
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cache_dir = options[:cache_dir] || Gem.dir
 | 
					 | 
				
			||||||
    @prerelease = options[:prerelease]
 | 
					    @prerelease = options[:prerelease]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    requests = []
 | 
					    requests = []
 | 
				
			||||||
| 
						 | 
					@ -158,13 +163,11 @@ class Gem::RequestSet
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      path = req.download cache_dir
 | 
					      spec = req.spec.install options do |installer|
 | 
				
			||||||
 | 
					        yield req, installer if block_given?
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      inst = Gem::Installer.at path, options
 | 
					      requests << spec
 | 
				
			||||||
 | 
					 | 
				
			||||||
      yield req, inst if block_given?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      requests << inst.install
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return requests if options[:gemdeps]
 | 
					    return requests if options[:gemdeps]
 | 
				
			||||||
| 
						 | 
					@ -272,10 +275,11 @@ class Gem::RequestSet
 | 
				
			||||||
  def load_gemdeps path, without_groups = [], installing = false
 | 
					  def load_gemdeps path, without_groups = [], installing = false
 | 
				
			||||||
    @git_set    = Gem::Resolver::GitSet.new
 | 
					    @git_set    = Gem::Resolver::GitSet.new
 | 
				
			||||||
    @vendor_set = Gem::Resolver::VendorSet.new
 | 
					    @vendor_set = Gem::Resolver::VendorSet.new
 | 
				
			||||||
 | 
					    @source_set = Gem::Resolver::SourceSet.new
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @git_set.root_dir = @install_dir
 | 
					    @git_set.root_dir = @install_dir
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    lock_file = "#{File.expand_path(path)}.lock".untaint
 | 
					    lock_file = "#{File.expand_path(path)}.lock".dup.untaint
 | 
				
			||||||
    begin
 | 
					    begin
 | 
				
			||||||
      tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
 | 
					      tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
 | 
				
			||||||
      parser = tokenizer.make_parser self, []
 | 
					      parser = tokenizer.make_parser self, []
 | 
				
			||||||
| 
						 | 
					@ -339,6 +343,7 @@ class Gem::RequestSet
 | 
				
			||||||
    @sets << set
 | 
					    @sets << set
 | 
				
			||||||
    @sets << @git_set
 | 
					    @sets << @git_set
 | 
				
			||||||
    @sets << @vendor_set
 | 
					    @sets << @vendor_set
 | 
				
			||||||
 | 
					    @sets << @source_set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set = Gem::Resolver.compose_sets(*@sets)
 | 
					    set = Gem::Resolver.compose_sets(*@sets)
 | 
				
			||||||
    set.remote = @remote
 | 
					    set.remote = @remote
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
 | 
					# A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
 | 
				
			||||||
# files.
 | 
					# files.
 | 
				
			||||||
| 
						 | 
					@ -205,6 +205,7 @@ class Gem::RequestSet::GemDependencyAPI
 | 
				
			||||||
    @installing         = false
 | 
					    @installing         = false
 | 
				
			||||||
    @requires           = Hash.new { |h, name| h[name] = [] }
 | 
					    @requires           = Hash.new { |h, name| h[name] = [] }
 | 
				
			||||||
    @vendor_set         = @set.vendor_set
 | 
					    @vendor_set         = @set.vendor_set
 | 
				
			||||||
 | 
					    @source_set         = @set.source_set
 | 
				
			||||||
    @gem_sources        = {}
 | 
					    @gem_sources        = {}
 | 
				
			||||||
    @without_groups     = []
 | 
					    @without_groups     = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -363,6 +364,7 @@ class Gem::RequestSet::GemDependencyAPI
 | 
				
			||||||
    source_set ||= gem_path       name, options
 | 
					    source_set ||= gem_path       name, options
 | 
				
			||||||
    source_set ||= gem_git        name, options
 | 
					    source_set ||= gem_git        name, options
 | 
				
			||||||
    source_set ||= gem_git_source name, options
 | 
					    source_set ||= gem_git_source name, options
 | 
				
			||||||
 | 
					    source_set ||= gem_source     name, options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    duplicate = @dependencies.include? name
 | 
					    duplicate = @dependencies.include? name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -408,11 +410,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pin_gem_source name, :git, repository
 | 
					    pin_gem_source name, :git, repository
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reference = nil
 | 
					    reference = gem_git_reference options
 | 
				
			||||||
    reference ||= options.delete :ref
 | 
					 | 
				
			||||||
    reference ||= options.delete :branch
 | 
					 | 
				
			||||||
    reference ||= options.delete :tag
 | 
					 | 
				
			||||||
    reference ||= 'master'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    submodules = options.delete :submodules
 | 
					    submodules = options.delete :submodules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -421,6 +419,36 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
    true
 | 
					    true
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ##
 | 
				
			||||||
 | 
					  # Handles the git options from +options+ for git gem.
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  # Returns reference for the git gem.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def gem_git_reference options # :nodoc:
 | 
				
			||||||
 | 
					    ref    = options.delete :ref
 | 
				
			||||||
 | 
					    branch = options.delete :branch
 | 
				
			||||||
 | 
					    tag    = options.delete :tag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    reference = nil
 | 
				
			||||||
 | 
					    reference ||= ref
 | 
				
			||||||
 | 
					    reference ||= branch
 | 
				
			||||||
 | 
					    reference ||= tag
 | 
				
			||||||
 | 
					    reference ||= 'master'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ref && branch
 | 
				
			||||||
 | 
					      warn <<-WARNING
 | 
				
			||||||
 | 
					Gem dependencies file #{@path} includes git reference for both ref and branch but only ref is used.
 | 
				
			||||||
 | 
					      WARNING
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    if (ref||branch) && tag
 | 
				
			||||||
 | 
					      warn <<-WARNING
 | 
				
			||||||
 | 
					Gem dependencies file #{@path} includes git reference for both ref/branch and tag but only ref/branch is used.
 | 
				
			||||||
 | 
					      WARNING
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    reference
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private :gem_git
 | 
					  private :gem_git
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
| 
						 | 
					@ -481,6 +509,23 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private :gem_path
 | 
					  private :gem_path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ##
 | 
				
			||||||
 | 
					  # Handles the source: option from +options+ for gem +name+.
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  # Returns +true+ if the source option was handled.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def gem_source name, options # :nodoc:
 | 
				
			||||||
 | 
					    return unless source = options.delete(:source)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pin_gem_source name, :source, source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @source_set.add_source_gem name, source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    true
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private :gem_source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
  # Handles the platforms: option from +options+.  Returns true if the
 | 
					  # Handles the platforms: option from +options+.  Returns true if the
 | 
				
			||||||
  # platform matches the current platform.
 | 
					  # platform matches the current platform.
 | 
				
			||||||
| 
						 | 
					@ -527,6 +572,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      @requires[name] << name
 | 
					      @requires[name] << name
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    raise ArgumentError, "Unhandled gem options #{options.inspect}" unless options.empty?
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private :gem_requires
 | 
					  private :gem_requires
 | 
				
			||||||
| 
						 | 
					@ -612,6 +658,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add_dependencies groups, spec.development_dependencies
 | 
					    add_dependencies groups, spec.development_dependencies
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @vendor_set.add_vendor_gem spec.name, path
 | 
				
			||||||
    gem_requires spec.name, options
 | 
					    gem_requires spec.name, options
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -651,6 +698,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
      when :default then '(default)'
 | 
					      when :default then '(default)'
 | 
				
			||||||
      when :path    then "path: #{source}"
 | 
					      when :path    then "path: #{source}"
 | 
				
			||||||
      when :git     then "git: #{source}"
 | 
					      when :git     then "git: #{source}"
 | 
				
			||||||
 | 
					      when :source  then "source: #{source}"
 | 
				
			||||||
      else               '(unknown)'
 | 
					      else               '(unknown)'
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -799,4 +847,3 @@ Gem dependencies file #{@path} requires #{name} more than once.
 | 
				
			||||||
  Gem::RequestSet::GemDepedencyAPI = self # :nodoc:
 | 
					  Gem::RequestSet::GemDepedencyAPI = self # :nodoc:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Parses a gem.deps.rb.lock file and constructs a LockSet containing the
 | 
					# Parses a gem.deps.rb.lock file and constructs a LockSet containing the
 | 
				
			||||||
# dependencies found inside.  If the lock file is missing no LockSet is
 | 
					# dependencies found inside.  If the lock file is missing no LockSet is
 | 
				
			||||||
| 
						 | 
					@ -130,8 +130,8 @@ class Gem::RequestSet::Lockfile
 | 
				
			||||||
      [source.repository, source.rev_parse]
 | 
					      [source.repository, source.rev_parse]
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    out << "GIT"
 | 
					 | 
				
			||||||
    by_repository_revision.each do |(repository, revision), requests|
 | 
					    by_repository_revision.each do |(repository, revision), requests|
 | 
				
			||||||
 | 
					      out << "GIT"
 | 
				
			||||||
      out << "  remote: #{repository}"
 | 
					      out << "  remote: #{repository}"
 | 
				
			||||||
      out << "  revision: #{revision}"
 | 
					      out << "  revision: #{revision}"
 | 
				
			||||||
      out << "  specs:"
 | 
					      out << "  specs:"
 | 
				
			||||||
| 
						 | 
					@ -144,10 +144,9 @@ class Gem::RequestSet::Lockfile
 | 
				
			||||||
          out << "      #{dep.name}#{dep.requirement.for_lockfile}"
 | 
					          out << "      #{dep.name}#{dep.requirement.for_lockfile}"
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      out << nil
 | 
					      out << nil
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def relative_path_from dest, base # :nodoc:
 | 
					  def relative_path_from dest, base # :nodoc:
 | 
				
			||||||
    dest = File.expand_path(dest)
 | 
					    dest = File.expand_path(dest)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
class Gem::RequestSet::Lockfile::Parser
 | 
					class Gem::RequestSet::Lockfile::Parser
 | 
				
			||||||
  ###
 | 
					  ###
 | 
				
			||||||
  # Parses lockfiles
 | 
					  # Parses lockfiles
 | 
				
			||||||
| 
						 | 
					@ -325,15 +325,24 @@ class Gem::RequestSet::Lockfile::Parser
 | 
				
			||||||
    @tokens.peek
 | 
					    @tokens.peek
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if [].respond_to? :flat_map
 | 
				
			||||||
    def pinned_requirement name # :nodoc:
 | 
					    def pinned_requirement name # :nodoc:
 | 
				
			||||||
    spec = @set.sets.select { |set|
 | 
					      requirement = Gem::Dependency.new name
 | 
				
			||||||
      Gem::Resolver::GitSet    === set or
 | 
					      specification = @set.sets.flat_map { |set|
 | 
				
			||||||
        Gem::Resolver::VendorSet === set
 | 
					        set.find_all(requirement)
 | 
				
			||||||
    }.map { |set|
 | 
					 | 
				
			||||||
      set.specs[name]
 | 
					 | 
				
			||||||
      }.compact.first
 | 
					      }.compact.first
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    spec.version
 | 
					      specification && specification.version
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  else # FIXME: remove when 1.8 is dropped
 | 
				
			||||||
 | 
					    def pinned_requirement name # :nodoc:
 | 
				
			||||||
 | 
					      requirement = Gem::Dependency.new name
 | 
				
			||||||
 | 
					      specification = @set.sets.map { |set|
 | 
				
			||||||
 | 
					        set.find_all(requirement)
 | 
				
			||||||
 | 
					      }.flatten(1).compact.first
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      specification && specification.version
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
| 
						 | 
					@ -343,4 +352,3 @@ class Gem::RequestSet::Lockfile::Parser
 | 
				
			||||||
    @tokens.unshift token
 | 
					    @tokens.unshift token
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'strscan'
 | 
					require 'strscan'
 | 
				
			||||||
require 'rubygems/request_set/lockfile/parser'
 | 
					require 'rubygems/request_set/lockfile/parser'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require "rubygems/version"
 | 
					require "rubygems/version"
 | 
				
			||||||
require "rubygems/deprecate"
 | 
					require "rubygems/deprecate"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
require 'rubygems/dependency'
 | 
					require 'rubygems/dependency'
 | 
				
			||||||
require 'rubygems/exceptions'
 | 
					require 'rubygems/exceptions'
 | 
				
			||||||
require 'rubygems/util'
 | 
					require 'rubygems/util'
 | 
				
			||||||
| 
						 | 
					@ -279,6 +279,7 @@ require 'rubygems/resolver/index_set'
 | 
				
			||||||
require 'rubygems/resolver/installer_set'
 | 
					require 'rubygems/resolver/installer_set'
 | 
				
			||||||
require 'rubygems/resolver/lock_set'
 | 
					require 'rubygems/resolver/lock_set'
 | 
				
			||||||
require 'rubygems/resolver/vendor_set'
 | 
					require 'rubygems/resolver/vendor_set'
 | 
				
			||||||
 | 
					require 'rubygems/resolver/source_set'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require 'rubygems/resolver/specification'
 | 
					require 'rubygems/resolver/specification'
 | 
				
			||||||
require 'rubygems/resolver/spec_specification'
 | 
					require 'rubygems/resolver/spec_specification'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Specifies a Specification object that should be activated.  Also contains a
 | 
					# Specifies a Specification object that should be activated.  Also contains a
 | 
				
			||||||
# dependency that was used to introduce this activation.
 | 
					# dependency that was used to introduce this activation.
 | 
				
			||||||
| 
						 | 
					@ -50,15 +50,27 @@ class Gem::Resolver::ActivationRequest
 | 
				
			||||||
  # Downloads a gem at +path+ and returns the file path.
 | 
					  # Downloads a gem at +path+ and returns the file path.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def download path
 | 
					  def download path
 | 
				
			||||||
    if @spec.respond_to? :source
 | 
					 | 
				
			||||||
      source = @spec.source
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
      source = Gem.sources.first
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Gem.ensure_gem_subdirectories path
 | 
					    Gem.ensure_gem_subdirectories path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if @spec.respond_to? :sources
 | 
				
			||||||
 | 
					      exception = nil
 | 
				
			||||||
 | 
					      path = @spec.sources.find{ |source|
 | 
				
			||||||
 | 
					        begin
 | 
				
			||||||
          source.download full_spec, path
 | 
					          source.download full_spec, path
 | 
				
			||||||
 | 
					        rescue exception
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      return path      if path
 | 
				
			||||||
 | 
					      raise  exception if exception
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    elsif @spec.respond_to? :source
 | 
				
			||||||
 | 
					      source = @spec.source
 | 
				
			||||||
 | 
					      source.download full_spec, path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      source = Gem.sources.first
 | 
				
			||||||
 | 
					      source.download full_spec, path
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ##
 | 
					  ##
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# The global rubygems pool, available via the rubygems.org API.
 | 
					# The global rubygems pool, available via the rubygems.org API.
 | 
				
			||||||
# Returns instances of APISpecification.
 | 
					# Returns instances of APISpecification.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# frozen_string_literal: false
 | 
					# frozen_string_literal: true
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Represents a specification retrieved via the rubygems.org API.
 | 
					# Represents a specification retrieved via the rubygems.org API.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue