Bug #2751

Win32::Registry#inspect fails

Added by Roger Pack almost 2 years ago. Updated 10 months ago.

[ruby-core:28192]
Status:Closed Start date:02/17/2010
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
ruby -v:ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]

Description

>>  Win32::Registry::HKEY_LOCAL_MACHINE.create "Software\\classes\\#{name}\\shell\\open_with_redcar"
NoMethodError: undefined method `+' for :HKEY_LOCAL_MACHINE:Symbol
        from E:/installs/ruby191p376/lib/ruby/1.9.1/win32/registry.rb:590:in `name'
        from E:/installs/ruby191p376/lib/ruby/1.9.1/win32/registry.rb:596:in `inspect'
        from E:/installs/ruby191p376/bin/irb:12:in `<main>'

my attempted fix:

Index: ext/dl/win32/lib/win32/registry.rb
===================================================================
--- ext/dl/win32/lib/win32/registry.rb  (revision 26655)
+++ ext/dl/win32/lib/win32/registry.rb  (working copy)
@@ -473,7 +473,7 @@
       parent = self
       name = @keyname
       while parent = parent.parent
-        name = parent.keyname + '\\' + name
+        name = parent.keyname.to_s + '\\' + name
       end
       name
     end

Associated revisions

Revision 27418
Added by Usaku NAKAMURA almost 2 years ago

* ext/dl/win32/lib/win32/registry.rb (PredefinedKey#create): root key name should be a string. fixed [ruby-core:28192]

History

Updated by Usaku NAKAMURA almost 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
This issue was solved with changeset r27418.
Roger, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

Also available in: Atom PDF