Method: Cocoadex::Parser.parse

Defined in:
lib/cocoadex/parser.rb

.parse(docset_path) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/cocoadex/parser.rb', line 30

def self.parse docset_path
  plist = File.join(docset_path,"Contents", "Info.plist")
  if File.exist? plist
    docset = DocSet.new(plist)
    logger.info "Parsing docset tokens in #{docset.name}. This may take a moment..."

    files = Dir.glob(docset_path+"/**/*.html").select {|f| not ignored?(f) }

    if files.size > 0
      pbar  = ProgressBar.create(:title => "#{docset.platform} #{docset.version}",:total => files.size)
      files.each_with_index do |f,i|
        index_html(docset,f,i)
        pbar.increment
      end
      pbar.finish
    end

    logger.info "  Tokens Indexed: #{Tokenizer.tokens.size}"
    docset
  end
end