Class: Inch::CodeObject::Provider::YARD::Parser
- Inherits:
-
Object
- Object
- Inch::CodeObject::Provider::YARD::Parser
- Defined in:
- lib/inch/code_object/provider/yard/parser.rb
Overview
Parses the source tree (using YARD)
Constant Summary collapse
- DEFAULT_PATHS =
["app/**/*.rb", "lib/**/*.rb"]
- DEFAULT_EXCLUDED =
[]
- IGNORE_TYPES =
[:macro]
Class Method Summary collapse
-
.parse(*args) ⇒ CodeObject::Provider::YARD
Helper method to parse an instance with the given
args.
Instance Method Summary collapse
Class Method Details
.parse(*args) ⇒ CodeObject::Provider::YARD
Helper method to parse an instance with the given args
16 17 18 19 20 |
# File 'lib/inch/code_object/provider/yard/parser.rb', line 16 def self.parse(*args) parser = self.new parser.parse(*args) parser end |
Instance Method Details
#objects ⇒ Object
30 31 32 33 34 |
# File 'lib/inch/code_object/provider/yard/parser.rb', line 30 def objects @objects ||= parsed_objects.map do |o| YARD::Object.for(o) unless IGNORE_TYPES.include?(o.type) end.compact end |
#parse(dir, paths, excluded) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/inch/code_object/provider/yard/parser.rb', line 22 def parse(dir, paths, excluded) old_dir = Dir.pwd Dir.chdir dir parse_yard_objects(paths, excluded) inject_base_dir(dir) Dir.chdir old_dir end |