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: 80c178618e2a
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 023f6a45ddf6
Choose a head ref
  • 2 commits
  • 49 files changed
  • 2 contributors

Commits on Mar 19, 2017

  1. Copy the full SHA
    8940197 View commit details

Commits on Mar 23, 2017

  1. Merge pull request #4537 from olleolleolle/fix/add-rg-2-6-11

    Update to Rubygems 2.6.11
    headius authored Mar 23, 2017
    Copy the full SHA
    023f6a4 View commit details
Showing with 614 additions and 313 deletions.
  1. +32 −24 lib/ruby/stdlib/rubygems.rb
  2. +1 −1 lib/ruby/stdlib/rubygems/basic_specification.rb
  3. +1 −1 lib/ruby/stdlib/rubygems/command.rb
  4. +1 −1 lib/ruby/stdlib/rubygems/command_manager.rb
  5. +31 −6 lib/ruby/stdlib/rubygems/commands/cert_command.rb
  6. +1 −1 lib/ruby/stdlib/rubygems/commands/cleanup_command.rb
  7. +1 −1 lib/ruby/stdlib/rubygems/commands/help_command.rb
  8. +3 −1 lib/ruby/stdlib/rubygems/commands/owner_command.rb
  9. +2 −1 lib/ruby/stdlib/rubygems/commands/push_command.rb
  10. +13 −14 lib/ruby/stdlib/rubygems/commands/query_command.rb
  11. +108 −69 lib/ruby/stdlib/rubygems/commands/setup_command.rb
  12. +16 −4 lib/ruby/stdlib/rubygems/commands/unpack_command.rb
  13. +1 −1 lib/ruby/stdlib/rubygems/commands/which_command.rb
  14. +2 −1 lib/ruby/stdlib/rubygems/commands/yank_command.rb
  15. +4 −24 lib/ruby/stdlib/rubygems/config_file.rb
  16. +4 −8 lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb
  17. +4 −0 lib/ruby/stdlib/rubygems/dependency_installer.rb
  18. +6 −0 lib/ruby/stdlib/rubygems/exceptions.rb
  19. +1 −1 lib/ruby/stdlib/rubygems/ext/builder.rb
  20. +5 −1 lib/ruby/stdlib/rubygems/gem_runner.rb
  21. +5 −28 lib/ruby/stdlib/rubygems/install_update_options.rb
  22. +6 −3 lib/ruby/stdlib/rubygems/installer.rb
  23. +6 −3 lib/ruby/stdlib/rubygems/installer_test_case.rb
  24. +1 −1 lib/ruby/stdlib/rubygems/package/old.rb
  25. +1 −1 lib/ruby/stdlib/rubygems/request.rb
  26. +20 −3 lib/ruby/stdlib/rubygems/request_set.rb
  27. +3 −3 lib/ruby/stdlib/rubygems/request_set/gem_dependency_api.rb
  28. +1 −1 lib/ruby/stdlib/rubygems/request_set/lockfile/tokenizer.rb
  29. +5 −1 lib/ruby/stdlib/rubygems/requirement.rb
  30. +61 −5 lib/ruby/stdlib/rubygems/resolver.rb
  31. +13 −3 lib/ruby/stdlib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb
  32. +9 −2 lib/ruby/stdlib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
  33. +1 −1 lib/ruby/stdlib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb
  34. +1 −1 lib/ruby/stdlib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb
  35. +1 −1 lib/ruby/stdlib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb
  36. +35 −15 lib/ruby/stdlib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb
  37. +1 −1 lib/ruby/stdlib/rubygems/resolver/set.rb
  38. +10 −3 lib/ruby/stdlib/rubygems/security.rb
  39. +43 −0 lib/ruby/stdlib/rubygems/security_option.rb
  40. +6 −3 lib/ruby/stdlib/rubygems/source.rb
  41. +4 −1 lib/ruby/stdlib/rubygems/source/lock.rb
  42. +7 −3 lib/ruby/stdlib/rubygems/spec_fetcher.rb
  43. +83 −49 lib/ruby/stdlib/rubygems/specification.rb
  44. +1 −0 lib/ruby/stdlib/rubygems/ssl_certs/.document
  45. +2 −3 lib/ruby/stdlib/rubygems/stub_specification.rb
  46. +14 −2 lib/ruby/stdlib/rubygems/test_case.rb
  47. +15 −13 lib/ruby/stdlib/rubygems/user_interaction.rb
  48. +16 −2 lib/ruby/stdlib/rubygems/version.rb
  49. +6 −1 lib/ruby/stdlib/rubygems/version_option.rb
56 changes: 32 additions & 24 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.10"
VERSION = "2.6.11"
end

# Must be first since it unloads the prelude from 1.9.2
@@ -296,7 +296,10 @@ 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 { spec.activate }
Gem::LOADED_SPECS_MUTEX.synchronize do
spec.activate
finish_resolve
end
spec.bin_file exec_name
end

@@ -355,12 +358,16 @@ 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

@@ -593,23 +600,20 @@ 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

@@ -1147,8 +1151,6 @@ 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) }

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

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

rs.resolve_current.map do |s|
sp = s.full_spec
sp.activate
sp
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
require 'rubygems/user_interaction'
Gem::DefaultUserInteraction.use_ui(ui) do
require "bundler/postit_trampoline" unless ENV["BUNDLE_TRAMPOLINE_DISABLE"]
require "bundler"
@gemdeps = Bundler.setup
Bundler.ui = nil
@gemdeps.requested_specs.map(&:to_spec).sort_by(&:name)
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
@@ -1224,25 +1232,24 @@ 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)
Gem.suffixes.each do |suffix|
spec = @path_to_default_spec_map["#{path}#{suffix}"]
return spec if spec
end
nil
@path_to_default_spec_map[path]
end

##
@@ -1328,6 +1335,7 @@ 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
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/command.rb
Original file line number Diff line number Diff line change
@@ -527,7 +527,7 @@ def wrap(text, width) # :doc:
end

add_common_option("--silent",
"Silence rubygems output") do |value, options|
"Silence RubyGems output") do |value, options|
options[:silent] = true
end

2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/command_manager.rb
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ def process_args(args, build_args=nil)
say Gem::VERSION
terminate_interaction 0
when /^-/ then
alert_error "Invalid option: #{args.first}. See 'gem --help'."
alert_error "Invalid option: #{args.first}. See 'gem --help'."
terminate_interaction 1
else
cmd_name = args.shift.downcase
37 changes: 31 additions & 6 deletions lib/ruby/stdlib/rubygems/commands/cert_command.rb
Original file line number Diff line number Diff line change
@@ -84,6 +84,11 @@ def initialize

options[:sign] << cert_file
end

add_option('-d', '--days NUMBER_OF_DAYS',
'Days before the certificate expires') do |days, options|
options[:expiration_length_days] = days.to_i
end
end

def add_certificate certificate # :nodoc:
@@ -105,16 +110,20 @@ def execute
list_certificates_matching filter
end

options[:build].each do |name|
build name
options[:build].each do |email|
build email
end

sign_certificates unless options[:sign].empty?
end

def build name
def build email
if !valid_email?(email)
raise Gem::CommandLineError, "Invalid email address #{email}"
end

key, key_path = build_key
cert_path = build_cert name, key
cert_path = build_cert email, key

say "Certificate: #{cert_path}"

@@ -124,8 +133,16 @@ def build name
end
end

def build_cert name, key # :nodoc:
cert = Gem::Security.create_cert_email name, key
def build_cert email, key # :nodoc:
expiration_length_days = options[:expiration_length_days]
age =
if expiration_length_days.nil? || expiration_length_days == 0
Gem::Security::ONE_YEAR
else
Gem::Security::ONE_DAY * expiration_length_days
end

cert = Gem::Security.create_cert_email email, key, age
Gem::Security.write cert, "gem-public_cert.pem"
end

@@ -273,5 +290,13 @@ def sign_certificates # :nodoc:
end
end

private

def valid_email? email
# It's simple, but is all we need
email =~ /\A.+@.+\z/
end


end if defined?(OpenSSL::SSL)

2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/commands/cleanup_command.rb
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ def execute
clean_gems
end

say "Clean Up Complete"
say "Clean up complete"

verbose do
skipped = @default_gems.map { |spec| spec.full_name }
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/commands/help_command.rb
Original file line number Diff line number Diff line change
@@ -367,7 +367,7 @@ def show_command_help command_name # :nodoc:
elsif possibilities.size > 1 then
alert_warning "Ambiguous command #{command_name} (#{possibilities.join(', ')})"
else
alert_warning "Unknown command #{command_name}. Try: gem help commands"
alert_warning "Unknown command #{command_name}. Try: gem help commands"
end
end

4 changes: 3 additions & 1 deletion lib/ruby/stdlib/rubygems/commands/owner_command.rb
Original file line number Diff line number Diff line change
@@ -40,7 +40,9 @@ def initialize
options[:remove] << value
end

add_option '-h', '--host HOST', 'Use another gemcutter-compatible host' do |value, options|
add_option '-h', '--host HOST',
'Use another gemcutter-compatible host',
' (e.g. https://rubygems.org)' do |value, options|
options[:host] = value
end
end
3 changes: 2 additions & 1 deletion lib/ruby/stdlib/rubygems/commands/push_command.rb
Original file line number Diff line number Diff line change
@@ -33,7 +33,8 @@ def initialize
add_key_option

add_option('--host HOST',
'Push to another gemcutter-compatible host') do |value, options|
'Push to another gemcutter-compatible host',
' (e.g. https://rubygems.org)') do |value, options|
options[:host] = value
end

27 changes: 13 additions & 14 deletions lib/ruby/stdlib/rubygems/commands/query_command.rb
Original file line number Diff line number Diff line change
@@ -255,22 +255,21 @@ def entry_versions entry, name_tuples, platforms, specs
name_tuples.map { |n| n.version }.uniq
else
platforms.sort.reverse.map do |version, pls|
if pls == [Gem::Platform::RUBY] then
if options[:domain] == :remote || specs.all? { |spec| spec.is_a? Gem::Source }
version
else
spec = specs.select { |s| s.version == version }
if spec.first.default_gem?
"default: #{version}"
else
version
end
out = version.to_s

if options[:domain] == :local
default = specs.any? do |s|
!s.is_a?(Gem::Source) && s.version == version && s.default_gem?
end
else
ruby = pls.delete Gem::Platform::RUBY
platform_list = [ruby, *pls.sort].compact
"#{version} #{platform_list.join ' '}"
out = "default: #{out}" if default
end

if pls != [Gem::Platform::RUBY] then
platform_list = [pls.delete(Gem::Platform::RUBY), *pls.sort].compact
out = platform_list.unshift(out).join(' ')
end

out
end
end

Loading