Class: AocCli::Processors::PuzzleDirSynchroniser
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- AocCli::Processors::PuzzleDirSynchroniser
- Extended by:
- Forwardable
- Defined in:
- lib/aoc_cli/processors/puzzle_dir_synchroniser.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#puzzle ⇒ Object
Returns the value of attribute puzzle.
-
#skip_cache ⇒ Object
Returns the value of attribute skip_cache.
Instance Method Summary collapse
- #run ⇒ Object
-
#validate ⇒ Object
TODO: replace with conditional validation.
Methods inherited from Core::Processor
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
6 7 8 |
# File 'lib/aoc_cli/processors/puzzle_dir_synchroniser.rb', line 6 def location @location end |
#puzzle ⇒ Object
Returns the value of attribute puzzle.
6 7 8 |
# File 'lib/aoc_cli/processors/puzzle_dir_synchroniser.rb', line 6 def puzzle @puzzle end |
#skip_cache ⇒ Object
Returns the value of attribute skip_cache.
6 7 8 |
# File 'lib/aoc_cli/processors/puzzle_dir_synchroniser.rb', line 6 def skip_cache @skip_cache end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/aoc_cli/processors/puzzle_dir_synchroniser.rb', line 20 def run refresh_puzzle! if skip_cache create_puzzle_dir_sync_log!.tap do puzzle_file.write(puzzle.content) input_file.write(puzzle.input) end end |
#validate ⇒ Object
TODO: replace with conditional validation
15 16 17 18 |
# File 'lib/aoc_cli/processors/puzzle_dir_synchroniser.rb', line 15 def validate super validate_puzzle_dir_exists! if errors.empty? end |