Browse files

Helperize resolve

  • Loading branch information...
1 parent 412239b commit e9cced05142e7acda4cffbb1e2cf569b47dd2d44 Carlhuda committed with indirect Mar 19, 2010
Showing with 8 additions and 13 deletions.
  1. +7 −3 lib/bundler/environment.rb
  2. +1 −10 lib/bundler/installer.rb
View
10 lib/bundler/environment.rb
@@ -40,17 +40,21 @@ def runtime_gems
end
end
- def resolve_locally
+ def resolve(type, index)
source_requirements = {}
actual_dependencies.each do |dep|
- next unless dep.source && dep.source.respond_to?(:local_specs)
- source_requirements[dep.name] = dep.source.local_specs
+ next unless dep.source && dep.source.respond_to?(type)
+ source_requirements[dep.name] = dep.source.send(type)
end
# Run a resolve against the locally available gems
Resolver.resolve(actual_dependencies, index, source_requirements)
end
+ def resolve_locally
+ resolve(:local_specs, index)
+ end
+
def resolve_remotely
raise NotImplementedError
end
View
11 lib/bundler/installer.rb
@@ -67,16 +67,7 @@ def resolve_locally
end
def resolve_remotely
- remote_index # trigger building the index
- Bundler.ui.info "Resolving dependencies"
- source_requirements = {}
- actual_dependencies.each do |dep|
- next unless dep.source
- source_requirements[dep.name] = dep.source.specs
- end
-
- specs = Resolver.resolve(actual_dependencies, remote_index, source_requirements)
- specs
+ resolve(:specs, remote_index)
end
def ambiguous?(dep)

0 comments on commit e9cced0

Please sign in to comment.