Issue #6447 has been updated by jonforums (Jon Forums).


it's a value not a key, right?

>> puts RUBY_DESCRIPTION
ruby 1.9.3p211 (2012-05-12 revision 35630) [i386-mingw32]
=> nil
...
>> screen_reg['last_init_config_was'] = 3
=> 3
>> screen_reg['last_init_config_was']
=> 3
>> screen_reg.num_values
=> 1
>> screen_reg.num_keys
=> 0
>> screen_reg.each_key { |k| puts k }
=> 0
>> screen_reg.each_value { |v| puts v }
last_init_config_was
=> 1
>> screen_reg.each { |i| puts i }
last_init_config_was
=> 1
----------------------------------------
Bug #6447: Win32::Registry#keys always returns [] even if there are keys
https://bugs.ruby-lang.org/issues/6447#change-26686

Author: rogerdpack (Roger Pack)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: tcs-ruby 1.9.3p28 (2012-01-28, TCS patched 2012-01-30) [i386-mingw32]


ex:
require 'win32/registry'
@screen_reg = Win32::Registry::HKEY_CURRENT_USER.create "Software\\os_screen_capture"; @screen_reg['last_init_config_was'] = 3
>> @screen_reg.keys
=> []

also each_key doesn't do anything, as well.  The "each" method does work as expected however.  Sorry if this is a dupe.



-- 
http://bugs.ruby-lang.org/