summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Moore <tmoore@incrementalism.net>2015-03-02 19:12:48 +1100
committerTim Moore <tmoore@incrementalism.net>2015-03-02 19:12:48 +1100
commit7091db9fe4894a2d64a6eb4c8b71002117c5412f (patch)
tree8336da6e7c20f8367be4a0c2d5566df0a5ae87f2
parent56de835671a07fc517926d437aabb2b1cd8da52c (diff)
downloadbundler-7091db9fe4894a2d64a6eb4c8b71002117c5412f.tar.gz
Revert "LocalRubygems source for local gem specs"
This reverts commit 9263e08636d25e2573776b17416e6fabd403026b.
-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