summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2012-07-17 04:25:03 -0500
committerTerence Lee <hone02@gmail.com>2012-07-17 04:25:03 -0500
commit8df2ae5f622228c05742c6de17cac899fcd3a7d7 (patch)
tree0a0c3e30739243eec101618f5ebf48cad4e6b8d7
parent7821adb2387622f00aa9e672447ef6c536dfce37 (diff)
downloadbundler-8df2ae5f622228c05742c6de17cac899fcd3a7d7.tar.gz
don't display warning if Bundler.settings[:cache_all] is set
-rw-r--r--lib/bundler/cli.rb6
-rw-r--r--spec/cache/git_spec.rb14
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 0c72cb0447..1dd75d6345 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -662,9 +662,9 @@ module Bundler
private
def setup_cache_all
- if options.key?("all")
- Bundler.settings[:cache_all] = options[:all]
- elsif Bundler.definition.sources.any? { |s| !s.is_a?(Source::Rubygems) }
+ Bundler.settings[:cache_all] = options[:all] if options.key?("all")
+
+ if Bundler.definition.sources.any? { |s| !s.is_a?(Source::Rubygems) } && !Bundler.settings[:cache_all]
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
"to package them as well, please pass the --all flag. This will be the default " \
"on Bundler 2.0."
diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb
index 0333e81b6a..71400f45a4 100644
--- a/spec/cache/git_spec.rb
+++ b/spec/cache/git_spec.rb
@@ -153,5 +153,19 @@ end
out.should include("Your Gemfile contains path and git dependencies.")
end
+
+ it "does not display warning message if cache_all is set in bundle config" do
+ git = build_git "foo"
+ ref = git.ref_for("master", 11)
+
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
+
+ bundle "#{cmd} --all"
+ bundle "#{cmd}"
+
+ out.should_not include("Your Gemfile contains path and git dependencies.")
+ end
end
end \ No newline at end of file