Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1698e411e1ac
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2dcc4ba42ea7
Choose a head ref
  • 2 commits
  • 59 files changed
  • 1 contributor

Commits on Nov 28, 2017

  1. Add missing fixture file.

    headius committed Nov 28, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    headius Charles Oliver Nutter
    Copy the full SHA
    2e8efd2 View commit details
  2. Update to RubyGems 2.6.14.

    headius committed Nov 28, 2017
    Copy the full SHA
    2dcc4ba View commit details
Showing with 452 additions and 884 deletions.
  1. +1 −1 bin/jgem
  2. +37 −79 lib/ruby/stdlib/rubygems.rb
  3. +1 −1 lib/ruby/stdlib/rubygems/basic_specification.rb
  4. +0 −112 lib/ruby/stdlib/rubygems/bundler_version_finder.rb
  5. +1 −1 lib/ruby/stdlib/rubygems/command.rb
  6. +1 −3 lib/ruby/stdlib/rubygems/command_manager.rb
  7. +6 −31 lib/ruby/stdlib/rubygems/commands/cert_command.rb
  8. +1 −1 lib/ruby/stdlib/rubygems/commands/cleanup_command.rb
  9. +1 −1 lib/ruby/stdlib/rubygems/commands/help_command.rb
  10. +1 −3 lib/ruby/stdlib/rubygems/commands/owner_command.rb
  11. +9 −12 lib/ruby/stdlib/rubygems/commands/pristine_command.rb
  12. +1 −2 lib/ruby/stdlib/rubygems/commands/push_command.rb
  13. +14 −13 lib/ruby/stdlib/rubygems/commands/query_command.rb
  14. +69 −124 lib/ruby/stdlib/rubygems/commands/setup_command.rb
  15. +0 −33 lib/ruby/stdlib/rubygems/commands/signin_command.rb
  16. +0 −33 lib/ruby/stdlib/rubygems/commands/signout_command.rb
  17. +3 −4 lib/ruby/stdlib/rubygems/commands/uninstall_command.rb
  18. +4 −16 lib/ruby/stdlib/rubygems/commands/unpack_command.rb
  19. +1 −1 lib/ruby/stdlib/rubygems/commands/update_command.rb
  20. +1 −1 lib/ruby/stdlib/rubygems/commands/which_command.rb
  21. +1 −2 lib/ruby/stdlib/rubygems/commands/yank_command.rb
  22. +25 −14 lib/ruby/stdlib/rubygems/config_file.rb
  23. +9 −10 lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb
  24. +0 −2 lib/ruby/stdlib/rubygems/dependency.rb
  25. +0 −4 lib/ruby/stdlib/rubygems/dependency_installer.rb
  26. +0 −3 lib/ruby/stdlib/rubygems/errors.rb
  27. +0 −6 lib/ruby/stdlib/rubygems/exceptions.rb
  28. +1 −1 lib/ruby/stdlib/rubygems/ext/builder.rb
  29. +4 −2 lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb
  30. +1 −5 lib/ruby/stdlib/rubygems/gem_runner.rb
  31. +28 −5 lib/ruby/stdlib/rubygems/install_update_options.rb
  32. +7 −12 lib/ruby/stdlib/rubygems/installer.rb
  33. +3 −6 lib/ruby/stdlib/rubygems/installer_test_case.rb
  34. +1 −1 lib/ruby/stdlib/rubygems/package.rb
  35. +2 −2 lib/ruby/stdlib/rubygems/package/old.rb
  36. +1 −1 lib/ruby/stdlib/rubygems/request.rb
  37. +3 −20 lib/ruby/stdlib/rubygems/request_set.rb
  38. +3 −3 lib/ruby/stdlib/rubygems/request_set/gem_dependency_api.rb
  39. +1 −5 lib/ruby/stdlib/rubygems/requirement.rb
  40. +3 −24 lib/ruby/stdlib/rubygems/resolver.rb
  41. +6 −4 lib/ruby/stdlib/rubygems/resolver/installer_set.rb
  42. +48 −0 lib/ruby/stdlib/rubygems/safe_yaml.rb
  43. +3 −10 lib/ruby/stdlib/rubygems/security.rb
  44. +0 −43 lib/ruby/stdlib/rubygems/security_option.rb
  45. +12 −4 lib/ruby/stdlib/rubygems/server.rb
  46. +4 −7 lib/ruby/stdlib/rubygems/source.rb
  47. +35 −38 lib/ruby/stdlib/rubygems/source/local.rb
  48. +1 −4 lib/ruby/stdlib/rubygems/source/lock.rb
  49. +1 −3 lib/ruby/stdlib/rubygems/source_local.rb
  50. +2 −3 lib/ruby/stdlib/rubygems/source_specific_file.rb
  51. +3 −7 lib/ruby/stdlib/rubygems/spec_fetcher.rb
  52. +51 −104 lib/ruby/stdlib/rubygems/specification.rb
  53. +3 −2 lib/ruby/stdlib/rubygems/stub_specification.rb
  54. +1 −11 lib/ruby/stdlib/rubygems/test_case.rb
  55. +13 −15 lib/ruby/stdlib/rubygems/user_interaction.rb
  56. +17 −6 lib/ruby/stdlib/rubygems/util.rb
  57. +3 −17 lib/ruby/stdlib/rubygems/version.rb
  58. +1 −6 lib/ruby/stdlib/rubygems/version_option.rb
  59. +3 −0 spec/ruby/language/fixtures/begin_file.rb
2 changes: 1 addition & 1 deletion bin/jgem
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ require 'rubygems/exceptions'
required_version = Gem::Requirement.new ">= 1.8.7"

unless required_version.satisfied_by? Gem.ruby_version then
abort "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
end

args = ARGV.clone
116 changes: 37 additions & 79 deletions lib/ruby/stdlib/rubygems.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
require 'thread'

module Gem
VERSION = "2.6.13"
VERSION = "2.6.14"
end

# Must be first since it unloads the prelude from 1.9.2
@@ -39,24 +39,23 @@ module Gem
# Further RubyGems documentation can be found at:
#
# * {RubyGems Guides}[http://guides.rubygems.org]
# * {RubyGems API}[http://www.rubydoc.info/github/rubygems/rubygems] (also available from
# * {RubyGems API}[http://rubygems.rubyforge.org/rdoc] (also available from
# <tt>gem server</tt>)
#
# == RubyGems Plugins
#
# As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or
# $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and
# placed at the root of your gem's #require_path. Plugins are discovered via
# Gem::find_files and then loaded. Take care when implementing a plugin as your
# Gem::find_files then loaded. Take care when implementing a plugin as your
# plugin file may be loaded multiple times if multiple versions of your gem
# are installed.
#
# For an example plugin, see the {Graph gem}[https://github.com/seattlerb/graph]
# which adds a `gem graph` command.
# For an example plugin, see the graph gem which adds a `gem graph` command.
#
# == RubyGems Defaults, Packaging
#
# RubyGems defaults are stored in lib/rubygems/defaults.rb. If you're packaging
# RubyGems defaults are stored in rubygems/defaults.rb. If you're packaging
# RubyGems or implementing Ruby you can change RubyGems' defaults.
#
# For RubyGems packagers, provide lib/rubygems/defaults/operating_system.rb
@@ -66,7 +65,7 @@ module Gem
# override any defaults from lib/rubygems/defaults.rb.
#
# If you need RubyGems to perform extra work on install or uninstall, your
# defaults override file can set pre/post install and uninstall hooks.
# defaults override file can set pre and post install and uninstall hooks.
# See Gem::pre_install, Gem::pre_uninstall, Gem::post_install,
# Gem::post_uninstall.
#
@@ -107,8 +106,6 @@ module Gem
#
# (If your name is missing, PLEASE let us know!)
#
# == License
#
# See {LICENSE.txt}[rdoc-ref:lib/rubygems/LICENSE.txt] for permissions.
#
# Thanks!
@@ -133,7 +130,6 @@ module Gem

GEM_DEP_FILES = %w[
gem.deps.rb
gems.rb
Gemfile
Isolate
]
@@ -178,8 +174,6 @@ module Gem
write_binary_errors
end.freeze

USE_BUNDLER_FOR_GEMDEPS = false # :nodoc:

@@win_platform = nil

@configuration = nil
@@ -272,22 +266,17 @@ def self.find_spec_for_exe name, exec_name, requirements

return loaded if loaded && dep.matches_spec?(loaded)

find_specs = proc { dep.matching_specs(true) }
if dep.to_s == "bundler (>= 0.a)"
specs = Gem::BundlerVersionFinder.without_filtering(&find_specs)
else
specs = find_specs.call
end
specs = dep.matching_specs(true)

raise Gem::GemNotFoundException,
"can't find gem #{dep}" if specs.empty?

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}"
if name == "bundler" && bundler_message = Gem::BundlerVersionFinder.missing_version_message
msg = bundler_message
end
msg = "can't find gem #{name} (#{requirements}) with executable #{exec_name}"
raise Gem::GemNotFoundException, msg
end

@@ -308,10 +297,7 @@ def self.find_spec_for_exe name, exec_name, requirements

def self.activate_bin_path name, exec_name, requirement # :nodoc:
spec = find_spec_for_exe name, exec_name, [requirement]
Gem::LOADED_SPECS_MUTEX.synchronize do
spec.activate
finish_resolve
end
Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate }
spec.bin_file exec_name
end

@@ -370,16 +356,12 @@ def self.configuration=(config)
# package is not available as a gem, return nil.

def self.datadir(gem_name)
# TODO: deprecate
spec = @loaded_specs[gem_name]
return nil if spec.nil?
spec.datadir
end

class << self
extend Gem::Deprecate
deprecate :datadir, "spec.datadir", 2016, 10
end

##
# A Zlib::Deflate.deflate wrapper

@@ -612,20 +594,23 @@ def self.find_home
# Zlib::GzipReader wrapper that unzips +data+.

def self.gunzip(data)
require 'rubygems/util'
Gem::Util.gunzip data
end

##
# Zlib::GzipWriter wrapper that zips +data+.

def self.gzip(data)
require 'rubygems/util'
Gem::Util.gzip data
end

##
# A Zlib::Inflate#inflate wrapper

def self.inflate(data)
require 'rubygems/util'
Gem::Util.inflate data
end

@@ -690,7 +675,7 @@ def self.load_yaml

unless test_syck
begin
gem 'psych', '>= 1.2.1'
gem 'psych', '>= 2.0.0'
rescue Gem::LoadError
# It's OK if the user does not have the psych gem installed. We will
# attempt to require the stdlib version
@@ -714,6 +699,7 @@ def self.load_yaml
end

require 'yaml'
require 'rubygems/safe_yaml'

# If we're supposed to be using syck, then we may have to force
# activate it via the YAML::ENGINE API.
@@ -730,20 +716,9 @@ def self.load_yaml

##
# The file name and line number of the caller of the caller of this method.
#
# +depth+ is how many layers up the call stack it should go.
#
# e.g.,
#
# def a; Gem.location_of_caller; end
# a #=> ["x.rb", 2] # (it'll vary depending on file name and line number)
#
# def b; c; end
# def c; Gem.location_of_caller(2); end
# b #=> ["x.rb", 6] # (it'll vary depending on file name and line number)

def self.location_of_caller(depth = 1)
caller[depth] =~ /(.*?):(\d+).*?$/i
def self.location_of_caller
caller[1] =~ /(.*?):(\d+).*?$/i
file = $1
lineno = $2.to_i

@@ -1174,6 +1149,8 @@ def self.use_gemdeps path = nil
path = path.dup

if path == "-" then
require 'rubygems/util'

Gem::Util.traverse_parents Dir.pwd do |directory|
dep_file = GEM_DEP_FILES.find { |f| File.file?(f) }

@@ -1192,36 +1169,18 @@ def self.use_gemdeps path = nil
raise ArgumentError, "Unable to find gem dependencies file at #{path}"
end

if USE_BUNDLER_FOR_GEMDEPS

ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
require 'rubygems/user_interaction'
Gem::DefaultUserInteraction.use_ui(ui) do
require "bundler"
@gemdeps = Bundler.setup
Bundler.ui = nil
@gemdeps.requested_specs.map(&:to_spec).sort_by(&:name)
end

else

rs = Gem::RequestSet.new
@gemdeps = rs.load_gemdeps path

rs.resolve_current.map do |s|
s.full_spec.tap(&:activate)
end
rs = Gem::RequestSet.new
@gemdeps = rs.load_gemdeps path

rs.resolve_current.map do |s|
sp = s.full_spec
sp.activate
sp
end
rescue => e
case e
when Gem::LoadError, Gem::UnsatisfiableDependencyError, (defined?(Bundler::GemNotFound) ? Bundler::GemNotFound : Gem::LoadError)
warn e.message
warn "You may need to `gem install -g` to install missing gems"
warn ""
else
raise
end
rescue Gem::LoadError, Gem::UnsatisfiableDependencyError => e
warn e.message
warn "You may need to `gem install -g` to install missing gems"
warn ""
end

class << self
@@ -1267,24 +1226,25 @@ def register_default_spec(spec)
prefix_pattern = /^(#{prefix_group})/
end

suffix_pattern = /#{Regexp.union(Gem.suffixes)}\z/

spec.files.each do |file|
if new_format
file = file.sub(prefix_pattern, "")
next unless $~
end

@path_to_default_spec_map[file] = spec
@path_to_default_spec_map[file.sub(suffix_pattern, "")] = spec
end
end

##
# Find a Gem::Specification of default gem from +path+

def find_unresolved_default_spec(path)
@path_to_default_spec_map[path]
Gem.suffixes.each do |suffix|
spec = @path_to_default_spec_map["#{path}#{suffix}"]
return spec if spec
end
nil
end

##
@@ -1355,7 +1315,6 @@ def clear_default_specs

MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"

autoload :BundlerVersionFinder, 'rubygems/bundler_version_finder'
autoload :ConfigFile, 'rubygems/config_file'
autoload :Dependency, 'rubygems/dependency'
autoload :DependencyList, 'rubygems/dependency_list'
@@ -1371,7 +1330,6 @@ def clear_default_specs
autoload :SourceList, 'rubygems/source_list'
autoload :SpecFetcher, 'rubygems/spec_fetcher'
autoload :Specification, 'rubygems/specification'
autoload :Util, 'rubygems/util'
autoload :Version, 'rubygems/version'

require "rubygems/specification"
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/basic_specification.rb
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ def contains_requirable_file? file
elsif missing_extensions? then
@ignored = true

warn "Ignoring #{full_name} because its extensions are not built. " +
warn "Ignoring #{full_name} because its extensions are not built. " +
"Try: gem pristine #{name} --version #{version}"
return false
end
Loading