Module: CommandLineController
- Extended by:
- CommandLineController
- Included in:
- CommandLineController
- Defined in:
- lib/controllers/controller.rb
Instance Method Summary collapse
Instance Method Details
#file_writing ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/controllers/controller.rb', line 20 def file_writing DestinationFileWriter.run(Snippet.snippet_array) Language.languages.keys.each do |lang| DestinationFileWriter.run(Snippet.select_lang_snippets(lang), lang) if Snippet.select_lang_snippets(lang).any? end Snippet.snippet_array = [] end |
#run(file) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/controllers/controller.rb', line 11 def run(file) file_read = SourceFileReaderWriter.new(file) to_run = file_read.convert_to_array_of_lines mismatch_status = CodeScanner.run(to_run, SourceFileReaderWriter.file_to_open) abort(ViewFormatter.(mismatch_status)) if mismatch_status file_writing file_read.overwrite_existing_snips end |