Class: AdventOfCodeGenerator::Commands::SolveDay

Inherits:
Thor
  • Object
show all
Includes:
BaseCommand, Thor::Actions
Defined in:
lib/advent_of_code_generator/commands/solve_day.rb

Instance Method Summary collapse

Methods included from BaseCommand

#day, #day_name, #input_file_path, #solution_file_path, #year

Instance Method Details

#startObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/advent_of_code_generator/commands/solve_day.rb', line 15

def start
  raise MissingInputFileError unless File.exist?(input_file_path)
  raise MissingSolutionFileError unless File.exist?(solution_file_path)

  say "Loading solution file..."
  load(solution_file_path)

  solve_part_one if solve_part_one?
  solve_part_two if solve_part_two?
end