merge revision(s) 53707,53708,53709,53712,53777,53781: [Backport #12326]

* 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)

	* lib/rubygems/specification.rb: `coding` is affect only first line except
	  shebang.

	* lib/rubygems/package.rb, lib/rubygems/package/*: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2016-08-24 15:28:23 +00:00
parent ce8729feb6
commit 996b1bfa95
305 changed files with 977 additions and 624 deletions

View file

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
##
# A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
# files.
@ -205,6 +205,7 @@ class Gem::RequestSet::GemDependencyAPI
@installing = false
@requires = Hash.new { |h, name| h[name] = [] }
@vendor_set = @set.vendor_set
@source_set = @set.source_set
@gem_sources = {}
@without_groups = []
@ -363,6 +364,7 @@ class Gem::RequestSet::GemDependencyAPI
source_set ||= gem_path name, options
source_set ||= gem_git name, options
source_set ||= gem_git_source name, options
source_set ||= gem_source name, options
duplicate = @dependencies.include? name
@ -408,11 +410,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
pin_gem_source name, :git, repository
reference = nil
reference ||= options.delete :ref
reference ||= options.delete :branch
reference ||= options.delete :tag
reference ||= 'master'
reference = gem_git_reference options
submodules = options.delete :submodules
@ -421,6 +419,36 @@ Gem dependencies file #{@path} requires #{name} more than once.
true
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
##
@ -481,6 +509,23 @@ Gem dependencies file #{@path} requires #{name} more than once.
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
# platform matches the current platform.
@ -527,6 +572,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
else
@requires[name] << name
end
raise ArgumentError, "Unhandled gem options #{options.inspect}" unless options.empty?
end
private :gem_requires
@ -612,6 +658,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
add_dependencies groups, spec.development_dependencies
@vendor_set.add_vendor_gem spec.name, path
gem_requires spec.name, options
end
@ -651,6 +698,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
when :default then '(default)'
when :path then "path: #{source}"
when :git then "git: #{source}"
when :source then "source: #{source}"
else '(unknown)'
end
@ -799,4 +847,3 @@ Gem dependencies file #{@path} requires #{name} more than once.
Gem::RequestSet::GemDepedencyAPI = self # :nodoc:
end