From 10599ab2e789ffb93a19f6aa3c100f533c460315 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 29 Oct 2023 11:32:06 -0400 Subject: generate, show, solve puzzles --- lib/tasks/wittle_tasks.rake | 11 +++++++---- lib/wittle/engine.rb | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/tasks/wittle_tasks.rake b/lib/tasks/wittle_tasks.rake index 854e5c9..debf249 100644 --- a/lib/tasks/wittle_tasks.rake +++ b/lib/tasks/wittle_tasks.rake @@ -1,4 +1,7 @@ -# desc "Explaining what the task does" -# task :wittle do -# # Task goes here -# end +namespace :wittle do + desc "Generate new puzzles for the day" + task :generate_puzzles => :environment do + Wittle::Puzzle.create(data: WittleGenerator.new.generate_easy, category: :normal) + Wittle::Puzzle.create(data: WittleGenerator.new.generate_medium, category: :hard) + end +end diff --git a/lib/wittle/engine.rb b/lib/wittle/engine.rb index 6b4feca..d42ea1a 100644 --- a/lib/wittle/engine.rb +++ b/lib/wittle/engine.rb @@ -1,5 +1,7 @@ require "enumerize" require "haml" +require "jquery-rails" +require "sassc-rails" require "wittle_generator/wittle_generator" module Wittle -- cgit 1.4.1