Class: AdventOfCodeGenerator::App
- Inherits:
-
Thor
- Object
- Thor
- AdventOfCodeGenerator::App
- Includes:
- Parser, Thor::Actions
- Defined in:
- lib/advent_of_code_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Parser
Class Method Details
.exit_on_failure? ⇒ Boolean
47 48 49 |
# File 'lib/advent_of_code_generator.rb', line 47 def self.exit_on_failure? true end |
Instance Method Details
#generate ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/advent_of_code_generator.rb', line 20 def generate day = parse_day([:day]) year = parse_year([:year]) invoke 'generateDay', [], :day => day, :year => year rescue AdventOfCodeGenerator::Error => e say e., :red end |
#solve ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/advent_of_code_generator.rb', line 33 def solve day = parse_day([:day]) year = parse_year([:year]) invoke 'solveDay', ['start'], :day => day, :year => year, :part => [:part] rescue AdventOfCodeGenerator::Error => e say e., :red end |