diff options
author | Claire McQuin <claire@chef.io> | 2015-09-01 15:27:48 -0700 |
---|---|---|
committer | Claire McQuin <claire@chef.io> | 2015-09-03 11:18:22 -0700 |
commit | 55a6507b98b69652d9b5c74f4209c6472e356834 (patch) | |
tree | b35cc82a0b5f5ff6488980197c910f7b2b6d1119 /lib/chef/monkey_patches/win32 | |
parent | 8143bf6010cfcef180a8bc85a5e71dc3eb1a8f81 (diff) | |
download | chef-55a6507b98b69652d9b5c74f4209c6472e356834.tar.gz |
Monkey-patch Win32::Registry::API::DeleteValue for Win32::Registry#delete_value.
Diffstat (limited to 'lib/chef/monkey_patches/win32')
-rw-r--r-- | lib/chef/monkey_patches/win32/registry.rb | 23 |
1 files changed, 23 insertions, 0 deletions
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 |