summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/inject.rb2
-rw-r--r--lib/bundler/cli/lock.rb2
-rw-r--r--lib/bundler/cli/show.rb4
-rw-r--r--lib/bundler/definition.rb14
-rw-r--r--lib/bundler/injector.rb2
-rw-r--r--lib/bundler/installer.rb4
-rw-r--r--lib/bundler/plugin/installer.rb2
7 files changed, 20 insertions, 10 deletions
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb
index 8093a85283..4838aba671 100644
--- a/lib/bundler/cli/inject.rb
+++ b/lib/bundler/cli/inject.rb
@@ -48,7 +48,7 @@ module Bundler
def last_version_number
definition = Bundler.definition(true)
- definition.resolve_remotely!
+ definition.remotely!
specs = definition.index[name].sort_by(&:version)
unless options[:pre]
specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
index 17e7521766..1787b34cf9 100644
--- a/lib/bundler/cli/lock.rb
+++ b/lib/bundler/cli/lock.rb
@@ -61,7 +61,7 @@ module Bundler
raise InvalidOption, "Removing all platforms from the bundle is not allowed"
end
- definition.resolve_remotely! unless options[:local]
+ definition.remotely! unless options[:local]
if options["normalize-platforms"]
definition.normalize_platforms
diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb
index 59b0af42e1..1896a0b11c 100644
--- a/lib/bundler/cli/show.rb
+++ b/lib/bundler/cli/show.rb
@@ -59,9 +59,9 @@ module Bundler
definition = Bundler.definition(true)
if options[:outdated]
Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
- Bundler.ui.silence { definition.resolve_remotely! }
+ Bundler.ui.silence { definition.remotely! }
else
- definition.resolve_with_cache!
+ definition.with_cache!
end
Bundler.reset!
definition.specs
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index bf259d8ef5..405fb67ea4 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -177,15 +177,25 @@ module Bundler
end
def resolve_with_cache!
+ with_cache!
+
+ resolve
+ end
+
+ def with_cache!
sources.local!
sources.cached!
- resolve
end
def resolve_remotely!
+ remotely!
+
+ resolve
+ end
+
+ def remotely!
sources.cached!
sources.remote!
- resolve
end
def prefer_local!
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb
index 182b736c56..c0941e9909 100644
--- a/lib/bundler/injector.rb
+++ b/lib/bundler/injector.rb
@@ -41,7 +41,7 @@ module Bundler
# resolve to see if the new deps broke anything
@definition = builder.to_definition(lockfile_path, {})
- @definition.resolve_remotely!
+ @definition.remotely!
# since nothing broke, we can add those gems to the gemfile
append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @deps.any?
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 50f5c78f67..48dc14ebf4 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -228,10 +228,10 @@ module Bundler
if options[:local] || @definition.no_install_needed?
Bundler.settings.set_command_option(:jobs, 1) if @definition.no_install_needed? # to avoid the overhead of Bundler::Worker
- @definition.resolve_with_cache!
+ @definition.with_cache!
false
else
- @definition.resolve_remotely!
+ @definition.remotely!
true
end
end
diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb
index 4f60862bb4..ac3c3ea7f3 100644
--- a/lib/bundler/plugin/installer.rb
+++ b/lib/bundler/plugin/installer.rb
@@ -34,7 +34,7 @@ module Bundler
# @return [Hash] map of names to their specs they are installed with
def install_definition(definition)
def definition.lock(*); end
- definition.resolve_remotely!
+ definition.remotely!
specs = definition.specs
install_from_specs specs