Class: CoderCompanion::LanguageParser
- Inherits:
-
Object
- Object
- CoderCompanion::LanguageParser
- Defined in:
- lib/codercompanion/language_parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create_project_json(dir_name, excluded_files, cache_handler) ⇒ Hash
Parses and creates the json that will be uploaded.
-
#parse(files) ⇒ Object
Parse the files.
Instance Attribute Details
#excluded ⇒ Array<String>
8 9 10 |
# File 'lib/codercompanion/language_parser.rb', line 8 def excluded @excluded end |
#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, excluded_files, cache_handler) ⇒ Hash
Parses and creates the json that will be uploaded
14 15 16 17 18 19 20 21 |
# File 'lib/codercompanion/language_parser.rb', line 14 def create_project_json(dir_name, excluded_files, cache_handler) self.excluded = excluded_files 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, cache_handler) end |
#parse(files) ⇒ Object
Parse the files
25 26 27 |
# File 'lib/codercompanion/language_parser.rb', line 25 def parse(files) raise NotImplementedError, "#{self.class}: 'parse' must be overridden" end |