Class: Inch::Language::Ruby::Provider::YARD::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/inch/language/ruby/provider/yard/parser.rb

Overview

Parses the source tree (using YARD)

Constant Summary collapse

IGNORE_TYPES =
[:macro]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(*args) ⇒ CodeObject::Provider::YARD::Parser

Helper method to parse an instance with the given args

Returns:

  • (CodeObject::Provider::YARD::Parser)

    the instance that ran

See Also:



14
15
16
17
18
# File 'lib/inch/language/ruby/provider/yard/parser.rb', line 14

def self.parse(*args)
  parser = new
  parser.parse(*args)
  parser
end

Instance Method Details

#objectsArray<YARD::Object::Base>

Returns:



33
34
35
36
37
# File 'lib/inch/language/ruby/provider/yard/parser.rb', line 33

def objects
  @objects ||= parsed_objects.map do |o|
    YARD::Object.for(o) unless IGNORE_TYPES.include?(o.type)
  end.compact
end

#parse(dir, config) ⇒ void

This method returns an undefined value.

Parameters:



23
24
25
26
27
28
29
30
# File 'lib/inch/language/ruby/provider/yard/parser.rb', line 23

def parse(dir, config)
  Dir.chdir(dir) do
    parse_yard_objects(config.included_files,
                       config.excluded_files,
                       config.read_dump_file)
    inject_base_dir(dir)
  end
end