diff options
88 files changed, 360 insertions, 184 deletions
@@ -271,9 +271,9 @@ module Gem specs = dep.matching_specs(true) - specs = specs.find_all { |spec| spec.executables.include? exec_name - } if exec_name unless spec = specs.first msg = "can't find gem #{dep} with executable #{exec_name}" @@ -521,9 +521,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} def self.find_files_from_load_path(glob) # :nodoc: glob_with_suffixes = "#{glob}#{Gem.suffix_pattern}" - $LOAD_PATH.map { |load_path| Gem::Util.glob_files_in_dir(glob_with_suffixes, load_path) - }.flatten.select { |file| File.file? file.untaint } end ## @@ -593,8 +593,10 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end class << self extend Gem::Deprecate deprecate :gunzip, "Gem::Util.gunzip", 2018, 12 end ## @@ -605,8 +607,10 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end class << self extend Gem::Deprecate deprecate :gzip, "Gem::Util.gzip", 2018, 12 end ## @@ -617,8 +621,10 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end class << self extend Gem::Deprecate deprecate :inflate, "Gem::Util.inflate", 2018, 12 end ## @@ -1015,11 +1021,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} def self.suffixes @suffixes ||= ['', '.rb', - *%w(DLEXT DLEXT2).map { |key| val = RbConfig::CONFIG[key] next unless val and not val.empty? ".#{val}" - } ].compact.uniq end @@ -1211,6 +1217,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end class << self ## # TODO remove with RubyGems 4.0 @@ -1218,6 +1225,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} extend Gem::Deprecate deprecate :detect_gemdeps, "Gem.use_gemdeps", 2018, 12 end # FIX: Almost everywhere else we use the `def self.` way of defining class @@ -1337,6 +1345,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # work attr_reader :pre_uninstall_hooks end ## @@ -162,4 +162,5 @@ class Gem::AvailableSet def inject_into_list(dep_list) @set.each { |t| dep_list.add t.spec } end end @@ -329,4 +329,5 @@ class Gem::BasicSpecification false end end end @@ -122,6 +122,7 @@ class Gem::Command @defaults = defaults @options = defaults.dup @option_groups = Hash.new { |h,k| h[k] = [] } @parser = nil @when_invoked = nil end @@ -365,13 +366,34 @@ class Gem::Command end end ## # Merge a set of command options with the set of default options (without # modifying the default option hash). def merge_options(new_options) @options = @defaults.clone - new_options.each do |k,v| @options[k] = v end end ## @@ -392,6 +414,7 @@ class Gem::Command def handle_options(args) args = add_extra_args(args) @options = Marshal.load Marshal.dump @defaults # deep copy parser.parse!(args) @options[:args] = args @@ -420,6 +443,10 @@ class Gem::Command private def add_parser_description # :nodoc: return unless description @@ -96,4 +96,5 @@ Gems can be saved to a specified filename with the output option: terminate_interaction 1 end end end @@ -99,7 +99,7 @@ If no gems are named all gems in GEM_HOME are cleaned. @full = Gem::DependencyList.from_specs deplist = Gem::DependencyList.new - @gems_to_cleanup.each do |spec| deplist.add spec end deps = deplist.strongly_connected_components.flatten @@ -121,19 +121,19 @@ If no gems are named all gems in GEM_HOME are cleaned. end def get_gems_to_cleanup - gems_to_cleanup = @candidate_gems.select { |spec| @primary_gems[spec.name].version != spec.version - } - default_gems, gems_to_cleanup = gems_to_cleanup.partition { |spec| spec.default_gem? - } uninstall_from = options[:user_install] ? Gem.user_dir : @original_home - gems_to_cleanup = gems_to_cleanup.select { |spec| spec.base_dir == uninstall_from - } @default_gems += default_gems @default_gems.uniq! @@ -14,7 +14,7 @@ class Gem::Commands::ContentsCommand < Gem::Command add_version_option - add_option( '--all', "Contents for all gems") do |all, options| options[:all] = all end @@ -29,12 +29,12 @@ class Gem::Commands::ContentsCommand < Gem::Command options[:lib_only] = lib_only end - add_option( '--[no-]prefix', "Don't include installed path prefix") do |prefix, options| options[:prefix] = prefix end - add_option( '--[no-]show-install-dir', 'Show only the gem install dir') do |show, options| options[:show_install_dir] = show end @@ -80,9 +80,9 @@ use with other commands. end def gem_dependency(pattern, version, prerelease) # :nodoc: - dependency = Gem::Deprecate.skip_during { Gem::Dependency.new pattern, version - } dependency.prerelease = prerelease @@ -215,4 +215,5 @@ use with other commands. /\A#{Regexp.union(*args)}/ end end end @@ -4,6 +4,7 @@ require 'rubygems/command' require 'rubygems/commands/query_command' class Gem::Commands::InfoCommand < Gem::Commands::QueryCommand def initialize super "info", "Show information for the given gem" @@ -30,4 +31,5 @@ class Gem::Commands::InfoCommand < Gem::Commands::QueryCommand def defaults_str "--local" end end @@ -201,10 +201,13 @@ You can use `i` command instead of `install`. request_set = inst.resolve_dependencies name, req if options[:explain] - puts "Gems to install:" request_set.sorted_requests.each do |s| - puts " #{s.full_name}" end return @@ -100,9 +100,9 @@ lock it down to the exact version. end def spec_path(gem_full_name) - gemspecs = Gem.path.map { |path| File.join path, "specifications", "#{gem_full_name}.gemspec" - } gemspecs.find { |path| File.exist? path } end @@ -3,6 +3,7 @@ require 'rubygems/command' unless defined? Gem::Commands::MirrorCommand class Gem::Commands::MirrorCommand < Gem::Command def initialize super('mirror', 'Mirror all gem files (requires rubygems-mirror)') begin @@ -17,7 +17,7 @@ class Gem::Commands::OpenCommand < Gem::Command end add_option('-v', '--version VERSION', String, "Opens specific gem version") do |version| - options[:version] = version end end @@ -84,4 +84,5 @@ class Gem::Commands::OpenCommand < Gem::Command say "Unable to find gem '#{name}'" end end @@ -30,4 +30,5 @@ update the gems with the update or install commands. say "#{spec.name} (#{spec.version} < #{remote_version})" end end end @@ -4,6 +4,7 @@ require 'rubygems/local_remote_options' require 'rubygems/gemcutter_utilities' class Gem::Commands::OwnerCommand < Gem::Command include Gem::LocalRemoteOptions include Gem::GemcutterUtilities @@ -60,6 +61,8 @@ permission to. end def show_owners(name) response = rubygems_api_request :get, "api/v1/gems/#{name}/owners.yaml" do |request| request.add_field "Authorization", api_key end @@ -183,4 +183,5 @@ extensions will be restored. say "Restored #{spec.full_name}" end end end @@ -5,6 +5,7 @@ require 'rubygems/gemcutter_utilities' require 'rubygems/package' class Gem::Commands::PushCommand < Gem::Command include Gem::LocalRemoteOptions include Gem::GemcutterUtilities @@ -145,4 +146,5 @@ You can upgrade or downgrade to the latest release version with: gem_metadata["allowed_push_host"] ] end end @@ -39,7 +39,7 @@ class Gem::Commands::QueryCommand < Gem::Command options[:details] = value end - add_option( '--[no-]versions', 'Display only gem names') do |value, options| options[:versions] = value options[:details] = false unless value @@ -56,7 +56,7 @@ class Gem::Commands::QueryCommand < Gem::Command options[:exact] = value end - add_option( '--[no-]prerelease', 'Display prerelease versions') do |value, options| options[:prerelease] = value end @@ -141,9 +141,9 @@ is too hard to use. display_header 'LOCAL' - specs = Gem::Specification.find_all { |s| s.name =~ name and req =~ s.version - } spec_tuples = specs.map do |spec| [spec.name_tuple, spec] @@ -5,6 +5,7 @@ require 'rubygems/rdoc' require 'fileutils' class Gem::Commands::RdocCommand < Gem::Command include Gem::VersionOption def initialize @@ -6,6 +6,7 @@ require 'rubygems/command' # RubyGems checkout or tarball. class Gem::Commands::SetupCommand < Gem::Command HISTORY_HEADER = /^===\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze VERSION_MATCHER = /^===\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze @@ -3,6 +3,7 @@ require 'rubygems/command' require 'rubygems/gemcutter_utilities' class Gem::Commands::SigninCommand < Gem::Command include Gem::GemcutterUtilities def initialize @@ -143,4 +143,5 @@ Specific fields in the specification can be extracted in YAML format: say "\n" end end end @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::StaleCommand < Gem::Command def initialize super('stale', 'List gems along with access times') end @@ -36,4 +37,5 @@ longer using. say "#{name} at #{atime.strftime '%c'}" end end end @@ -185,4 +185,5 @@ that is a dependency of an existing gem. You can use the def uninstall(gem_name) Gem::Uninstaller.new(gem_name, options).uninstall end end @@ -194,7 +194,7 @@ command to remove old versions. } gems_to_update = which_to_update hig, options[:args], :system - _, up_ver = gems_to_update.first target = if update_latest up_ver @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Commands::WhichCommand < Gem::Command def initialize super 'which', 'Find the location of a library file you can require', :search_gems_first => false, :show_all => false @@ -5,6 +5,7 @@ require 'rubygems/version_option' require 'rubygems/gemcutter_utilities' class Gem::Commands::YankCommand < Gem::Command include Gem::LocalRemoteOptions include Gem::VersionOption include Gem::GemcutterUtilities @@ -484,4 +484,5 @@ if you believe they were disclosed to a third party. attr_reader :hash protected :hash end @@ -64,9 +64,9 @@ module Kernel spec = dep.to_spec - Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate - } if spec end private :gem @@ -2,8 +2,8 @@ module Gem DEFAULT_HOST = "https://rubygems.org".freeze - @post_install_hooks ||= [] - @done_installing_hooks ||= [] @post_uninstall_hooks ||= [] @pre_uninstall_hooks ||= [] @pre_install_hooks ||= [] @@ -277,16 +277,16 @@ class Gem::Dependency def matching_specs(platform_only = false) env_req = Gem.env_requirement(name) - matches = Gem::Specification.stubs_for(name).find_all { |spec| requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version) - }.map(&:to_spec) Gem::BundlerVersionFinder.filter!(matches) if name == "bundler".freeze if platform_only - matches.reject! { |spec| spec.nil? || !Gem::Platform.match(spec.platform) - } end matches @@ -333,4 +333,5 @@ class Gem::Dependency matches.first end end @@ -29,7 +29,7 @@ class Gem::DependencyInstaller :wrappers => true, :build_args => nil, :build_docs_in_background => false, - :install_as_default => false }.freeze ## @@ -336,15 +336,15 @@ class Gem::DependencyInstaller # REFACTOR maybe abstract away using Gem::Specification.include? so # that this isn't dependent only on the currently installed gems - dependency_list.specs.reject! { |spec| not keep_names.include?(spec.full_name) and Gem::Specification.include?(spec) - } unless dependency_list.ok? or @ignore_dependencies or @force - reason = dependency_list.why_not_ok?.map { |k,v| "#{k} requires #{v.join(", ")}" - }.join("; ") raise Gem::DependencyError, "Unable to resolve dependencies: #{reason}" end @@ -17,6 +17,7 @@ require 'rubygems/deprecate' # this class necessary anymore? Especially #ok?, #why_not_ok? class Gem::DependencyList attr_reader :specs include Enumerable @@ -118,10 +119,10 @@ class Gem::DependencyList unsatisfied = Hash.new { |h,k| h[k] = [] } each do |spec| spec.runtime_dependencies.each do |dep| - inst = Gem::Specification.any? { |installed_spec| dep.name == installed_spec.name and dep.requirement.satisfied_by? installed_spec.version - } unless inst or @specs.find { |s| s.satisfies_requirement? dep } unsatisfied[spec.name] << dep @@ -145,10 +146,10 @@ class Gem::DependencyList # If the state is inconsistent, at least don't crash return true unless gem_to_remove - siblings = @specs.find_all { |s| s.name == gem_to_remove.name && s.full_name != gem_to_remove.full_name - } deps = [] @@ -160,11 +161,11 @@ class Gem::DependencyList end end - deps.all? { |dep| - siblings.any? { |s| s.satisfies_requirement? dep - } - } end ## @@ -173,10 +174,10 @@ class Gem::DependencyList # dependencies). def remove_specs_unsatisfied_by(dependencies) - specs.reject! { |spec| dep = dependencies[spec.name] dep and not dep.requirement.satisfied_by? spec.version - } end ## @@ -48,7 +48,7 @@ module Gem::Deprecate # year/month that it is planned to go away. def deprecate(name, repl, year, month) - class_eval { old = "_deprecated_#{name}" alias_method old, name define_method name do |*args, &block| @@ -62,7 +62,7 @@ module Gem::Deprecate warn "#{msg.join}." unless Gem::Deprecate.skip send old, *args, &block end - } end module_function :deprecate, :skip_during @@ -13,11 +13,13 @@ module Gem # already activated gems or that RubyGems is otherwise unable to activate. class LoadError < ::LoadError # Name of gem attr_accessor :name # Version requirement of gem attr_accessor :requirement end ## @@ -25,6 +27,7 @@ module Gem # system. Instead of rescuing from this class, make sure to rescue from the # superclass Gem::LoadError to catch all types of load errors. class MissingSpecError < Gem::LoadError def initialize(name, requirement) @name = name @requirement = requirement @@ -41,6 +44,7 @@ module Gem total = Gem::Specification.stubs.size "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n" end end ## @@ -48,6 +52,7 @@ module Gem # not the requested version. Instead of rescuing from this class, make sure to # rescue from the superclass Gem::LoadError to catch all types of load errors. class MissingSpecVersionError < MissingSpecError attr_reader :specs def initialize(name, requirement, specs) @@ -64,6 +69,7 @@ module Gem names = specs.map(&:full_name) "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n" end end # Raised when there are conflicting gem specs loaded @@ -86,14 +92,15 @@ module Gem @conflicts = conflicts @name = target.name - reason = conflicts.map { |act, dependencies| "#{act.full_name} conflicts with #{dependencies.join(", ")}" - }.join ", " # TODO: improve message by saying who activated `con` super("Unable to activate #{target.full_name}, because #{reason}") end end class ErrorReason; end @@ -143,6 +150,7 @@ module Gem @platforms.size == 1 ? '' : 's', @platforms.join(' ,')] end end ## @@ -181,5 +189,6 @@ module Gem # The "exception" alias allows you to call raise on a SourceFetchProblem. alias exception error end end @@ -19,6 +19,7 @@ class Gem::Exception < RuntimeError extend Gem::Deprecate deprecate :source_exception, :none, 2018, 12 end class Gem::CommandLineError < Gem::Exception; end @@ -53,14 +54,18 @@ end # Raised when attempting to uninstall a gem that isn't in GEM_HOME. class Gem::GemNotInHomeException < Gem::Exception attr_accessor :spec end ### # Raised when removing a gem with the uninstall command fails class Gem::UninstallError < Gem::Exception attr_accessor :spec end class Gem::DocumentError < Gem::Exception; end @@ -88,7 +93,9 @@ end ## # Used to raise parsing and loading errors class Gem::FormatException < Gem::Exception attr_accessor :file_path end class Gem::GemNotFoundException < Gem::Exception; end @@ -166,10 +173,12 @@ end class Gem::InstallError < Gem::Exception; end class Gem::RuntimeRequirementNotMetError < Gem::InstallError attr_accessor :suggestion def message [suggestion, super].compact.join("\n\t") end end ## @@ -240,7 +240,9 @@ EOF FileUtils.mkdir_p @spec.extension_dir - File.open destination, 'wb' do |io| io.puts output end destination end @@ -2,6 +2,7 @@ require 'rubygems/command' class Gem::Ext::CmakeBuilder < Gem::Ext::Builder def self.build(extension, dest_path, results, args=[], lib_dir=nil) unless File.exist?('Makefile') cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}" @@ -14,4 +15,5 @@ class Gem::Ext::CmakeBuilder < Gem::Ext::Builder results end end @@ -10,6 +10,7 @@ require 'tempfile' require 'shellwords' class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder FileEntry = FileUtils::Entry_ # :nodoc: def self.build(extension, dest_path, results, args=[], lib_dir=nil) @@ -88,7 +89,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder private def self.get_relative_path(path) - path[0..Dir.pwd.length-1] = '.' if path.start_with?(Dir.pwd) path end @@ -63,7 +63,7 @@ module Gem::GemcutterUtilities env_rubygems_host = nil if env_rubygems_host and env_rubygems_host.empty? - env_rubygems_host|| configured_host end end @@ -116,7 +116,7 @@ module Gem::GemcutterUtilities say "Don't have an account yet? " + "Create one at #{sign_in_host}/sign_up" - email = ask " Email: " password = ask_for_password "Password: " say "\n" @@ -131,7 +131,10 @@ class Gem::Indexer marshal_name = File.join @quick_marshal_dir, spec_file_name marshal_zipped = Gem.deflate Marshal.dump(spec) - File.open marshal_name, 'wb' do |io| io.write marshal_zipped end files << marshal_name @@ -180,9 +183,9 @@ class Gem::Indexer # Builds indices for RubyGems 1.2 and newer. Handles full, latest, prerelease def build_modern_indices(specs) - prerelease, released = specs.partition { |s| s.version.prerelease? - } latest_specs = Gem::Specification._latest_specs specs @@ -200,7 +203,7 @@ class Gem::Indexer end def map_gems_to_specs(gems) - gems.map { |gemfile| if File.size(gemfile) == 0 alert_warning "Skipping zero-length gem: #{gemfile}" next @@ -223,7 +226,7 @@ class Gem::Indexer "\t#{e.backtrace.join "\n\t"}"].join("\n") alert_error msg end - }.compact end ## @@ -439,4 +442,5 @@ class Gem::Indexer Marshal.dump specs_index, io end end end @@ -108,6 +108,7 @@ class Gem::Installer end class FakePackage attr_accessor :spec attr_accessor :dir_mode @@ -125,12 +126,15 @@ class Gem::Installer file = File.join destination_dir, file next if File.exist? file FileUtils.mkdir_p File.dirname(file) - File.open file, 'w' do |fp| fp.puts "# #{file}" end end end def copy_to(path) end end ## @@ -467,7 +471,7 @@ class Gem::Installer def generate_windows_script(filename, bindir) if Gem.win_platform? - script_name = filename + ".bat" script_path = File.join bindir, File.basename(script_name) File.open script_path, 'w' do |file| file.puts windows_stub_script(bindir, filename) @@ -58,6 +58,7 @@ class Gem::Installer # Available through requiring rubygems/installer_test_case attr_writer :wrappers end ## @@ -150,10 +151,15 @@ class Gem::InstallerTestCase < Gem::TestCase FileUtils.mkdir_p 'bin' FileUtils.mkdir_p 'lib' FileUtils.mkdir_p File.join('ext', 'a') File.open File.join('bin', 'executable'), 'w' do |f| f.puts "raise 'ran executable'" end - File.open File.join('lib', 'code.rb'), 'w' do |f| f.puts '1' end File.open File.join('ext', 'a', 'mkrf_conf.rb'), 'w' do |f| f << <<-EOF File.open 'Rakefile', 'w' do |rf| rf.puts "task :default" end @@ -26,7 +26,7 @@ module Gem::LocalRemoteOptions valid_uri_schemes = ["http", "https", "file", "s3"] unless valid_uri_schemes.include?(uri.scheme) - msg = "Invalid uri scheme for #{value}\nPreface URLs with one of #{valid_uri_schemes.map{|s| "#{s}://"}}" raise ArgumentError, msg end @@ -7,6 +7,7 @@ require 'rubygems/user_interaction' # retrieval during tests. class Gem::MockGemUi < Gem::StreamUI ## # Raised when you haven't provided enough input to your MockGemUi @@ -19,12 +20,14 @@ class Gem::MockGemUi < Gem::StreamUI end class TermError < RuntimeError attr_reader :exit_code def initialize(exit_code) super @exit_code = exit_code end end class SystemExitException < RuntimeError; end @@ -7,6 +7,7 @@ require 'rubygems/platform' class Gem::NameTuple def initialize(name, version, platform="ruby") @name = name @version = version @@ -53,6 +53,7 @@ class Gem::Package class Error < Gem::Exception; end class FormatError < Error attr_reader :path def initialize(message, source = nil) @@ -68,10 +69,12 @@ class Gem::Package end class PathError < Error def initialize(destination, destination_dir) super "installing into parent path %s of %s is not allowed" % [destination, destination_dir] end end class NonSeekableIO < Error; end @@ -5,6 +5,7 @@ # to the rest of RubyGems. # class Gem::PathSupport ## # The default system path for managing Gems. attr_reader :home @@ -87,4 +88,5 @@ class Gem::PathSupport path end end end @@ -202,4 +202,5 @@ class Gem::Platform # This will be replaced with Gem::Platform::local. CURRENT = 'current'.freeze end @@ -2,6 +2,7 @@ module Gem if defined? ::Psych::Visitors class NoAliasYAMLTree < Psych::Visitors::YAMLTree def self.create new({}) end unless respond_to? :create @@ -27,6 +28,7 @@ module Gem end private :format_time end end end @@ -402,4 +402,5 @@ class Gem::RemoteFetcher [id, secret] end end @@ -13,7 +13,7 @@ class Gem::Request def self.create_with_proxy(uri, request_class, last_modified, proxy) # :nodoc: cert_files = get_cert_files proxy ||= get_proxy_from_env(uri.scheme) - pool = ConnectionPools.new proxy_uri(proxy), cert_files new(uri, request_class, last_modified, pool.pool_for(uri)) end @@ -168,9 +168,10 @@ class Gem::Request no_env_proxy = env_proxy.nil? || env_proxy.empty? - return :no_proxy if scheme == 'https' && no_env_proxy - return get_proxy_from_env 'http' if no_env_proxy and _scheme != 'http' - return :no_proxy if no_env_proxy uri = URI(Gem::UriFormatter.new(env_proxy).normalize) @@ -5,7 +5,9 @@ class Gem::Request::ConnectionPools # :nodoc: @client = Net::HTTP class << self attr_accessor :client end def initialize(proxy_uri, cert_files) @@ -40,7 +42,7 @@ class Gem::Request::ConnectionPools # :nodoc: def get_no_proxy_from_env env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY'] - return [] if env_no_proxy.nil? or env_no_proxy.empty? env_no_proxy.split(/\s*,\s*/) end @@ -6,6 +6,7 @@ # use it. class Gem::Request::HTTPPool # :nodoc: attr_reader :cert_files, :proxy_uri def initialize(http_args, cert_files, proxy_uri) @@ -1,9 +1,11 @@ # frozen_string_literal: true class Gem::Request::HTTPSPool < Gem::Request::HTTPPool # :nodoc: private def setup_connection(connection) Gem::Request.configure_connection_for_https(connection, @cert_files) super end end @@ -457,9 +457,9 @@ class Gem::RequestSet node.spec.dependencies.each do |dep| next if dep.type == :development and not @development - match = @requests.find { |r| dep.match? r.spec.name, r.spec.version, @prerelease - } unless match next if dep.type == :development and @development_shallow @@ -43,11 +43,12 @@ class Gem::RequestSet::GemDependencyAPI :mri_20 => %w[ruby], :mri_21 => %w[ruby], :rbx => %w[rbx], - :ruby => %w[ruby rbx maglev], - :ruby_18 => %w[ruby rbx maglev], - :ruby_19 => %w[ruby rbx maglev], - :ruby_20 => %w[ruby rbx maglev], - :ruby_21 => %w[ruby rbx maglev], }.freeze mswin = Gem::Platform.new 'x86-mswin32' @@ -85,6 +86,7 @@ class Gem::RequestSet::GemDependencyAPI :ruby_19 => Gem::Platform::RUBY, :ruby_20 => Gem::Platform::RUBY, :ruby_21 => Gem::Platform::RUBY, :x64_mingw => x64_mingw, :x64_mingw_20 => x64_mingw, :x64_mingw_21 => x64_mingw @@ -126,6 +128,7 @@ class Gem::RequestSet::GemDependencyAPI :ruby_19 => tilde_gt_1_9_0, :ruby_20 => tilde_gt_2_0_0, :ruby_21 => tilde_gt_2_1_0, :x64_mingw => gt_eq_0, :x64_mingw_20 => tilde_gt_2_0_0, :x64_mingw_21 => tilde_gt_2_1_0, @@ -440,7 +443,7 @@ Gem dependencies file #{@path} requires #{name} more than once. 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 @@ -480,7 +483,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta def gem_group(name, options) # :nodoc: g = options.delete :group - all_groups = g ? Array(g) : [] groups = options.delete :groups all_groups |= groups if groups @@ -5,6 +5,7 @@ # constructed. class Gem::RequestSet::Lockfile ## # Raised when a lockfile cannot be parsed @@ -35,6 +36,7 @@ class Gem::RequestSet::Lockfile @path = path super "#{message} (at line #{line} column #{column})" end end ## @@ -79,7 +81,7 @@ class Gem::RequestSet::Lockfile @gem_deps_file.untaint unless gem_deps_file.tainted? - @platforms = [] end def add_DEPENDENCIES(out) # :nodoc: @@ -153,7 +155,7 @@ class Gem::RequestSet::Lockfile base = File.expand_path(base) if dest.index(base) == 0 - offset = dest[base.size+1..-1] return '.' unless offset @@ -233,6 +235,7 @@ class Gem::RequestSet::Lockfile def requests @set.sorted_requests end end require 'rubygems/request_set/lockfile/tokenizer' @@ -1,5 +1,6 @@ # frozen_string_literal: true class Gem::RequestSet::Lockfile::Parser ### # Parses lockfiles @@ -327,9 +328,9 @@ class Gem::RequestSet::Lockfile::Parser def pinned_requirement(name) # :nodoc: requirement = Gem::Dependency.new name - specification = @set.sets.flat_map { |set| set.find_all(requirement) - }.compact.first specification && specification.version end @@ -340,4 +341,5 @@ class Gem::RequestSet::Lockfile::Parser def unget(token) # :nodoc: @tokens.unshift token end end @@ -2,6 +2,7 @@ require 'rubygems/request_set/lockfile/parser' class Gem::RequestSet::Lockfile::Tokenizer Token = Struct.new :type, :value, :column, :line EOF = Token.new :EOF @@ -109,4 +110,5 @@ class Gem::RequestSet::Lockfile::Tokenizer @tokens end end @@ -2,10 +2,6 @@ require "rubygems/version" require "rubygems/deprecate" -# If we're being loaded after yaml was already required, then -# load our yaml + workarounds now. -Gem.load_yaml if defined? ::YAML - ## # A Requirement is a set of one or more version restrictions. It supports a # few (<tt>=, !=, >, <, >=, <=, ~></tt>) different restriction operators. @@ -14,6 +10,7 @@ Gem.load_yaml if defined? ::YAML # together in RubyGems. class Gem::Requirement OPS = { #:nodoc: "=" => lambda { |v, r| v == r }, "!=" => lambda { |v, r| v != r }, @@ -26,7 +23,7 @@ class Gem::Requirement SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc: - quoted = OPS.keys.map { |k| Regexp.quote k }.join "|" PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*".freeze # :nodoc: ## @@ -156,11 +153,11 @@ class Gem::Requirement def for_lockfile # :nodoc: return if [DefaultRequirement] == @requirements - list = requirements.sort_by { |_, version| version - }.map { |op, version| "#{op} #{version}" - }.uniq " (#{list.join ', '})" end @@ -305,11 +302,14 @@ class Gem::Requirement l.first <=> r.first # then, sort by the operator (for stability) end end end class Gem::Version # This is needed for compatibility with older yaml # gemspecs. Requirement = Gem::Requirement # :nodoc: end @@ -11,6 +11,7 @@ require 'rubygems/util/list' # all the requirements. class Gem::Resolver require 'rubygems/resolver/molinillo' ## @@ -234,11 +235,11 @@ class Gem::Resolver groups = Hash.new { |hash, key| hash[key] = [] } # create groups & sources in the same loop - sources = possibles.map { |spec| source = spec.source groups[source] << spec source - }.uniq.reverse activation_requests = [] @@ -54,12 +54,12 @@ class Gem::Resolver::ActivationRequest if @spec.respond_to? :sources exception = nil - path = @spec.sources.find{ |source| begin source.download full_spec, path rescue exception end - } return path if path raise exception if exception @@ -63,9 +63,9 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet uri = URI uri unless URI === uri uri.query = nil - raise error unless api_set = @sets.find { |set| Gem::Resolver::APISet === set and set.dep_uri == uri - } index_set = Gem::Resolver::IndexSet.new api_set.source @@ -55,9 +55,9 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set found = find_all request - found.delete_if { |s| s.version.prerelease? and not s.local? - } unless dependency.prerelease? found = found.select do |s| Gem::Source::SpecificFile === s.source or @@ -115,7 +115,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set def find_all(req) res = [] - dep = req.dependency return res if @ignore_dependencies and @always_install.none? { |spec| dep.match? spec } @@ -16,7 +16,7 @@ class Gem::Resolver::LockSet < Gem::Resolver::Set Gem::Source::Lock.new source end - @specs = [] end ## @@ -71,9 +71,9 @@ class Gem::Resolver::LockSpecification < Gem::Resolver::Specification # A specification constructed from the lockfile is returned def spec - @spec ||= Gem::Specification.find { |spec| spec.name == @name and spec.version == @version - } @spec ||= Gem::Specification.new do |s| s.name = @name @@ -79,4 +79,5 @@ class Gem::Resolver::RequirementList x = @exact[0,5] x + @list[0,5 - x.size] end end @@ -111,4 +111,5 @@ class Gem::Resolver::Specification def local? # :nodoc: false end end @@ -1,5 +1,6 @@ # frozen_string_literal: true class Gem::Resolver::Stats def initialize @max_depth = 0 @max_requirements = 0 @@ -42,4 +43,5 @@ class Gem::Resolver::Stats $stdout.printf PATTERN, "Backtracking #", @backtracking $stdout.printf PATTERN, "Iteration #", @iterations end end @@ -72,7 +72,7 @@ class Gem::Security::Signer @options = DEFAULT_OPTIONS.merge(options) unless @key - default_key = File.join Gem.default_key_path @key = default_key if File.exist? default_key end @@ -607,13 +607,13 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; } Gem::Specification.each do |spec| total_file_count += spec.files.size - deps = spec.dependencies.map { |dep| { "name" => dep.name, "type" => dep.type, "version" => dep.requirement.to_s, } - } deps = deps.sort_by { |dep| [dep["name"].downcase, dep["version"]] } deps.last["is_last"] = true unless deps.empty? @@ -754,9 +754,9 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; } # documentation - just put it underneath the main doc folder. def show_rdoc_for_pattern(pattern, res) - found_gems = Dir.glob("{#{@gem_dirs.join ','}}/doc/#{pattern}").select {|path| File.exist? File.join(path, 'rdoc/index.html') - } case found_gems.length when 0 return false @@ -875,4 +875,5 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; } system("#{@launch} http://#{host}:#{@port}") end end @@ -147,4 +147,5 @@ class Gem::SourceList @sources.delete_if { |x| x.uri.to_s == source.to_s } end end end @@ -189,7 +189,7 @@ class Gem::SpecFetcher max = gem_name.size / 2 names = available_specs(type).first.values.flatten(1) - matches = names.map { |n| next unless n.match_platform? distance = levenshtein_distance gem_name, n.name.downcase.tr('_-', '') @@ -199,7 +199,7 @@ class Gem::SpecFetcher return [n.name] if distance == 0 [n.name, distance] - }.compact matches = if matches.empty? && type != :prerelease suggest_gems_from_name gem_name, :prerelease @@ -85,14 +85,14 @@ class Gem::Specification < Gem::BasicSpecification 'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"', '"test_file=x" is a shortcut for "test_files=[x]"' ], - 2 => [ 'Added "required_rubygems_version"', 'Now forward-compatible with future versions', ], - 3 => [ 'Added Fixnum validation to the specification_version' ], - 4 => [ 'Added sandboxed freeform metadata to the specification version.' ] }.freeze @@ -183,9 +183,9 @@ class Gem::Specification < Gem::BasicSpecification @@attributes = @@default_value.keys.sort_by { |s| s.to_s } @@array_attributes = @@default_value.reject { |k,v| v != [] }.keys - @@nil_attributes, @@non_nil_attributes = @@default_value.keys.partition { |k| @@default_value[k].nil? - } @@stubs_by_name = {} @@ -792,11 +792,11 @@ class Gem::Specification < Gem::BasicSpecification private_class_method :installed_stubs def self.map_stubs(dirs, pattern) # :nodoc: - dirs.flat_map { |dir| base_dir = File.dirname dir gems_dir = File.join base_dir, "gems" gemspec_stubs_in(dir, pattern) { |path| yield path, base_dir, gems_dir } - } end private_class_method :map_stubs @@ -854,11 +854,11 @@ class Gem::Specification < Gem::BasicSpecification end def self._resort!(specs) # :nodoc: - specs.sort! { |a, b| names = a.name <=> b.name next names if names.nonzero? b.version <=> a.version - } end ## @@ -974,9 +974,9 @@ class Gem::Specification < Gem::BasicSpecification # Return the directories that Specification uses to find specs. def self.dirs - @@dirs ||= Gem.path.collect { |dir| File.join dir.dup.untaint, "specifications" - } end ## @@ -1038,10 +1038,10 @@ class Gem::Specification < Gem::BasicSpecification def self.find_by_path(path) path = path.dup.freeze - spec = @@spec_with_requirable_file[path] ||= (stubs.find { |s| next unless Gem::BundlerVersionFinder.compatible?(s) s.contains_requirable_file? path - } || NOT_FOUND) spec.to_spec end @@ -1050,18 +1050,18 @@ class Gem::Specification < Gem::BasicSpecification # amongst the specs that are not activated. def self.find_inactive_by_path(path) - stub = stubs.find { |s| next if s.activated? next unless Gem::BundlerVersionFinder.compatible?(s) s.contains_requirable_file? path - } stub && stub.to_spec end def self.find_active_stub_by_path(path) - stub = @@active_stub_with_requirable_file[path] ||= (stubs.find { |s| s.activated? and s.contains_requirable_file? path - } || NOT_FOUND) stub.this end @@ -1142,10 +1142,10 @@ class Gem::Specification < Gem::BasicSpecification result[spec.name][spec.platform] = spec end - result.map(&:last).map(&:values).flatten.reject { |spec| minimum = native[spec.name] minimum && spec.version < minimum - }.sort_by{ |tup| tup.name } end ## @@ -1311,6 +1311,8 @@ class Gem::Specification < Gem::BasicSpecification # Load custom marshal format, re-initializing defaults as needed def self._load(str) array = Marshal.load str spec = Gem::Specification.new @@ -1678,12 +1680,12 @@ class Gem::Specification < Gem::BasicSpecification def conflicts conflicts = {} - self.runtime_dependencies.each { |dep| spec = Gem.loaded_specs[dep.name] if spec and not spec.satisfies_requirement? dep (conflicts[spec] ||= []) << dep end - } env_req = Gem.env_requirement(name) (conflicts[self] ||= []) << env_req unless env_req.satisfied_by? version conflicts @@ -1693,9 +1695,9 @@ class Gem::Specification < Gem::BasicSpecification # return true if there will be conflict when spec if loaded together with the list of specs. def conficts_when_loaded_with?(list_of_specs) # :nodoc: - result = list_of_specs.any? { |spec| spec.dependencies.any? { |dep| dep.runtime? && (dep.name == name) && !satisfies_requirement?(dep) } - } result end @@ -1704,14 +1706,14 @@ class Gem::Specification < Gem::BasicSpecification def has_conflicts? return true unless Gem.env_requirement(name).satisfied_by?(version) - self.dependencies.any? { |dep| if dep.runtime? spec = Gem.loaded_specs[dep.name] spec and not spec.satisfies_requirement? dep else false end - } end # The date this gem was created. @@ -2591,6 +2593,8 @@ class Gem::Specification < Gem::BasicSpecification end def to_yaml(opts = {}) # :nodoc: # Because the user can switch the YAML engine behind our # back, we have to check again here to make sure that our # psych code was properly loaded, and load it if not. @@ -2,6 +2,7 @@ require 'delegate' require 'uri' class Gem::SpecificationPolicy < SimpleDelegator VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/.freeze # :nodoc: SPECIAL_CHARACTERS = /\A[#{Regexp.escape('.-_')}]+/.freeze # :nodoc: @@ -300,7 +301,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: end def validate_licenses - licenses.each { |license| if license.length > 64 error "each license must be 64 characters or less" end @@ -314,7 +315,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li message += "Did you mean #{suggestions.map { |s| "'#{s}'"}.join(', ')}?\n" unless suggestions.nil? warning(message) end - } warning <<-warning if licenses.empty? licenses is empty, but is recommended. Use a license identifier from @@ -404,4 +405,5 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li def help_text # :nodoc: "See http://guides.rubygems.org/specification-reference/ for help" end end @@ -5,6 +5,7 @@ # information. class Gem::StubSpecification < Gem::BasicSpecification # :nodoc: PREFIX = "# stub: ".freeze @@ -12,6 +13,7 @@ class Gem::StubSpecification < Gem::BasicSpecification OPEN_MODE = 'r:UTF-8:-'.freeze class StubLine # :nodoc: all attr_reader :name, :version, :platform, :require_paths, :extensions, :full_name @@ -50,10 +52,11 @@ class Gem::StubSpecification < Gem::BasicSpecification end path_list = parts.last - @require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0".freeze).map! { |x| REQUIRE_PATHS[x] || x - } end end def self.default_gemspec_stub(filename, base_dir, gems_dir) @@ -40,11 +40,13 @@ module YAML # :nodoc: # should. module Syck class DefaultKey remove_method :to_s rescue nil def to_s '=' end end end @@ -1,12 +1,6 @@ # frozen_string_literal: true # TODO: $SAFE = 1 -begin - gem 'minitest', '~> 5.0' -rescue NoMethodError, Gem::LoadError - # for ruby tests -end - if defined? Gem::QuickLoader Gem::QuickLoader.load_full_rubygems_library else @@ -23,7 +17,7 @@ if File.exist?(bundler_gemspec) end begin - gem 'minitest' rescue Gem::LoadError end @@ -115,6 +109,8 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni attr_accessor :uri # :nodoc: def assert_activate(expected, *specs) specs.each do |spec| case spec @@ -191,19 +187,19 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni def assert_contains_make_command(target, output, msg = nil) if output.match(/\n/) - msg = message(msg) { 'Expected output containing make command "%s": %s' % [ ('%s %s' % [make_command, target]).rstrip, output.inspect ] - } else - msg = message(msg) { 'Expected make command "%s": %s' % [ ('%s %s' % [make_command, target]).rstrip, output.inspect ] - } end assert scan_make_command_lines(output).any? { |line| @@ -260,7 +256,7 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni @fetcher = nil if Gem::USE_BUNDLER_FOR_GEMDEPS - Bundler.ui = Bundler::UI::Silent.new end @back_ui = Gem::DefaultUserInteraction.ui @ui = Gem::MockGemUi.new @@ -316,7 +312,7 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni Gem.ensure_gem_subdirectories @gemhome @orig_LOAD_PATH = $LOAD_PATH.dup - $LOAD_PATH.map! { |s| expand_path = File.expand_path(s) if expand_path != s expand_path.untaint @@ -327,7 +323,7 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni s = expand_path end s - } Dir.chdir @tempdir @@ -599,11 +595,11 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni def uninstall_gem(spec) require 'rubygems/uninstaller' - Class.new(Gem::Uninstaller) { def ask_if_ok(spec) true end - }.new(spec.name, :executables => true, :user_install => true).uninstall end ## @@ -612,7 +608,11 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni def create_tmpdir tmpdir = nil - Dir.chdir Dir.tmpdir do tmpdir = Dir.pwd end # HACK OSX /private/tmp tmpdir = File.join tmpdir, "test_rubygems_#{$$}" FileUtils.mkdir_p tmpdir return tmpdir @@ -723,7 +723,10 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni spec.files.each do |file| next if File.exist? file FileUtils.mkdir_p File.dirname(file) - File.open file, 'w' do |fp| fp.puts "# #{file}" end end use_ui Gem::MockGemUi.new do @@ -751,6 +754,11 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni Gem::Specification.reset end ## # Install the provided specs @@ -1017,7 +1025,7 @@ Also, a list: s.add_dependency 'x', '>= 1' end - @pl1 = quick_gem 'pl', '1' do |s| # l for legacy s.files = %w[lib/code.rb] s.require_paths = %w[lib] s.platform = Gem::Platform.new 'i386-linux' @@ -1339,6 +1347,7 @@ Also, a list: end class << self # :nodoc: ## # Return the join path, with escaping backticks, dollars, and @@ -1352,12 +1361,12 @@ Also, a list: "\"#{path.gsub(/[`$"]/, '\\&')}\"" end end end @@ruby = rubybin - gempath = File.expand_path('../../../test/rubygems', __FILE__) - @@good_rake = "#{rubybin} #{escape_path(gempath, 'good_rake.rb')}" - @@bad_rake = "#{rubybin} #{escape_path(gempath, 'bad_rake.rb')}" ## # Construct a new Gem::Dependency. @@ -1526,6 +1535,7 @@ Also, a list: def prefetch(reqs) # :nodoc: end end ## @@ -1545,14 +1555,12 @@ Also, a list: def self.cert_path(cert_name) if 32 == (Time.at(2**32) rescue 32) - cert_file = - File.expand_path "../../../test/rubygems/#{cert_name}_cert_32.pem", - __FILE__ return cert_file if File.exist? cert_file end - File.expand_path "../../../test/rubygems/#{cert_name}_cert.pem", __FILE__ end ## @@ -1570,13 +1578,13 @@ Also, a list: # Returns the path to the key named +key_name+ from <tt>test/rubygems</tt> def self.key_path(key_name) - File.expand_path "../../../test/rubygems/#{key_name}_key.pem", __FILE__ end # :stopdoc: # only available in RubyGems tests - PRIVATE_KEY_PASSPHRASE = 'Foo bar'.freeze begin PRIVATE_KEY = load_key 'private' @@ -366,4 +366,5 @@ class TempIO < Tempfile flush Gem.read_binary path end end @@ -65,12 +65,12 @@ module Gem::Text x = nil str1.each_char.each_with_index do |char1,i| - e = i+1 str2.each_char.each_with_index do |char2,j| cost = (char1 == char2) ? 0 : 1 x = min3( - d[j+1] + 1, # insertion e + 1, # deletion d[j] + cost # substitution ) @@ -57,7 +57,7 @@ class Gem::Uninstaller # Indicate if development dependencies should be checked when # uninstalling. (default: false) # - @check_dev = options[:check_dev] if options[:force] @force_all = true @@ -134,7 +134,7 @@ class Gem::Uninstaller elsif index >= 0 && index < list.size uninstall_gem list[index] else - say "Error: must enter a number [1-#{list.size+1}]" end else uninstall_gem list.first @@ -180,9 +180,9 @@ class Gem::Uninstaller # Leave any executables created by other installed versions # of this gem installed. - list = Gem::Specification.find_all { |s| s.name == spec.name && s.version != spec.version - } list.each do |s| s.executables.each do |exe_name| @@ -354,4 +354,5 @@ class Gem::Uninstaller raise e end end @@ -227,7 +227,7 @@ class Gem::StreamUI @outs.puts question list.each_with_index do |item, index| - @outs.puts " #{index+1}. #{item}" end @outs.print "> " @@ -418,6 +418,7 @@ class Gem::StreamUI def done end end ## @@ -506,6 +507,7 @@ class Gem::StreamUI def done @out.puts @terminal_message end end ## @@ -549,6 +551,7 @@ class Gem::StreamUI def done end end ## @@ -603,7 +606,9 @@ class Gem::StreamUI @out.puts message end end end end ## @@ -619,6 +624,7 @@ class Gem::ConsoleUI < Gem::StreamUI def initialize super STDIN, STDOUT, STDERR, true end end ## @@ -651,4 +657,5 @@ class Gem::SilentUI < Gem::StreamUI def progress_reporter(*args) # :nodoc: SilentProgressReporter.new(@outs, *args) end end @@ -28,7 +28,9 @@ module Gem::Util zipped = StringIO.new(String.new, 'w') zipped.set_encoding Encoding::BINARY - Zlib::GzipWriter.wrap zipped do |io| io.write data end zipped.string end @@ -2,6 +2,7 @@ require 'rubygems/text' class Gem::Licenses extend Gem::Text NONSTANDARD = 'Nonstandard'.freeze @@ -434,4 +435,5 @@ class Gem::Licenses return unless lowest < license.size by_distance[lowest] end end @@ -1,6 +1,7 @@ # frozen_string_literal: true module Gem class List include Enumerable attr_accessor :value, :tail @@ -33,5 +34,6 @@ module Gem return List.new(value) unless list List.new value, list end end end @@ -25,7 +25,7 @@ class Gem::Validator installed_files = [] Find.find gem_directory do |file_name| - fn = file_name[gem_directory.size..file_name.size-1].sub(/^\//, "") installed_files << fn unless fn =~ /CVS/ || fn.empty? || File.directory?(file_name) end @@ -91,17 +91,17 @@ class Gem::Validator File.open gem_path, Gem.binary_mode do |file| package = Gem::Package.new gem_path - good, gone = package.contents.partition { |file_name| File.exist? File.join(gem_directory, file_name) - } gone.sort.each do |path| errors[gem_name][path] = "Missing file" end - good, unreadable = good.partition { |file_name| File.readable? File.join(gem_directory, file_name) - } unreadable.sort.each do |path| errors[gem_name][path] = "Unreadable file" @@ -141,4 +141,5 @@ class Gem::Validator errors end end @@ -150,6 +150,7 @@ # a zero to give a sensible result. class Gem::Version autoload :Requirement, 'rubygems/requirement' include Comparable @@ -395,4 +396,5 @@ class Gem::Version numeric_segments = string_segments.slice!(0, string_start || string_segments.size) return numeric_segments, string_segments end end |