diff options
author | Tim Moore <tmoore@incrementalism.net> | 2015-03-14 15:34:48 +1100 |
---|---|---|
committer | Tim Moore <tmoore@incrementalism.net> | 2015-03-14 15:34:48 +1100 |
commit | 38f6b319bfb189b8f4e591cb5513099602934350 (patch) | |
tree | baed9d92a50872d79da485ec53c63f60eb2908dd | |
parent | ebb0dae97855459f19967d0c9e3446460785bd12 (diff) | |
download | bundler-38f6b319bfb189b8f4e591cb5513099602934350.tar.gz |
Rename Specification#source_uri to remote.
-rw-r--r-- | lib/bundler/endpoint_specification.rb | 2 | ||||
-rw-r--r-- | lib/bundler/fetcher.rb | 2 | ||||
-rw-r--r-- | lib/bundler/lazy_specification.rb | 2 | ||||
-rw-r--r-- | lib/bundler/remote_specification.rb | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 14 | ||||
-rw-r--r-- | spec/bundler/cli_spec.rb | 2 |
7 files changed, 12 insertions, 14 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb index 71d5e115fc..31365e5b42 100644 --- a/lib/bundler/endpoint_specification.rb +++ b/lib/bundler/endpoint_specification.rb @@ -4,7 +4,7 @@ module Bundler include MatchPlatform attr_reader :name, :version, :platform, :dependencies - attr_accessor :source, :source_uri + attr_accessor :source, :remote def initialize(name, version, platform, dependencies) @name = name diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index fcfd921851..1610cea879 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -195,7 +195,7 @@ module Bundler spec = RemoteSpecification.new(name, version, platform, self) end spec.source = source - spec.source_uri = @remote + spec.remote = @remote index << spec end diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index bdcf2df2cc..16f46b8580 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -7,7 +7,7 @@ module Bundler include MatchPlatform attr_reader :name, :version, :dependencies, :platform - attr_accessor :source, :source_uri + attr_accessor :source, :remote def initialize(name, version, platform, source = nil) @name = name diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index d08bd9d3d8..c80eaa40fc 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -10,7 +10,7 @@ module Bundler include MatchPlatform attr_reader :name, :version, :platform - attr_accessor :source, :source_uri + attr_accessor :source, :remote def initialize(name, version, platform, spec_fetcher) @name = name diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 1a9acb54ac..bf1b3cb35a 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -13,7 +13,7 @@ module Gem @loaded_stacks = Hash.new { |h,k| h[k] = [] } class Specification - attr_accessor :source_uri, :location, :relative_loaded_from + attr_accessor :remote, :location, :relative_loaded_from remove_method :source if instance_methods(false).include?(:source) attr_accessor :source diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index ea200f7854..81b6954f1b 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -86,10 +86,10 @@ module Bundler # Download the gem to get the spec, because some specs that are returned # by rubygems.org are broken and wrong. - if spec.source_uri + if spec.remote # Check for this spec from other sources - uris = [spec.source_uri.anonymized_uri] - uris += source_uris_for_spec(spec) + uris = [spec.remote.anonymized_uri] + uris += remotes_for_spec(spec).map { |remote| remote.anonymized_uri } uris.uniq! Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1 @@ -202,9 +202,9 @@ module Bundler protected - def source_uris_for_spec(spec) + def remotes_for_spec(spec) specs.search_all(spec.name).inject([]) do |uris, s| - uris << s.source_uri.anonymized_uri if s.source_uri + uris << s.remote if s.remote uris end end @@ -360,8 +360,8 @@ module Bundler end def fetch_gem(spec) - return false unless spec.source_uri - Fetcher.download_gem_from_uri(spec, spec.source_uri.uri) + return false unless spec.remote + Fetcher.download_gem_from_uri(spec, spec.remote.uri) end def builtin_gem?(spec) diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index 7917726efe..2ebe69d26b 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -2,8 +2,6 @@ require 'spec_helper' require 'bundler/cli' describe "bundle executable" do - let(:source_uri) { "http://localgemserver.test" } - it "returns non-zero exit status when passed unrecognized options" do bundle '--invalid_argument' expect(exitstatus).to_not be_zero if exitstatus |