* lib/rubygems: Update to RubyGems master 0a3814b. Changes:

Fixed extension directory in Gem::Specification#require_paths.

  Allow installation of gems when $HOME is nonexistent or unwritable.

  Use proper API in InstallCommand.

  Improve support for path option in gem dependency files.

  Remove warnings.

* test/rubygems:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-10-18 21:56:18 +00:00
parent 9f9b476710
commit 08aa6d59a2
17 changed files with 165 additions and 116 deletions

View file

@ -176,7 +176,7 @@ class Gem::BasicSpecification
return @require_paths if @extensions.empty?
relative_extension_install_dir =
File.join '..', '..', '..', 'extensions', Gem::Platform.local.to_s,
File.join '..', '..', 'extensions', Gem::Platform.local.to_s,
Gem.extension_api_version, full_name
@require_paths + [relative_extension_install_dir]

View file

@ -135,7 +135,7 @@ to write the specification by hand. For example:
def execute
if gf = options[:gemdeps] then
install_from_gemdeps gf
return
return # not reached
end
@installed_specs = []
@ -151,7 +151,7 @@ to write the specification by hand. For example:
show_installed
raise Gem::SystemExitException, exit_code
terminate_interaction exit_code
end
def install_from_gemdeps gf # :nodoc:
@ -173,7 +173,7 @@ to write the specification by hand. For example:
@installed_specs = specs
raise Gem::SystemExitException, 0
terminate_interaction
end
def install_gem name, version # :nodoc:

View file

@ -159,7 +159,15 @@ class Gem::RequestSet
# Resolve the requested dependencies and return an Array of Specification
# objects to be activated.
def resolve set = nil
def resolve set = Gem::DependencyResolver::IndexSet.new
sets = [set, @vendor_set].compact
set = if sets.size == 1 then
sets.first
else
Gem::DependencyResolver.compose_sets(*sets)
end
resolver = Gem::DependencyResolver.new @dependencies, set
resolver.development = @development
resolver.soft_missing = @soft_missing

View file

@ -51,8 +51,8 @@ class Gem::RequestSet::GemDependencyAPI
@vendor_set.add_vendor_gem name, directory
end
group = options.delete :group
all_groups = group ? Array(group) : []
g = options.delete :group
all_groups = g ? Array(g) : []
groups = options.delete :groups
all_groups |= groups if groups

View file

@ -47,12 +47,7 @@ class Gem::Source
include Comparable
def ==(other)
case other
when self.class
@uri == other.uri
else
false
end
self.class === other and @uri == other.uri
end
alias_method :eql?, :==
@ -71,7 +66,12 @@ class Gem::Source
end
def update_cache?
@update_cache ||= File.stat(Gem.user_home).uid == Process.uid
@update_cache ||=
begin
File.stat(Gem.user_home).uid == Process.uid
rescue Errno::ENOENT
false
end
end
def fetch_spec(name)

View file

@ -1,6 +1,7 @@
class Gem::Source::Installed < Gem::Source
def initialize
@uri = nil
end
##

View file

@ -38,7 +38,12 @@ class Gem::SpecFetcher
end
def initialize
@update_cache = File.stat(Gem.user_home).uid == Process.uid
@update_cache =
begin
File.stat(Gem.user_home).uid == Process.uid
rescue Errno::EACCES, Errno::ENOENT
false
end
@specs = {}
@latest_specs = {}

View file

@ -165,5 +165,12 @@ class Gem::StubSpecification < Gem::BasicSpecification
@version ||= data.version
end
##
# Is there a stub line present for this StubSpecification?
def stubbed?
data.is_a? StubLine
end
end

View file

@ -1098,11 +1098,15 @@ Also, a list:
##
# A vendor_gem is used with a gem dependencies file. The gem created here
# has no files, just a gem specification for the given +name+ and +version+.
#
# Yields the +specification+ to the block, if given
def vendor_gem name = 'a', version = 1
directory = File.join 'vendor', name
vendor_spec = Gem::Specification.new name, version
vendor_spec = Gem::Specification.new name, version do |specification|
yield specification if block_given?
end
FileUtils.mkdir_p directory