mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +02:00
merge revision(s) 39542,39545: [Backport #7991]
* lib/rubygems/ext/builder.rb: Fix incompatibilities when installing extensions. Patch by Nobu. [ruby-trunk - Bug #7968] [ruby-trunk - Bug #7971] * lib/rubygems/ext/ext_conf_builder.rb: ditto. * lib/rubygems/installer.rb: ditto. * test/rubygems/test_gem_ext_ext_conf_builder.rb: Test for the above. * test/rubygems/test_gem_installer.rb: ditto. * lib/rubygems/commands/sources_command.rb: Prefer HTTPS over HTTP. * lib/rubygems/defaults.rb: ditto * lib/rubygems/dependency_resolver.rb: Ditto. * lib/rubygems/source.rb: ditto. * lib/rubygems/spec_fetcher.rb: ditto. * lib/rubygems/specification.rb: ditto. * lib/rubygems/test_utilities.rb: ditto. * test/rubygems/test_gem.rb: Test for the above. * test/rubygems/test_gem_commands_sources_command.rb: ditto. * test/rubygems/test_gem_dependency_resolver_api_set.rb: ditto. * test/rubygems/test_gem_remote_fetcher.rb: ditto. * test/rubygems/test_gem_source.rb: ditto. * test/rubygems/test_gem_spec_fetcher.rb: ditto. [ruby-trunk - Bug #7698] [ruby-trunk - Bug #7971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
91e371802f
commit
1ec03bfcfe
20 changed files with 301 additions and 43 deletions
|
@ -69,6 +69,8 @@ module Gem
|
|||
# and dependencies.
|
||||
#
|
||||
class APISpecification
|
||||
attr_reader :set # :nodoc:
|
||||
|
||||
def initialize(set, api_data)
|
||||
@set = set
|
||||
@name = api_data[:name]
|
||||
|
@ -80,6 +82,14 @@ module Gem
|
|||
|
||||
attr_reader :name, :version, :dependencies
|
||||
|
||||
def == other # :nodoc:
|
||||
self.class === other and
|
||||
@set == other.set and
|
||||
@name == other.name and
|
||||
@version == other.version and
|
||||
@dependencies == other.dependencies
|
||||
end
|
||||
|
||||
def full_name
|
||||
"#{@name}-#{@version}"
|
||||
end
|
||||
|
@ -91,6 +101,7 @@ module Gem
|
|||
class APISet
|
||||
def initialize
|
||||
@data = Hash.new { |h,k| h[k] = [] }
|
||||
@dep_uri = URI 'https://rubygems.org/api/v1/dependencies'
|
||||
end
|
||||
|
||||
# Return data for all versions of the gem +name+.
|
||||
|
@ -100,8 +111,8 @@ module Gem
|
|||
return @data[name]
|
||||
end
|
||||
|
||||
u = URI.parse "http://rubygems.org/api/v1/dependencies?gems=#{name}"
|
||||
str = Net::HTTP.get(u)
|
||||
uri = @dep_uri + "?gems=#{name}"
|
||||
str = Gem::RemoteFetcher.fetcher.fetch_path uri
|
||||
|
||||
Marshal.load(str).each do |ver|
|
||||
@data[ver[:name]] << ver
|
||||
|
@ -134,8 +145,8 @@ module Gem
|
|||
|
||||
return if needed.empty?
|
||||
|
||||
u = URI.parse "http://rubygems.org/api/v1/dependencies?gems=#{needed.join ','}"
|
||||
str = Net::HTTP.get(u)
|
||||
uri = @dep_uri + "?gems=#{needed.sort.join ','}"
|
||||
str = Gem::RemoteFetcher.fetcher.fetch_path uri
|
||||
|
||||
Marshal.load(str).each do |ver|
|
||||
@data[ver[:name]] << ver
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue