diff options
author | Andre Arko <andre@arko.net> | 2014-08-15 22:23:50 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-08-16 11:26:48 -0700 |
commit | 37dc9b942b99f1ae9ff1877d10eaca8c2620adf0 (patch) | |
tree | feeb61a3ce59132753f3974a942c83596a21bc20 /lib/bundler | |
parent | af3bd954af94a0e9b89bc61558113de45ed43efc (diff) | |
download | bundler-37dc9b942b99f1ae9ff1877d10eaca8c2620adf0.tar.gz |
remove fetch_specs
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/source/rubygems.rb | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index add49795..7de946cb 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -66,7 +66,15 @@ module Bundler alias_method :name, :to_s def specs - @specs ||= fetch_specs + @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) @@ -209,20 +217,6 @@ module Bundler end end - def fetch_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. - if @allow_remote - idx = remote_specs.dup - else - idx = Index.new - end - idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote - idx.use(installed_specs, :override_dupes) - idx - end - def installed_specs @installed_specs ||= begin idx = Index.new |