summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/update.rb
diff options
context:
space:
mode:
authorchrismo <chrismo@clabs.org>2016-06-27 22:30:48 -0500
committerchrismo <chrismo@clabs.org>2016-07-08 19:35:57 -0500
commit9022339885e76c07b015d64258c0a20b0602c141 (patch)
tree5ac5edd9d97d6d1e306954c7d07fe83f0f49df8d /lib/bundler/cli/update.rb
parentf16f1292a785aac799d46012486d6e715906e43b (diff)
downloadbundler-9022339885e76c07b015d64258c0a20b0602c141.tar.gz
Raise message on multiple options
Diffstat (limited to 'lib/bundler/cli/update.rb')
-rw-r--r--lib/bundler/cli/update.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb
index 002544ee60..1c35659e0b 100644
--- a/lib/bundler/cli/update.rb
+++ b/lib/bundler/cli/update.rb
@@ -39,9 +39,10 @@ module Bundler
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby])
end
- patch_level = [:major, :minor, :patch].detect {|v| options.keys.include?(v.to_s) }
+ patch_level = [:major, :minor, :patch].select {|v| options.keys.include?(v.to_s) }
+ raise ProductionError, "Provide only one of the following options: #{patch_level.join(", ")}" unless patch_level.length <= 1
Bundler.definition.gem_version_promoter.tap do |gvp|
- gvp.level = patch_level || :major
+ gvp.level = patch_level.first || :major
gvp.strict = options[:strict]
end