Type:
Class

Win32 Registry

win32/registry is registry accessor library for Win32 platform. It uses dl/import to call Win32 Registry APIs.

example

Win32::Registry::HKEY_CURRENT_USER.open('SOFTWARE\foo') do |reg|
  value = reg['foo']                               # read a value
  value = reg['foo', Win32::Registry::REG_SZ]      # read a value with type
  type, value = reg.read('foo')                    # read a value
  reg['foo'] = 'bar'                               # write a value
  reg['foo', Win32::Registry::REG_SZ] = 'bar'      # write a value with type
  reg.write('foo', Win32::Registry::REG_SZ, 'bar') # write a value

  reg.each_value { |name, type, data| ... }        # Enumerate values
  reg.each_key { |key, wtime| ... }                # Enumerate subkeys

  reg.delete_value(name)                         # Delete a value
  reg.delete_key(name)                           # Delete a subkey
  reg.delete_key(name, true)                     # Delete a subkey recursively
end

Reference

Win32::Registry class

Win32 Registry

win32/registry is registry accessor library for Win32 platform. It uses fiddle/import to call Win32 Registry APIs.

example

Win32::Registry::HKEY_CURRENT_USER.open('SOFTWARE\foo') do |reg|
  value = reg['foo']                               # read a value
  value = reg['foo', Win32::Registry::REG_SZ]      # read a value with type
  type, value = reg.read('foo')                    # read a value
  reg['foo'] = 'bar'                               # write a value
  reg['foo', Win32::Registry::REG_SZ] = 'bar'      # write a value with type
  reg.write('foo', Win32::Registry::REG_SZ, 'bar') # write a value

  reg.each_value { |name, type, data| ... }        # Enumerate values
  reg.each_key { |key, wtime| ... }                # Enumerate subkeys

  reg.delete_value(name)                         # Delete a value
  reg.delete_key(name)                           # Delete a subkey
  reg.delete_key(name, true)                     # Delete a subkey recursively
end

Reference

Win32::Registry class

created?

created?() Instance Public methods Returns if key is created ((newly))

2015-06-12 11:59:56
each_key

each_key() Instance Public methods Enumerate subkeys. subkey

2015-06-12 12:20:52
delete

delete(name) Instance Public methods Alias for:

2015-06-12 12:04:15
create

create(hkey, subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED) Class Public methods

2015-06-12 11:19:52
each

each() Instance Public methods Alias for:

2015-06-12 12:15:28
expand_environ

expand_environ(str) Class Public methods Replace %w+% into the environment value

2015-06-12 11:24:36
time2wtime

time2wtime(time) Class Public methods Convert

2015-06-12 11:29:37
open?

open?() Instance Public methods Returns if key is not closed.

2015-06-12 12:55:46
[]=

[]=(name, rtype, value = nil) Instance Public methods Write value to a registry

2015-06-12 11:46:37
write_i

write_i(name, value) Instance Public methods Write value to a registry value

2015-06-12 13:26:56