Skip to content

Commit

Permalink
don't display warning if Bundler.settings[:cache_all] is set
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Jul 17, 2012
1 parent 7821adb commit 8df2ae5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/bundler/cli.rb
Expand Up @@ -662,9 +662,9 @@ def platform
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."
Expand Down
14 changes: 14 additions & 0 deletions spec/cache/git_spec.rb
Expand Up @@ -153,5 +153,19 @@

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

0 comments on commit 8df2ae5

Please sign in to comment.