Class: Inch::Language::JavaScript::Provider::JSDoc::Parser
- Inherits:
-
Object
- Object
- Inch::Language::JavaScript::Provider::JSDoc::Parser
- Defined in:
- lib/inch/language/javascript/provider/jsdoc/parser.rb
Overview
Parses the source tree (using JSDoc)
Constant Summary collapse
- IGNORE_TYPES =
TODO: should we remove constant and namespace from this list?
%w(event external file interface member mixin package param constant namespace)
Instance Attribute Summary collapse
-
#parsed_objects ⇒ Object
readonly
Returns the value of attribute parsed_objects.
Class Method Summary collapse
-
.parse(*args) ⇒ CodeObject::Provider::JSDoc::Parser
Helper method to parse an instance with the given
args
.
Instance Method Summary collapse
Instance Attribute Details
#parsed_objects ⇒ Object (readonly)
Returns the value of attribute parsed_objects.
14 15 16 |
# File 'lib/inch/language/javascript/provider/jsdoc/parser.rb', line 14 def parsed_objects @parsed_objects end |
Class Method Details
.parse(*args) ⇒ CodeObject::Provider::JSDoc::Parser
Helper method to parse an instance with the given args
21 22 23 24 25 |
# File 'lib/inch/language/javascript/provider/jsdoc/parser.rb', line 21 def self.parse(*args) parser = new parser.parse(*args) parser end |
Instance Method Details
#objects ⇒ Array<YARD::Object::Base>
39 40 41 42 43 |
# File 'lib/inch/language/javascript/provider/jsdoc/parser.rb', line 39 def objects @objects ||= parsed_objects.map do |o| JSDoc::Object.for(o) unless IGNORE_TYPES.include?(o['kind']) end.compact.uniq end |
#parse(dir, config) ⇒ void
This method returns an undefined value.
30 31 32 33 34 35 36 |
# File 'lib/inch/language/javascript/provider/jsdoc/parser.rb', line 30 def parse(dir, config) raise "Directory does not exist: #{dir}" if !File.exist?(dir) Dir.chdir(dir) do parse_objects(config.included_files, config.excluded_files, config.read_dump_file) end end |