Method: Filegen::Runner#execute!
- Defined in:
- lib/filegen/runner.rb
#execute! ⇒ Object
Execute runner
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/filegen/runner.rb', line 27 def execute! begin = Options.new(argv) generator = ErbGenerator.new(Data.new(.data_sources)) generator.compile(.source, .destination) exitstatus = 0 rescue Interrupt Filegen::Ui.warning 'You told me to stop command execution.' exitstatus = 2 rescue Exceptions::ErbTemplateHasSyntaxErrors => e Filegen::Ui.error "Syntax error in ERB-Template: \n" + e. exitstatus = 3 rescue Exceptions::YamlFileNotFound => e Filegen::Ui.error "Yaml-file \"#{JSON.parse(e.)['file']}\" not found." exitstatus = 4 rescue StandardError => e Filegen::Ui.error "#{e.class} - #{e.}" exitstatus = 99 end @kernel.exit(exitstatus) end |