diff options
author | chrismo <chrismo@clabs.org> | 2016-06-27 22:30:48 -0500 |
---|---|---|
committer | chrismo <chrismo@clabs.org> | 2016-07-08 19:35:57 -0500 |
commit | 9022339885e76c07b015d64258c0a20b0602c141 (patch) | |
tree | 5ac5edd9d97d6d1e306954c7d07fe83f0f49df8d /lib/bundler | |
parent | f16f1292a785aac799d46012486d6e715906e43b (diff) | |
download | bundler-9022339885e76c07b015d64258c0a20b0602c141.tar.gz |
Raise message on multiple options
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli/update.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index 002544ee..1c35659e 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 |