lita-pebbles 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/sample.rb +11 -4
- data/lib/lita/pebbles/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27f7f0d6f1386a56dd54e65e5faa3b9d26bc9bd7
|
4
|
+
data.tar.gz: 24451f86ece4deabc39dc7911bc423361b09042a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d62f35cfa3d15f840b4878ca1d78ffae22d370379c2406bd55e039f04e99f5fa94c36e618af67f8b32569c69218240c1caa3fc0d9333093d8320f87edc03c4d
|
7
|
+
data.tar.gz: 42661c2909e30046ebf6a4d24e3edbe7e27afc888a5c9745269138ba65a3d5be55b3b49edec56ef6339484568ce75da19e974009c04d8effe29a2793eb59df88
|
data/lib/lita/handlers/sample.rb
CHANGED
@@ -2,11 +2,18 @@ module Lita
|
|
2
2
|
module Handlers
|
3
3
|
class Sample < Handler
|
4
4
|
|
5
|
-
route /^sample (.+)/, :sample, command: false,
|
6
|
-
help: {
|
5
|
+
route /^sample (?:([0-9]) )?(.+)/, :sample, command: false,
|
6
|
+
help: { 'sample [n] [foo] [bar] [baz]...' => '[foo] に決めた!' }
|
7
7
|
def sample(response)
|
8
|
-
list = response.matches
|
9
|
-
|
8
|
+
total, list = response.matches.flatten
|
9
|
+
total ||= 1
|
10
|
+
list = list.split.shuffle
|
11
|
+
|
12
|
+
total.to_i.times do
|
13
|
+
item = list.pop
|
14
|
+
break unless item
|
15
|
+
response.reply "#{item} に決めた!"
|
16
|
+
end
|
10
17
|
end
|
11
18
|
end
|
12
19
|
Lita.register_handler(Sample)
|
data/lib/lita/pebbles/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-pebbles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.6.3
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: A Lita handlers for fun :)
|