summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Arko <mail@arko.net>2015-03-02 10:15:22 -0800
committerAndré Arko <mail@arko.net>2015-03-02 10:15:22 -0800
commitfb2b5999460d7337e90d98db0e402c5a6fc7521f (patch)
tree246d53107489e5b58fca0dfd2647036e7c2ca91a
parent2ba724275f795d557b4a493f4adbb3a9e4ea2dca (diff)
parent7091db9fe4894a2d64a6eb4c8b71002117c5412f (diff)
downloadbundler-fb2b5999460d7337e90d98db0e402c5a6fc7521f.tar.gz
Merge pull request #3450 from TimMoore/revert-local-rubygems
Revert "LocalRubygems source for local gem specs"
-rw-r--r--lib/bundler/lockfile_parser.rb2
-rw-r--r--lib/bundler/source.rb7
-rw-r--r--lib/bundler/source/local_rubygems.rb16
-rw-r--r--lib/bundler/source/rubygems.rb13
-rw-r--r--lib/bundler/source_list.rb5
-rw-r--r--spec/bundler/source_list_spec.rb2
6 files changed, 17 insertions, 28 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 1ced10ac33..7030508988 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -29,7 +29,7 @@ module Bundler
@state = :source
@specs = {}
- @rubygems_aggregate = Source::LocalRubygems.new
+ @rubygems_aggregate = Source::Rubygems.new
if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
raise LockfileError, "Your Gemfile.lock contains merge conflicts.\n" \
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index ace319d613..d1fd35a31e 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -1,9 +1,8 @@
module Bundler
class Source
- autoload :Rubygems, 'bundler/source/rubygems'
- autoload :LocalRubygems, 'bundler/source/local_rubygems'
- autoload :Path, 'bundler/source/path'
- autoload :Git, 'bundler/source/git'
+ autoload :Rubygems, 'bundler/source/rubygems'
+ autoload :Path, 'bundler/source/path'
+ autoload :Git, 'bundler/source/git'
def self.mirror_for(uri)
uri = URI(uri.to_s) unless uri.is_a?(URI)
diff --git a/lib/bundler/source/local_rubygems.rb b/lib/bundler/source/local_rubygems.rb
deleted file mode 100644
index 40f072f387..0000000000
--- a/lib/bundler/source/local_rubygems.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-module Bundler
- class Source
- class LocalRubygems < Rubygems
-
- def specs
- @specs ||= begin
- idx = super
- idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
- idx.use(installed_specs, :override_dupes)
- idx
- end
- end
-
- end
- end
-end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 9aa7019e4c..ddbf4b90bf 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -68,10 +68,15 @@ module Bundler
alias_method :name, :to_s
def specs
- # remote_specs usually generates a way larger Index than the other
- # sources, and large_idx.use small_idx is way faster than
- # small_idx.use large_idx.
- @specs ||= @allow_remote ? remote_specs.dup : Index.new
+ @specs ||= begin
+ # remote_specs usually generates a way larger Index than the other
+ # sources, and large_idx.use small_idx is way faster than
+ # small_idx.use large_idx.
+ idx = @allow_remote ? remote_specs.dup : Index.new
+ idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
+ idx.use(installed_specs, :override_dupes)
+ idx
+ end
end
def install(spec)
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index 4329749e5a..49efbf7a8e 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -6,7 +6,7 @@ module Bundler
def initialize
@path_sources = []
@git_sources = []
- @rubygems_aggregate = Source::LocalRubygems.new
+ @rubygems_aggregate = Source::Rubygems.new
@rubygems_sources = []
end
@@ -57,7 +57,8 @@ module Bundler
end
end
- replacement_rubygems = replacement_sources.detect { |s| s.is_a?(Source::LocalRubygems) }
+ replacement_rubygems =
+ replacement_sources.detect { |s| s.is_a?(Source::Rubygems) }
@rubygems_aggregate = replacement_rubygems if replacement_rubygems
# Return true if there were changes
diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb
index b3e188636d..f5a8575ae8 100644
--- a/spec/bundler/source_list_spec.rb
+++ b/spec/bundler/source_list_spec.rb
@@ -91,7 +91,7 @@ describe Bundler::SourceList do
end
it "returns the aggregate rubygems source" do
- expect(@returned_source).to be_instance_of(Bundler::Source::LocalRubygems)
+ expect(@returned_source).to be_instance_of(Bundler::Source::Rubygems)
end
it "adds the provided remote to the beginning of the aggregate source" do