aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-04-26 14:46:06 -0700
committerCarl Lerche <carllerche@mac.com>2010-04-26 14:46:06 -0700
commit3be9c937ba2a1cc3855be5372813ac30d63053a7 (patch)
tree434c0e715eba94ce02fb5952e3b8404dfadb0ae6 /lib/bundler
parenta6097c588b4e068d6968132b20d30fda50536b5c (diff)
downloadbundler-3be9c937ba2a1cc3855be5372813ac30d63053a7.tar.gz
Move the index builder onto the definition class
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/definition.rb14
-rw-r--r--lib/bundler/environment.rb10
-rw-r--r--lib/bundler/installer.rb6
3 files changed, 19 insertions, 11 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 6b2c4c16..63681886 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -32,6 +32,20 @@ module Bundler
end
end
+ def index
+ @index ||= Index.build do |idx|
+ sources.each do |s|
+ idx.use s.local_specs
+ end
+ end
+ end
+
+ def remote_index
+ @remote_index ||= Index.build do |idx|
+ sources.each { |source| idx.use source.specs }
+ end
+ end
+
def no_sources?
sources.length == 1 && sources.first.remotes.empty?
end
diff --git a/lib/bundler/environment.rb b/lib/bundler/environment.rb
index 22f958c1..e2e79ad3 100644
--- a/lib/bundler/environment.rb
+++ b/lib/bundler/environment.rb
@@ -10,11 +10,11 @@ module Bundler
end
def index
- @index ||= Index.build do |idx|
- sources.each do |s|
- idx.use s.local_specs
- end
- end
+ @definition.index
+ end
+
+ def remote_index
+ @definition.remote_index
end
def requested_specs
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index ab0b0dba..f40000a3 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -60,11 +60,5 @@ module Bundler
def ambiguous?(dep)
dep.requirement.requirements.any? { |op,_| op != '=' }
end
-
- def remote_index
- @remote_index ||= Index.build do |idx|
- sources.each { |source| idx.use source.specs }
- end
- end
end
end