diff options
Diffstat (limited to 'lib/bundler/remote_specification.rb')
-rw-r--r-- | lib/bundler/remote_specification.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index 89b69e1045..9d237f3fa0 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -6,6 +6,7 @@ module Bundler # be seeded with what we're given from the source's abbreviated index - the # full specification will only be fetched when necessary. class RemoteSpecification + include MatchRemoteMetadata include MatchPlatform include Comparable @@ -16,7 +17,8 @@ module Bundler def initialize(name, version, platform, spec_fetcher) @name = name @version = Gem::Version.create version - @platform = platform + @original_platform = platform || Gem::Platform::RUBY + @platform = Gem::Platform.new(platform) @spec_fetcher = spec_fetcher @dependencies = nil end @@ -28,10 +30,10 @@ module Bundler end def full_name - if platform == Gem::Platform::RUBY || platform.nil? + @full_name ||= if @platform == Gem::Platform::RUBY "#{@name}-#{@version}" else - "#{@name}-#{@version}-#{platform}" + "#{@name}-#{@version}-#{@platform}" end end @@ -86,6 +88,10 @@ module Bundler end end + def runtime_dependencies + dependencies.select(&:runtime?) + end + def git_version return unless loaded_from && source.is_a?(Bundler::Source::Git) " #{source.revision[0..6]}" @@ -98,9 +104,9 @@ module Bundler end def _remote_specification - @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform]) + @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @original_platform]) @_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \ - " missing from the server! Try installing with `--full-index` as a workaround.") + " missing from the server!") end def method_missing(method, *args, &blk) |