Skip to content

Commit

Permalink
Update to RubyGems 2.4.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 28, 2015
1 parent cb96d72 commit c38758f
Show file tree
Hide file tree
Showing 23 changed files with 582 additions and 522 deletions.
4 changes: 2 additions & 2 deletions lib/ruby/stdlib/rubygems.rb
Expand Up @@ -9,7 +9,7 @@
require 'thread'

module Gem
VERSION = '2.4.5'
VERSION = '2.4.6'
end

# Must be first since it unloads the prelude from 1.9.2
Expand Down Expand Up @@ -598,7 +598,7 @@ def self.load_yaml

unless test_syck
begin
gem 'psych', '~> 1.2', '>= 1.2.1'
gem 'psych', '>= 1.2.1'
rescue Gem::LoadError
# It's OK if the user does not have the psych gem installed. We will
# attempt to require the stdlib version
Expand Down
5 changes: 2 additions & 3 deletions lib/ruby/stdlib/rubygems/basic_specification.rb
Expand Up @@ -61,8 +61,7 @@ def contains_requirable_file? file
@contains_requirable_file ||= {}
@contains_requirable_file[file] ||=
begin
if instance_variable_defined?(:@ignored) or
instance_variable_defined?('@ignored') then
if instance_variable_defined?(:@ignored) then
return false
elsif missing_extensions? then
@ignored = true
Expand Down Expand Up @@ -145,7 +144,7 @@ def full_require_paths
File.join full_gem_path, path
end

full_paths.unshift extension_dir unless @extensions.nil? || @extensions.empty?
full_paths << extension_dir unless @extensions.nil? || @extensions.empty?

full_paths
end
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby/stdlib/rubygems/commands/help_command.rb
Expand Up @@ -176,7 +176,7 @@ class Gem::Commands::HelpCommand < Gem::Command
Ruby Version and Engine Dependency
==================================
You can specifiy the version, engine and engine version of ruby to use with
You can specify the version, engine and engine version of ruby to use with
your gem dependencies file. If you are not running the specified version
RubyGems will raise an exception.
Expand Down Expand Up @@ -223,7 +223,7 @@ class Gem::Commands::HelpCommand < Gem::Command
The #group method allows multiple groups.
The #gemspec development dependencies are placed in the :development group by
default. This may be overriden with the :development_group option:
default. This may be overridden with the :development_group option:
gemspec development_group: :other
Expand Down
4 changes: 3 additions & 1 deletion lib/ruby/stdlib/rubygems/commands/open_command.rb
Expand Up @@ -61,7 +61,9 @@ def open_gem name
end

def open_editor path
system(*@editor.split(/\s+/) + [path])
Dir.chdir(path) do
system(*@editor.split(/\s+/) + [path])
end
end

def spec_for name
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/commands/yank_command.rb
Expand Up @@ -21,7 +21,7 @@ def description # :nodoc:
data you will need to change them immediately and yank your gem.
If you are yanking a gem due to intellectual property reasons contact
http://help.rubygems.org for permanant removal. Be sure to mention this
http://help.rubygems.org for permanent removal. Be sure to mention this
as the reason for the removal request.
EOF
end
Expand Down
3 changes: 1 addition & 2 deletions lib/ruby/stdlib/rubygems/compatibility.rb
Expand Up @@ -20,8 +20,7 @@ module Gem

$LOADED_FEATURES.delete Gem::QuickLoader.path_to_full_rubygems_library

if $LOADED_FEATURES.any? do |path| path.end_with? '/rubygems.rb' end then
# TODO path does not exist here
if path = $LOADED_FEATURES.find {|n| n.end_with? '/rubygems.rb'} then
raise LoadError, "another rubygems is already loaded from #{path}"
end

Expand Down
12 changes: 11 additions & 1 deletion lib/ruby/stdlib/rubygems/dependency_installer.rb
Expand Up @@ -218,7 +218,17 @@ def find_gems_with_sources dep, best_only=false # :nodoc:
tuples, errors = Gem::SpecFetcher.fetcher.search_for_dependency dep

if best_only && !tuples.empty?
tuples.sort! { |a,b| b[0].version <=> a[0].version }
tuples.sort! do |a,b|
if b[0].version == a[0].version
if b[0].platform != Gem::Platform::RUBY
1
else
-1
end
else
b[0].version <=> a[0].version
end
end
tuples = [tuples.first]
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/installer.rb
Expand Up @@ -681,7 +681,7 @@ def app_script_text(bin_file_name)
# return the stub script text used to launch the true Ruby script

def windows_stub_script(bindir, bin_file_name)
ruby = Gem.ruby.chomp('"').tr(File::SEPARATOR, "\\")
ruby = Gem.ruby.gsub(/^\"|\"$/, "").tr(File::SEPARATOR, "\\")
return <<-TEXT
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
Expand Down
3 changes: 2 additions & 1 deletion lib/ruby/stdlib/rubygems/package.rb
Expand Up @@ -366,8 +366,9 @@ def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc:

FileUtils.mkdir_p mkdir, mkdir_options

open destination, 'wb', entry.header.mode do |out|
open destination, 'wb' do |out|
out.write entry.read
FileUtils.chmod entry.header.mode, destination
end if entry.file?

verbose destination
Expand Down
8 changes: 4 additions & 4 deletions lib/ruby/stdlib/rubygems/package/tar_writer.rb
Expand Up @@ -291,7 +291,7 @@ def mkdir(name, mode)

def split_name(name) # :nodoc:
if name.bytesize > 256
raise Gem::Package::TooLongFileName.new("File \"#{name}\" has a too long path (should be 256 or less)")
raise Gem::Package::TooLongFileName.new("File \"#{name}\" has a too long path (should be 256 or less)")
end

if name.bytesize <= 100 then
Expand All @@ -311,11 +311,11 @@ def split_name(name) # :nodoc:
name = newname

if name.bytesize > 100
raise Gem::Package::TooLongFileName.new("File \"#{prefix}/#{name}\" has a too long name (should be 100 or less)")
raise Gem::Package::TooLongFileName.new("File \"#{prefix}/#{name}\" has a too long name (should be 100 or less)")
end

if prefix.bytesize > 155 then
raise Gem::Package::TooLongFileName.new("File \"#{prefix}/#{name}\" has a too long base path (should be 155 or less)")
raise Gem::Package::TooLongFileName.new("File \"#{prefix}/#{name}\" has a too long base path (should be 155 or less)")
end
end

Expand Down
7 changes: 0 additions & 7 deletions lib/ruby/stdlib/rubygems/path_support.rb
Expand Up @@ -42,13 +42,6 @@ def initialize(env=ENV)

private

##
# Set the Gem home directory (as reported by Gem.dir).

def home=(home)
@home = home.to_s
end

##
# Set the Gem search path (as reported by Gem.path).

Expand Down
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/psych_additions.rb
@@ -1,4 +1,4 @@
# This exists just to satify 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
# in Specification._load, but if we don't have the constant, Marshal
# blows up.
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems/remote_fetcher.rb
Expand Up @@ -103,7 +103,7 @@ def api_endpoint(uri)
# filename. Returns nil if the gem cannot be located.
#--
# Should probably be integrated with #download below, but that will be a
# larger, more emcompassing effort. -erikh
# larger, more encompassing effort. -erikh

def download_to_cache dependency
found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dependency
Expand Down
14 changes: 10 additions & 4 deletions lib/ruby/stdlib/rubygems/request_set.rb
Expand Up @@ -116,7 +116,7 @@ def gem name, *reqs
if dep = @dependency_names[name] then
dep.requirement.concat reqs
else
dep = Gem::Dependency.new name, reqs
dep = Gem::Dependency.new name, *reqs
@dependency_names[name] = dep
@dependencies << dep
end
Expand Down Expand Up @@ -223,7 +223,7 @@ def install_from_gemdeps options, &block

if options.fetch :lock, true then
lockfile =
Gem::RequestSet::Lockfile.new self, gemdeps, gem_deps_api.dependencies
Gem::RequestSet::Lockfile.build self, gemdeps, gem_deps_api.dependencies
lockfile.write
end

Expand Down Expand Up @@ -275,8 +275,13 @@ def load_gemdeps path, without_groups = [], installing = false

@git_set.root_dir = @install_dir

lockfile = Gem::RequestSet::Lockfile.new self, path
lockfile.parse
lock_file = "#{File.expand_path(path)}.lock".untaint
begin
tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
parser = tokenizer.make_parser self, []
parser.parse
rescue Errno::ENOENT
end

gf = Gem::RequestSet::GemDependencyAPI.new self, path
gf.installing = installing
Expand Down Expand Up @@ -411,3 +416,4 @@ def tsort_each_child node # :nodoc:

require 'rubygems/request_set/gem_dependency_api'
require 'rubygems/request_set/lockfile'
require 'rubygems/request_set/lockfile/tokenizer'
8 changes: 4 additions & 4 deletions lib/ruby/stdlib/rubygems/request_set/gem_dependency_api.rb
Expand Up @@ -367,11 +367,11 @@ def gem name, *requirements

@dependencies[name] =
if requirements.empty? and not source_set then
nil
Gem::Requirement.default
elsif source_set then
'!'
Gem::Requirement.source_set
else
requirements
Gem::Requirement.create requirements
end

return unless gem_platforms options
Expand Down Expand Up @@ -601,7 +601,7 @@ def gemspec options = {}
add_dependencies groups, [self_dep]
add_dependencies groups, spec.runtime_dependencies

@dependencies[spec.name] = '!'
@dependencies[spec.name] = Gem::Requirement.source_set

spec.dependencies.each do |dep|
@dependencies[dep.name] = dep.requirement
Expand Down

0 comments on commit c38758f

Please sign in to comment.