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

info

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

2015-06-12 12:38:33
_dump

_dump(depth) Instance Public methods marshalling is not allowed

2015-06-12 11:49:16
each_value

each_value() Instance Public methods Enumerate values.

2015-06-12 12:27:29
open 2

open(subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED, &blk) Instance Public methods

2015-06-12 12:54:18
read_bin

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

2015-06-12 13:01:23
read_i

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

2015-06-12 13:07:31
write_s

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

2015-06-12 13:32:45
read_s_expand

read_s_expand(name) Instance Public methods Read a REG_SZ or REG_EXPAND_SZ registry

2015-06-12 13:18:11
read

read(name, *rtype) Instance Public methods Read a registry value named name

2015-06-12 12:59:26
inspect

inspect() Instance Public methods

2015-06-12 12:40:12