konamio 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -0
- data/lib/konamio/sequence/requisition.rb +3 -2
- data/lib/konamio/version.rb +1 -1
- metadata +42 -52
data/README.md
CHANGED
@@ -38,3 +38,25 @@ The following code would prompt the user to enter the konami code twice:
|
|
38
38
|
```
|
39
39
|
Konamio::Sequence::Requisition.new.execute! { Konamio::Sequence::Requisition.new.execute! }
|
40
40
|
```
|
41
|
+
This would give you +30 lives:
|
42
|
+
```
|
43
|
+
Konamio::Sequence::Requisition.new.execute! { 30.times { puts "+1up" } }
|
44
|
+
```
|
45
|
+
|
46
|
+
## More fun
|
47
|
+
|
48
|
+
**"Password protect"** your rails console by doing the following:
|
49
|
+
|
50
|
+
1. Follow these [instructions](http://samuelmullen.com/2010/04/irb-global-local-irbrc/) to obtain a `.irbrc` file that loads your local `.irbrc`
|
51
|
+
2. Add this gem to your rails project, then create a `.irbrc` file for the project containing
|
52
|
+
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
require "konamio"
|
56
|
+
Konamio::Sequence::Requisition.new.execute!
|
57
|
+
```
|
58
|
+
|
59
|
+
to require console users to enter the konami code, or to require some other password:
|
60
|
+
|
61
|
+
require "konamio"
|
62
|
+
Konamio::Sequence::Requisition.new(sequence: "foobar").execute!
|
@@ -10,7 +10,8 @@ module Konamio
|
|
10
10
|
listener: Konamio::Sequence::Listener,
|
11
11
|
sequence: [:up,:up,:down,:down,:left,:right,:left,:right,"B","A"],
|
12
12
|
prompt: "Enter konami code (or hit escape)",
|
13
|
-
confirmation: "Good job, you."
|
13
|
+
confirmation: "Good job, you.",
|
14
|
+
cancellation: "Goodbye!"
|
14
15
|
}.merge(options)
|
15
16
|
|
16
17
|
load_options(:sequence, options)
|
@@ -36,7 +37,7 @@ module Konamio
|
|
36
37
|
|
37
38
|
case signal
|
38
39
|
when :negative
|
39
|
-
prompt(
|
40
|
+
prompt(@cancellation)
|
40
41
|
result(false, data: { confirmation: "User terminated." })
|
41
42
|
when sequence
|
42
43
|
prompt
|
data/lib/konamio/version.rb
CHANGED
metadata
CHANGED
@@ -1,88 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konamio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
version: 0.2.2
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Tad Hosford
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pay_dirt
|
16
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
17
18
|
requirements:
|
18
19
|
- - ! '>='
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
21
|
-
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
25
|
none: false
|
23
|
-
requirement: !ruby/object:Gem::Requirement
|
24
26
|
requirements:
|
25
27
|
- - ! '>='
|
26
28
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
28
|
-
MA==
|
29
|
-
none: false
|
30
|
-
prerelease: false
|
31
|
-
type: :runtime
|
29
|
+
version: '0'
|
32
30
|
- !ruby/object:Gem::Dependency
|
33
31
|
name: minitest
|
34
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
35
34
|
requirements:
|
36
35
|
- - ! '>='
|
37
36
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
39
|
-
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
|
-
requirement: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
46
|
-
MA==
|
47
|
-
none: false
|
48
|
-
prerelease: false
|
49
|
-
type: :development
|
45
|
+
version: '0'
|
50
46
|
- !ruby/object:Gem::Dependency
|
51
47
|
name: pry
|
52
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
53
50
|
requirements:
|
54
51
|
- - ! '>='
|
55
52
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
57
|
-
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
57
|
none: false
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
59
|
- - ! '>='
|
62
60
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
-
MA==
|
65
|
-
none: false
|
66
|
-
prerelease: false
|
67
|
-
type: :development
|
61
|
+
version: '0'
|
68
62
|
- !ruby/object:Gem::Dependency
|
69
63
|
name: rake
|
70
|
-
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
71
66
|
requirements:
|
72
67
|
- - ! '>='
|
73
68
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
73
|
none: false
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
74
|
requirements:
|
79
75
|
- - ! '>='
|
80
76
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
82
|
-
MA==
|
83
|
-
none: false
|
84
|
-
prerelease: false
|
85
|
-
type: :development
|
77
|
+
version: '0'
|
86
78
|
description: Recognize sequences in Ruby... just for fun.
|
87
79
|
email:
|
88
80
|
- tad.hosford@gmail.com
|
@@ -109,34 +101,32 @@ files:
|
|
109
101
|
- test/minitest_helper.rb
|
110
102
|
homepage: https://github.com/rthbound/konamio
|
111
103
|
licenses: []
|
112
|
-
post_install_message:
|
104
|
+
post_install_message:
|
113
105
|
rdoc_options: []
|
114
106
|
require_paths:
|
115
107
|
- lib
|
116
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
117
110
|
requirements:
|
118
111
|
- - ! '>='
|
119
112
|
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
120
114
|
segments:
|
121
115
|
- 0
|
122
|
-
hash:
|
123
|
-
version: !binary |-
|
124
|
-
MA==
|
125
|
-
none: false
|
116
|
+
hash: -728235217
|
126
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
127
119
|
requirements:
|
128
120
|
- - ! '>='
|
129
121
|
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
130
123
|
segments:
|
131
124
|
- 0
|
132
|
-
hash:
|
133
|
-
version: !binary |-
|
134
|
-
MA==
|
135
|
-
none: false
|
125
|
+
hash: -728235217
|
136
126
|
requirements: []
|
137
|
-
rubyforge_project:
|
138
|
-
rubygems_version: 1.8.
|
139
|
-
signing_key:
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 1.8.25
|
129
|
+
signing_key:
|
140
130
|
specification_version: 3
|
141
131
|
summary: I'm gonna recognize the konami sequence
|
142
132
|
test_files: []
|