summaryrefslogtreecommitdiff
path: root/lib/chef/win32
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-23 10:45:15 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-23 10:45:15 -0800
commit271d3e4f91e3d158c9112512ac75d0ca51fc928d (patch)
tree5beb5e5588db43ecac46f38725cabf5e573fd1d6 /lib/chef/win32
parentaa7e0e05395823c66b30f1a810d1720aea3b6d72 (diff)
downloadchef-271d3e4f91e3d158c9112512ac75d0ca51fc928d.tar.gz
Autofixing new Perf cops in 0.37.2
6 Performance/Casecmp 18 Performance/Detect 1 Performance/RangeInclude 27 Performance/RedundantBlockCall 6 Performance/RedundantMatch 5 Performance/RedundantMerge 18 Performance/StringReplacement
Diffstat (limited to 'lib/chef/win32')
-rw-r--r--lib/chef/win32/api/file.rb6
-rw-r--r--lib/chef/win32/version.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb
index 52ac4868c7..09501e66ce 100644
--- a/lib/chef/win32/api/file.rb
+++ b/lib/chef/win32/api/file.rb
@@ -550,7 +550,7 @@ BOOL WINAPI VerQueryValue(
if handle == INVALID_HANDLE_VALUE
Chef::ReservedNames::Win32::Error.raise!
end
- block.call(handle, find_data)
+ yield(handle, find_data)
ensure
FindClose(handle) if handle && handle != INVALID_HANDLE_VALUE
end
@@ -568,7 +568,7 @@ BOOL WINAPI VerQueryValue(
if handle == INVALID_HANDLE_VALUE
Chef::ReservedNames::Win32::Error.raise!
end
- block.call(handle)
+ yield(handle)
ensure
CloseHandle(handle) if handle && handle != INVALID_HANDLE_VALUE
end
@@ -583,7 +583,7 @@ BOOL WINAPI VerQueryValue(
if handle == INVALID_HANDLE_VALUE
Chef::ReservedNames::Win32::Error.raise!
end
- block.call(handle)
+ yield(handle)
ensure
CloseHandle(handle) if handle && handle != INVALID_HANDLE_VALUE
end
diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb
index 85a2744645..303fe1531d 100644
--- a/lib/chef/win32/version.rb
+++ b/lib/chef/win32/version.rb
@@ -41,7 +41,7 @@ class Chef
private_class_method :get_system_metrics
def self.method_name_from_marketing_name(marketing_name)
- "#{marketing_name.gsub(/\s/, '_').gsub(/\./, '_').downcase}?"
+ "#{marketing_name.gsub(/\s/, '_').tr('.', '_').downcase}?"
# "#{marketing_name.gsub(/\s/, '_').gsub(//, '_').downcase}?"
end