Sha256: cb69552b3d43f25c31fe140bb0d971350d1929598af83e660f9bd56db53ef160
Contents?: true
Size: 1.68 KB
Versions: 1
Compression:
Stored size: 1.68 KB
Contents
require 'win32/registry' class WIN32OLE_TYPELIB attr_reader :typelib attr_reader :name alias :to_s :name def initialize(*args) # TODO: Make this work internally and externally API w/ regards to inargs if args.length == 2 @typelib, @name = *args puts "NO TYPELIB! for #{@name} #{@version}" unless @typelib elsif args.length == 1 @name = args[0] @typelib = search_registry(@name) # TODO: Missing search_registry2 # puts "NAME IS #{@name}///#{@typelib}" end end def guid @typelib.guid end def minor_version @typelib.minor_version end def major_version @typelib.major_version end def ole_classes # MRI: ole_types_from_typelib ole_classes = [] find_all_typeinfo(@typelib) do |info, docs| ole_classes << WIN32OLE_TYPE.new(self, info, docs) end ole_classes end def version [minor_version, major_version].join('.') end def visible? flags = @typelib.flags flags != 0 && (flags & TypeLib::LIBFLAG_FRESTRICTED) == 0 && (flags & TypeLib::LIBFLAG_FHIDDEN) == 0 end def inspect name end class << self def ole_classes(typelib) new(typelib).ole_classes end def typelibs typelibs = [] typelib_registry_each_guid_version do |guid, version, reg| name = reg.read(nil)[1] || '' registry_subkey(reg, 'win32', 'win64') do |arch_reg, arch| type_lib = load_typelib(arch_reg, arch) # TODO: I think MRI figures out a few more typelibs than we do typelibs << WIN32OLE_TYPELIB.new(type_lib, name) if type_lib end end typelibs end include WIN32OLE::Utils end include WIN32OLE::Utils end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jruby-win32ole-0.8.0 | lib/win32ole/win32ole_typelib.rb |