From 55a6507b98b69652d9b5c74f4209c6472e356834 Mon Sep 17 00:00:00 2001 From: Claire McQuin Date: Tue, 1 Sep 2015 15:27:48 -0700 Subject: Monkey-patch Win32::Registry::API::DeleteValue for Win32::Registry#delete_value. --- lib/chef/monkey_patches/win32/registry.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/chef/monkey_patches/win32/registry.rb (limited to 'lib/chef/monkey_patches/win32') diff --git a/lib/chef/monkey_patches/win32/registry.rb b/lib/chef/monkey_patches/win32/registry.rb new file mode 100644 index 0000000000..c7279ced92 --- /dev/null +++ b/lib/chef/monkey_patches/win32/registry.rb @@ -0,0 +1,23 @@ + +require 'chef/win32/api/registry' +require 'chef/win32/unicode' +require 'win32/registry' + +module Win32 + class Registry + module API + + extend Chef::ReservedNames::Win32::API::Registry + + module_function + + # ::Win32::Registry#delete_value is broken in Ruby 2.1 (up to Ruby 2.1.6p336). + # This should be resolved a later release (see note #9 in link below). + # https://bugs.ruby-lang.org/issues/10820 + def DeleteValue(hkey, name) + check RegDeleteValueW(hkey, name.to_wstring) + end + + end + end +end \ No newline at end of file -- cgit v1.2.1