[Win32utils-devel] Win32 namespace

Gordon Thiesfeld gthiesfeld at gmail.com
Mon Jul 30 18:28:39 EDT 2007


> Hey, I like that.

Thanks.  All of my code is in svn on rubyforge if you're interested.

http://rubyforge.org/projects/ruby-wmi/

> I think this approach makes sense, i.e. WMI is part of Win32, and
> LogicalDisk is part of WMI.
>
> Mind you, I certainly don't own the Win32 namespace so you can do as you
> wish, but I think this is the best approach, as it puts your code
> effectively under the "Win32::WMI" namespace, which should eliminate any
> potential namespace conflicts.
>
> What do you think?

I think this is a good idea, but it won't work the way I've written
it.  I'm using const_missing to create WMI classes as needed.
Win32_LogicalDisk is a WMI class, and it doesn't exist in ruby until
you invoke #find on it.  It would have to be:

Win32::WMI::Win32_LogicalDisk

And that doesn't look right to me.  So, I think I'll stick with
WMI::class_name.  It's only a few extra bytes, after all.

Thanks for your time,

Gordon


More information about the win32utils-devel mailing list