Class: Inch::Language::Ruby::Provider::YARD::Parser
- Inherits:
-
Object
- Object
- Inch::Language::Ruby::Provider::YARD::Parser
- 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
-
.parse(*args) ⇒ CodeObject::Provider::YARD::Parser
Helper method to parse an instance with the given
args
.
Instance Method Summary collapse
Class Method Details
.parse(*args) ⇒ CodeObject::Provider::YARD::Parser
Helper method to parse an instance with the given args
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
#objects ⇒ Array<YARD::Object::Base>
34 35 36 37 38 |
# File 'lib/inch/language/ruby/provider/yard/parser.rb', line 34 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.
23 24 25 26 27 28 29 30 31 |
# File 'lib/inch/language/ruby/provider/yard/parser.rb', line 23 def parse(dir, config) raise "Directory does not exist: #{dir}" if !File.exist?(dir) Dir.chdir(dir) do parse_yard_objects(config.included_files, config.excluded_files, config.read_dump_file) inject_base_dir(dir) end end |