diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-03 13:11:13 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 12:41:04 -0700 |
commit | 9802d7c075c8b7dae42dbcecd92d492f7fa128ac (patch) | |
tree | 0d13de92dc631081f9bcdaddedd6294051e3423b /chef-config | |
parent | 4978a9a8a402477f3b35f43404701d6a5cf26fa1 (diff) | |
download | chef-9802d7c075c8b7dae42dbcecd92d492f7fa128ac.tar.gz |
Style/NegatedIf
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'chef-config')
-rw-r--r-- | chef-config/lib/chef-config/config.rb | 2 | ||||
-rw-r--r-- | chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb | 2 | ||||
-rw-r--r-- | chef-config/spec/unit/config_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index 2348f0677f..88ce6216c4 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -1073,7 +1073,7 @@ module ChefConfig # Check if the proxy string contains a scheme. If not, add the url's scheme to the # proxy before parsing. The regex /^.*:\/\// matches, for example, http://. Reusing proxy # here since we are really just trying to get the string built correctly. - proxy = if !proxy_env_var.empty? + proxy = unless proxy_env_var.empty? if proxy_env_var =~ /^.*:\/\// URI.parse(proxy_env_var) else diff --git a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb index ca1bdb4c0b..b7a8a178ea 100644 --- a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb +++ b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb @@ -32,7 +32,7 @@ module ChefConfig def fuzzy_hostname_match?(hostname, match) # Do greedy matching by adding wildcard if it is not specified - match = "*" + match if !match.start_with?("*") + match = "*" + match unless match.start_with?("*") Fuzzyurl.matches?(Fuzzyurl.mask(hostname: match), hostname) end diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb index 378cc4a4a1..ed52c5606e 100644 --- a/chef-config/spec/unit/config_spec.rb +++ b/chef-config/spec/unit/config_spec.rb @@ -618,7 +618,7 @@ RSpec.describe ChefConfig::Config do # On Windows, we'll detect an omnibus build and set this to the # cacert.pem included in the package, but it's nil if you're on Windows # w/o omnibus (e.g., doing development on Windows, custom build, etc.) - if !is_windows + unless is_windows it "ChefConfig::Config[:ssl_ca_file] defaults to nil" do expect(ChefConfig::Config[:ssl_ca_file]).to be_nil end |