Class: Groundhog

Inherits:
Object
  • Object
show all
Defined in:
lib/groundhog.rb

Overview

USAGE:

  1. In a console, type Groundhog.day to start the loop.

  2. Go nuts! There are literally no consequences to your actions.

  3. Press ^D to end it all wake up in your comfy bed.

  4. Quickly press ^D ^C to get out of Punxsutawney and back to your normal life.

Class Method Summary collapse

Class Method Details

.dayObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/groundhog.rb', line 11

def self.day
  puts "\nOkay, campers, rise and shine, and don't forget your booties 'cause it's cooooold out there today!"
  puts "Usage: ctrl-D to reset transaction, ctrl-D ctrl-C (quickly) to get out of the loop"
  loop do
    puts "\n  ♫  Then put your little hand in mine ♫"
    ActiveRecord::Base.transaction do
      binding.pry :quiet => true
      raise ActiveRecord::Rollback
    end
    puts "  ** DAY ENDS **"
    sleep 0.5
  end
end