diff options
| author | Samuel Giddins <segiddins@segiddins.me> | 2017-08-28 09:48:10 -0500 |
|---|---|---|
| committer | Samuel Giddins <segiddins@segiddins.me> | 2017-08-28 09:48:18 -0500 |
| commit | 6101d6276bceb8bf0f687a3fdb5cbae3847e8598 (patch) | |
| tree | 112988ed94722486eeb4d8520b74cf89b2a96363 /lib | |
| parent | 616394788ededa17409ec893d8befe9f683b54fb (diff) | |
| download | bundler-6101d6276bceb8bf0f687a3fdb5cbae3847e8598.tar.gz | |
Completely remove the package --all option on 2.0 and force its behaviorseg-bundler-2-defaults
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/cli.rb | 12 | ||||
| -rw-r--r-- | lib/bundler/cli/cache.rb | 2 | ||||
| -rw-r--r-- | lib/bundler/cli/package.rb | 6 | ||||
| -rw-r--r-- | lib/bundler/feature_flag.rb | 1 | ||||
| -rw-r--r-- | lib/bundler/source/git.rb | 2 | ||||
| -rw-r--r-- | lib/bundler/source/path.rb | 2 |
6 files changed, 16 insertions, 9 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 954e19b530..69bb5f0ac3 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -348,8 +348,10 @@ module Bundler map %w[cache] => :package else desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true - method_option "all", :type => :boolean, :default => Bundler.feature_flag.cache_command_is_package? || nil, - :banner => "Include all sources (including path and git)." + unless Bundler.feature_flag.cache_command_is_package? + method_option "all", :type => :boolean, + :banner => "Include all sources (including path and git)." + end method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one" method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache." def cache @@ -359,8 +361,10 @@ module Bundler end desc "#{Bundler.feature_flag.cache_command_is_package? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache" - method_option "all", :type => :boolean, :default => Bundler.feature_flag.cache_command_is_package? || nil, - :banner => "Include all sources (including path and git)." + unless Bundler.feature_flag.cache_command_is_package? + method_option "all", :type => :boolean, + :banner => "Include all sources (including path and git)." + end method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one" method_option "cache-path", :type => :string, :banner => "Specify a different cache path than the default (vendor/cache)." diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb index 77e049e7a2..9d2ba87d34 100644 --- a/lib/bundler/cli/cache.rb +++ b/lib/bundler/cli/cache.rb @@ -26,7 +26,7 @@ module Bundler def setup_cache_all Bundler.settings.set_command_option_if_given :cache_all, options[:all] - if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all] + if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.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/lib/bundler/cli/package.rb b/lib/bundler/cli/package.rb index cda41ea623..2dcd0e1e29 100644 --- a/lib/bundler/cli/package.rb +++ b/lib/bundler/cli/package.rb @@ -35,9 +35,11 @@ module Bundler end def setup_cache_all - Bundler.settings.set_command_option_if_given :cache_all, options[:all] + all = options.fetch(:all, Bundler.feature_flag.cache_command_is_package? || nil) - if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all] + Bundler.settings.set_command_option_if_given :cache_all, all + + if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.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/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index 07d11418be..05f28059d7 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -29,6 +29,7 @@ module Bundler settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? } settings_flag(:allow_offline_install) { bundler_2_mode? } + settings_flag(:cache_all) { bundler_2_mode? } settings_flag(:cache_command_is_package) { bundler_2_mode? } settings_flag(:console_command) { !bundler_2_mode? } settings_flag(:deployment_means_frozen) { bundler_2_mode? } diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index c66cbb17fb..97bc1724a0 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -187,7 +187,7 @@ module Bundler def cache(spec, custom_path = nil) app_cache_path = app_cache_path(custom_path) - return unless Bundler.settings[:cache_all] + return unless Bundler.feature_flag.cache_all? return if path == app_cache_path cached! FileUtils.rm_rf(app_cache_path) diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index afd8723168..ed734bf549 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -84,7 +84,7 @@ module Bundler def cache(spec, custom_path = nil) app_cache_path = app_cache_path(custom_path) - return unless Bundler.settings[:cache_all] + return unless Bundler.feature_flag.cache_all? return if expand(@original_path).to_s.index(root_path.to_s + "/") == 0 unless @original_path.exist? |
