diff options
author | Chris Doherty <cdoherty@chef.io> | 2016-02-29 12:37:24 -0800 |
---|---|---|
committer | Chris Doherty <cdoherty@chef.io> | 2016-03-17 14:56:02 -0700 |
commit | 81276da7a221ca1a935b069608580839e94b7154 (patch) | |
tree | 446afd35fb51bfc959c0825f3ea41f5e5776313d /chef-config/lib/chef-config/config.rb | |
parent | fda49f6f8133fbb6f389f1def8e0aad4856614b7 (diff) | |
download | chef-81276da7a221ca1a935b069608580839e94b7154.tar.gz |
Rubocop.
Diffstat (limited to 'chef-config/lib/chef-config/config.rb')
-rw-r--r-- | chef-config/lib/chef-config/config.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index c3d330ef77..9da69a1867 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -856,14 +856,14 @@ module ChefConfig # 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? - if proxy_env_var.match(/^.*:\/\//) - URI.parse(proxy_env_var) - else - URI.parse("#{scheme}://#{proxy_env_var}") - end - end - - excludes = ENV['no_proxy'].to_s.split(/\s*,\s*/).compact + if proxy_env_var =~ /^.*:\/\// + URI.parse(proxy_env_var) + else + URI.parse("#{scheme}://#{proxy_env_var}") + end + end + + excludes = ENV["no_proxy"].to_s.split(/\s*,\s*/).compact excludes = excludes.map { |exclude| exclude =~ /:\d+$/ ? exclude : "#{exclude}:*" } return proxy unless excludes.any? { |exclude| File.fnmatch(exclude, "#{host}:#{port}") } end |