aoc-helper/lib/tasks/part_two.rb

18 lines
408 B
Ruby

require "tty-prompt"
require "tty-file"
require "ostruct"
require_relative("templates")
def part_two(prompt, day)
result = prompt.ask("Part two example result")
day_name = "day_#{day}"
TTY::File.copy_file("#{day_name}/impl.rb","#{day_name}/impl_2.rb")
TTY::File.replace_in_file "#{day_name}/test.rb", /example_result_2/, result
puts "Done - run with:"
puts "ruby #{day_name}/test.rb 2"
end