diff options
author | Tim Smith <tsmith@chef.io> | 2018-07-30 09:08:27 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-07-30 09:08:27 -0700 |
commit | 8f2697818cb5be0519244d2595c201080c4add6f (patch) | |
tree | bebf4f20663421a54b9be65eea5135eaa5cc9b65 | |
parent | fed3c958677504b01f3c95a108b7ab36d6fa8005 (diff) | |
download | mixlib-cli-8f2697818cb5be0519244d2595c201080c4add6f.tar.gz |
Chefstyle fixes
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/mixlib/cli.rb | 10 | ||||
-rw-r--r-- | lib/mixlib/cli/version.rb | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/mixlib/cli.rb b/lib/mixlib/cli.rb index e097649..0516926 100644 --- a/lib/mixlib/cli.rb +++ b/lib/mixlib/cli.rb @@ -210,7 +210,7 @@ module Mixlib config_opts[:exit] ||= nil config_opts[:in] ||= nil - if config_opts.has_key?(:default) + if config_opts.key?(:default) defaults_container[config_key] = config_opts[:default] end end @@ -231,7 +231,7 @@ module Mixlib # Deal with any required values options.each do |opt_key, opt_value| - if opt_value[:required] && !config.has_key?(opt_key) + if opt_value[:required] && !config.key?(opt_key) reqarg = opt_value[:short] || opt_value[:long] puts "You must supply #{reqarg}!" puts @opt_parser @@ -308,9 +308,9 @@ module Mixlib def build_option_arguments(opt_setting) arguments = Array.new - arguments << opt_setting[:short] if opt_setting.has_key?(:short) - arguments << opt_setting[:long] if opt_setting.has_key?(:long) - if opt_setting.has_key?(:description) + arguments << opt_setting[:short] if opt_setting.key?(:short) + arguments << opt_setting[:long] if opt_setting.key?(:long) + if opt_setting.key?(:description) description = opt_setting[:description].dup description << " (required)" if opt_setting[:required] description << " (included in ['#{opt_setting[:in].join("', '")}'])" if opt_setting[:in] diff --git a/lib/mixlib/cli/version.rb b/lib/mixlib/cli/version.rb index 174bf41..1a662de 100644 --- a/lib/mixlib/cli/version.rb +++ b/lib/mixlib/cli/version.rb @@ -1,5 +1,5 @@ module Mixlib module CLI - VERSION = "1.7.2" + VERSION = "1.7.2".freeze end end |