summaryrefslogtreecommitdiff
path: root/lib/bundler/remote_specification.rb
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-06-19 15:40:55 -0500
committerAndre Arko <andre@arko.net>2015-06-19 16:13:18 -0500
commit3f4f6286c56765e8c4968631643106cfd534b789 (patch)
tree349b7a3738cfafaa42405a123e4f2eb500e8b144 /lib/bundler/remote_specification.rb
parentec8093c8deea290b4062f7fd116f5214f9d3f28a (diff)
downloadbundler-3f4f6286c56765e8c4968631643106cfd534b789.tar.gz
Allow comparing Bundler StubSpecs with RG specs
/ht @tony-spataro-rs fixes #3762
Diffstat (limited to 'lib/bundler/remote_specification.rb')
-rw-r--r--lib/bundler/remote_specification.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index c80eaa40fc..d8bd5c331f 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -8,6 +8,7 @@ module Bundler
# full specification will only be fetched when necessary.
class RemoteSpecification
include MatchPlatform
+ include Comparable
attr_reader :name, :version, :platform
attr_accessor :source, :remote
@@ -33,17 +34,25 @@ module Bundler
end
end
+ def <=>(other)
+ if other.respond_to?(:full_name)
+ full_name <=> other.full_name
+ else
+ super
+ end
+ end
+
# Because Rubyforge cannot be trusted to provide valid specifications
# once the remote gem is downloaded, the backend specification will
# be swapped out.
def __swap__(spec)
- @specification = spec
+ @_remote_specification = spec
end
private
def _remote_specification
- @specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
+ @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
end
def method_missing(method, *args, &blk)