summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-02-28 06:07:38 +0000
committerSamuel Giddins <segiddins@segiddins.me>2017-03-03 17:37:20 -0600
commit46118727a10df8c705173011159ac6715c93d710 (patch)
tree826184780bf422b0d43922338cb822779ada7f2d
parent6ce53a58e1b2c6ecbb70bc8cbb150ff59a9f603e (diff)
downloadbundler-46118727a10df8c705173011159ac6715c93d710.tar.gz
Auto merge of #5483 - denniss:5430-fix-bundle-outdated-local, r=segiddins
Fix bundle outdated --local. It's supposed to use local cache to deteā€¦ Fixes https://github.com/bundler/bundler/issues/5430 (cherry picked from commit 0b25fae2c564ec61ef0e59b2f17b91f2fe6b55a2)
-rw-r--r--lib/bundler/cli/outdated.rb3
-rw-r--r--spec/commands/outdated_spec.rb15
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 27d607d6d5..93e50b10b6 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -49,8 +49,7 @@ module Bundler
%w(filter-major filter-minor filter-patch)
definition_resolution = proc do
- return definition.resolve_with_cache! if options[:local]
- definition.resolve_remotely!
+ options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
end
if options[:parseable]
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index e335ee9144..11a6b6cdd5 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -187,6 +187,21 @@ describe "bundle outdated" do
end
describe "with --local option" do
+ it "uses local cache to return a list of outdated gems" do
+ update_repo2 do
+ build_gem "activesupport", "2.3.4"
+ end
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "activesupport", "2.3.4"
+ G
+
+ bundle "outdated --local"
+
+ expect(out).to include("activesupport (newest 2.3.5, installed 2.3.4, requested = 2.3.4)")
+ end
+
it "doesn't hit repo2" do
FileUtils.rm_rf(gem_repo2)