From d68d94d61694d5a4ca5d43e118fa474e5c0b0baa Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 15 Jul 2019 22:52:30 -0700 Subject: [PATCH] Cookstyle fixes Signed-off-by: Tim Smith --- lib/rubocop/cop/chef/insecure_cookbook_url.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rubocop/cop/chef/insecure_cookbook_url.rb b/lib/rubocop/cop/chef/insecure_cookbook_url.rb index e5203a5d3..0a714e99e 100644 --- a/lib/rubocop/cop/chef/insecure_cookbook_url.rb +++ b/lib/rubocop/cop/chef/insecure_cookbook_url.rb @@ -28,7 +28,6 @@ module Chef # # # good - # source 'https://supermarket.chef.io' # class InsecureCookbookURL < Cop @@ -40,7 +39,7 @@ class InsecureCookbookURL < Cop def insecure_url?(url) # https://rubular.com/r/dS6L6bQZvwWxWq - url.match?(/http:\/\/(www.)*git(hub|lab)/) + url.match?(%r{http://(www.)*git(hub|lab)}) end def on_send(node) @@ -51,7 +50,7 @@ def on_send(node) def autocorrect(node) lambda do |corrector| - corrector.replace(node.loc.expression, node.source.gsub(/http:\/\/(www.)*/,'https://')) + corrector.replace(node.loc.expression, node.source.gsub(%r{http://(www.)*}, 'https://')) end end end