groundhog 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +12 -0
  3. data/lib/groundhog.rb +24 -0
  4. metadata +79 -0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Glen Maddern
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # Groundhog Day
2
+
3
+ > Okay, campers, rise and shine...
4
+
5
+ A nice, little loop for rails console to keep your destructive changes in a transaction.
6
+
7
+ Use it like this:
8
+
9
+ 1. In a console, type <code>Groundhog.day</code> to start the loop.
10
+ 2. Go nuts! There are _literally_ no consequences to your actions.
11
+ 3. Press <code>^D</code> to end it all wake up in your comfy bed.
12
+ 4. Quickly press <code>^D ^C</code> to get out of Punxsutawney and back to your normal life.
data/lib/groundhog.rb ADDED
@@ -0,0 +1,24 @@
1
+ # encoding: UTF-8
2
+
3
+ # USAGE:
4
+ #
5
+ # 1. In a console, type Groundhog.day to start the loop.
6
+ # 2. Go nuts! There are _literally_ no consequences to your actions.
7
+ # 3. Press ^D to end it all wake up in your comfy bed.
8
+ # 4. Quickly press ^D ^C to get out of Punxsutawney and back to your normal life.
9
+
10
+ class Groundhog
11
+ def self.day
12
+ puts "\nOkay, campers, rise and shine, and don't forget your booties 'cause it's cooooold out there today!"
13
+ puts "Usage: ctrl-D to reset transaction, ctrl-D ctrl-C (quickly) to get out of the loop"
14
+ loop do
15
+ puts "\n ♫ Then put your little hand in mine ♫"
16
+ ActiveRecord::Base.transaction do
17
+ binding.pry :quiet => true
18
+ raise ActiveRecord::Rollback
19
+ end
20
+ puts " ** DAY ENDS **"
21
+ sleep 0.5
22
+ end
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: groundhog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Glen Maddern
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rails
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: groundhog gives you a repeatable transaction loop for your console.
47
+ email: glenmaddern@gmail.com
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - lib/groundhog.rb
53
+ - LICENSE
54
+ - README.md
55
+ homepage: http://github.com/geelen/groundhog
56
+ licenses: []
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: 1.3.6
73
+ requirements: []
74
+ rubyforge_project: groundhog
75
+ rubygems_version: 1.8.23
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: Keep repeating the same day, er transaction.
79
+ test_files: []