Class: CoderCompanion::LanguageParser
- Inherits:
-
Object
- Object
- CoderCompanion::LanguageParser
- Defined in:
- lib/codercompanion/language_parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
- #tree_walker ⇒ TreeWalker readonly
Instance Method Summary collapse
-
#create_project_json(dir_name) ⇒ Hash
Parses and creates the json that will be uploaded.
-
#parse(files) ⇒ Object
Parse the files.
Instance Attribute Details
#tree_walker ⇒ TreeWalker (readonly)
5 6 7 |
# File 'lib/codercompanion/language_parser.rb', line 5 def tree_walker @tree_walker end |
Instance Method Details
#create_project_json(dir_name) ⇒ Hash
Parses and creates the json that will be uploaded
10 11 12 13 14 15 16 |
# File 'lib/codercompanion/language_parser.rb', line 10 def create_project_json(dir_name) files = get_parseable_files(dir_name) CoderCompanion::j_print CoderCompanion::notification_format("Parsing files...") results = parse(files) CoderCompanion::j_print CoderCompanion::success_format("\nSuccessfully parsed source code") tree_walker.create_uploadable(results) end |
#parse(files) ⇒ Object
Parse the files
20 21 22 |
# File 'lib/codercompanion/language_parser.rb', line 20 def parse(files) raise NotImplementedError, "#{self.class}: 'parse' must be overridden" end |