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

flush

flush() Instance Public methods Write all the attributes into the registry file

2015-06-12 12:32:51
read_s

read_s(name) Instance Public methods Read a REG_SZ(read_s), REG_DWORD(read_i)

2015-06-12 13:14:20
create 2

create(subkey, desired = KEY_ALL_ACCESS, opt = REG_OPTION_RESERVED, &blk) Instance Public methods

2015-06-12 11:53:25
delete_value

delete_value(name) Instance Public methods Delete a registry value named name

2015-06-12 12:13:07
close

close() Instance Public methods Close key. After

2015-06-12 11:51:48
keys

keys() Instance Public methods return keys as an array

2015-06-12 12:46:01
_dump

_dump(depth) Instance Public methods marshalling is not allowed

2015-06-12 11:49:16
info

info() Instance Public methods Returns key information as Array of: :num_keys

2015-06-12 12:38:33
name

name() Instance Public methods Full path of key such as 'HKEY_CURRENT_USERSOFTWAREfoobar'

2015-06-12 12:49:02
[]

[](name, *rtype) Instance Public methods Read a registry value named name and

2015-06-12 11:41:11