def classmap
      return @classmap if @classmap
      # read SCHEMA and build class index to find .mof files quickly
      @classmap = Hash.new
      @includes = [ Pathname.new(".") ]
      SCHEMATA.each do |base, file|
        @includes << base
        allow_cim = (file =~ /^CIM_/) # allow CIM_ only for CIM_Schema.mof
        File.open(File.join(base, file)) do |f|
          f.each do |l|
            if l =~ /^\#pragma\sinclude\s?\(\"(([\w\/_]+)\.mof)\"\).*/
              # $1 Foo/Bar.mof
              # $2 Foo/Bar
              path = $1
              names = $2.split("/")
              name = names[1] || names[0]
              next unless name =~ /_/ # class name must have underscore (rules out 'qualifiers.mof')
#              puts "#{path}:#{name}"
              next if !allow_cim && name =~ /^CIM_/ # skip CIM_ mofs unless allowed
              if @classmap[name]
                raise "Dup #{name} : #{@classmap[name]}"
              else
                @classmap[name] = { :path => path }
              end
            end
          end
        end
      end
      STDERR.puts "Found MOFs for #{@classmap.size} classes" if Wbem.debug
      @classmap
    end
def classmap
      return @classmap if @classmap
      # read SCHEMA and build class index to find .mof files quickly
      @classmap = Hash.new
      @includes = [ Pathname.new(".") ]
      SCHEMATA.each do |base, file|
        @includes << base
        allow_cim = (file =~ /^CIM_/) # allow CIM_ only for CIM_Schema.mof
        File.open(File.join(base, file)) do |f|
          f.each do |l|
            if l =~ /^\#pragma\sinclude\s?\(\"(([\w\/_]+)\.mof)\"\).*/
              # $1 Foo/Bar.mof
              # $2 Foo/Bar
              path = $1
              names = $2.split("/")
              name = names[1] || names[0]
              next unless name =~ /_/ # class name must have underscore (rules out 'qualifiers.mof')
#              puts "#{path}:#{name}"
              next if !allow_cim && name =~ /^CIM_/ # skip CIM_ mofs unless allowed
              if @classmap[name]
                raise "Dup #{name} : #{@classmap[name]}"
              else
                @classmap[name] = { :path => path }
              end
            end
          end
        end
      end
      STDERR.puts "Found MOFs for #{@classmap.size} classes" if Wbem.debug
      @classmap
    end
classmap - generate map of classes and their .mof files