cinch_hangman 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Readme.markdown +41 -0
- data/lib/cinch/plugins/hangman.rb +1 -4
- data/lib/cinch_hangman/version.rb +1 -1
- metadata +8 -7
data/Readme.markdown
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
Grab the gem.
|
2
|
+
|
3
|
+
```
|
4
|
+
gem 'cinch_hangman'
|
5
|
+
```
|
6
|
+
|
7
|
+
And add hangman to your cinch bot as a plugin:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
require 'cinch_hangman'
|
11
|
+
|
12
|
+
bot = Cinch::Bot.new do
|
13
|
+
configure do |c|
|
14
|
+
c.server = "irc.freenode.net"
|
15
|
+
c.plugins.plugins = [
|
16
|
+
Cinch::Plugins::Hangman
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
```
|
21
|
+
|
22
|
+
To start a new game send a private message to your bot:
|
23
|
+
|
24
|
+
```
|
25
|
+
compactcode: !hang new #channel secret
|
26
|
+
```
|
27
|
+
|
28
|
+
The game will be started in the specified channel.
|
29
|
+
|
30
|
+
```
|
31
|
+
bot: (s_____) handman started.
|
32
|
+
compactcode: !hang guess s
|
33
|
+
bot: (s_____) 6 guesses left.
|
34
|
+
```
|
35
|
+
|
36
|
+
In order to minimize chatter players may guess multiple letters at a time.
|
37
|
+
|
38
|
+
```
|
39
|
+
compactcode: !hang guess et
|
40
|
+
bot: (se__et) 6 guesses left.
|
41
|
+
```
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Cinch::Plugins
|
2
2
|
class Hangman
|
3
3
|
include Cinch::Plugin
|
4
|
-
match /hang (.*)/i,
|
4
|
+
match /hang guess (.*)/i, :method => :guess
|
5
5
|
match /hang new (#\S*) (.*)/i, :method => :new_game
|
6
6
|
def new_game(m, channel, answer)
|
7
7
|
@game = CinchHangman::Game.new(answer)
|
@@ -11,8 +11,5 @@ module Cinch::Plugins
|
|
11
11
|
@game.guess(guess)
|
12
12
|
m.reply @game.describe
|
13
13
|
end
|
14
|
-
def status(m)
|
15
|
-
m.reply @game.describe
|
16
|
-
end
|
17
14
|
end
|
18
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch_hangman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-10 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cinch
|
16
|
-
requirement: &
|
16
|
+
requirement: &2162224980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2162224980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &2162224340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2162224340
|
36
36
|
description:
|
37
37
|
email:
|
38
38
|
- shanonmcquay@gmail.com
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- .gitignore
|
44
44
|
- Gemfile
|
45
45
|
- Rakefile
|
46
|
+
- Readme.markdown
|
46
47
|
- cinch_hangman.gemspec
|
47
48
|
- lib/cinch/plugins/hangman.rb
|
48
49
|
- lib/cinch_hangman.rb
|
@@ -63,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
64
|
version: '0'
|
64
65
|
segments:
|
65
66
|
- 0
|
66
|
-
hash: -
|
67
|
+
hash: -2369301778940008582
|
67
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
69
|
none: false
|
69
70
|
requirements:
|
@@ -72,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
73
|
version: '0'
|
73
74
|
segments:
|
74
75
|
- 0
|
75
|
-
hash: -
|
76
|
+
hash: -2369301778940008582
|
76
77
|
requirements: []
|
77
78
|
rubyforge_project: cinch_hangman
|
78
79
|
rubygems_version: 1.8.6
|