summaryrefslogtreecommitdiff
path: root/lib/rubygems/source.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-21 23:27:30 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-21 23:27:30 +0000
commit5307d803f5cce7b14a6afd1d51f6d53ec85ca87d ()
treeaac2997a9ff000fbf2f1f9f27077bb7b2403f2c9 /lib/rubygems/source.rb
parentb1529a30e08040b717adef8ac1fa8be1c060e7e1 (diff)
* lib/rubygems: Update to RubyGems master 50a8210. Important changes
in this commit: RubyGems now automatically checks for gem.deps.rb or Gemfile when running ruby executables. This behavior is similar to `bundle exec rake`. This change may be reverted before Ruby 2.1.0 if too many bugs are found. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rubygems/source.rb44
1 files changed, 35 insertions, 9 deletions
@@ -1,13 +1,30 @@
require 'uri'
require 'fileutils'
class Gem::Source
- FILES = {
:released => 'specs',
:latest => 'latest_specs',
:prerelease => 'prerelease_specs',
}
def initialize(uri)
unless uri.kind_of? URI
uri = URI.parse(uri.to_s)
@@ -17,13 +34,17 @@ class Gem::Source
@api_uri = nil
end
- attr_reader :uri
- def api_uri
require 'rubygems/remote_fetcher'
@api_uri ||= Gem::RemoteFetcher.fetcher.api_endpoint uri
end
def <=>(other)
case other
when Gem::Source::Installed,
@@ -46,13 +67,11 @@ class Gem::Source
end
end
- include Comparable
-
- def ==(other)
self.class === other and @uri == other.uri
end
- alias_method :eql?, :==
##
# Returns a Set that can fetch specifications from this source.
@@ -70,7 +89,7 @@ class Gem::Source
end
end
- def hash
@uri.hash
end
@@ -83,6 +102,9 @@ class Gem::Source
File.join Gem.spec_cache_dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path)
end
def update_cache?
@update_cache ||=
begin
@@ -166,6 +188,10 @@ class Gem::Source
end
end
def download(spec, dir=Dir.pwd)
fetcher = Gem::RemoteFetcher.fetcher
fetcher.download spec, api_uri.to_s, dir
@@ -176,7 +202,7 @@ class Gem::Source
q.breakable
q.text @uri.to_s
if api = api_uri
- g.text api
end
end
end