ruboty-kujibiki 0.1.0 → 0.2.0
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcabd5e81d133bd95f0c1237b03735231d3ac1c0
|
4
|
+
data.tar.gz: 8f01f3d03d6fc76c29f41cb9f44bdc7fdc65bb24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1281b2af80f01fb09dca43de1fd2d4a38e55a85998f7e577adb24ab2af076293848ab43008a1dd0cd0ed5a85355d36f0e0ea320dd01e7defaef88970c6c53ec3
|
7
|
+
data.tar.gz: ec0f1e48cf0ccb2692b21efaf21837343be122732e300e51752447d486e932daf4062eb95866698d42b2041b4b0b7bfc887f3e9bc12a20562e1039c4fe30a4e6
|
@@ -3,7 +3,7 @@ require 'ruboty/kujibiki/actions/kujibiki'
|
|
3
3
|
module Ruboty
|
4
4
|
module Handlers
|
5
5
|
class Kujibiki < Base
|
6
|
-
on /ku[jz]ibiki (?<elements>.*)\z/i, name: 'kujibiki', description: 'Choose an element from comma separated strings.'
|
6
|
+
on /ku[jz]ibiki +(?<number>\d+)? *(?<elements>.*)\z/i, name: 'kujibiki', description: 'Choose an element/elements from comma separated strings.'
|
7
7
|
|
8
8
|
def kujibiki(message)
|
9
9
|
Ruboty::Kujibiki::Actions::Kujibiki.new(message).call
|
@@ -9,7 +9,11 @@ module Ruboty
|
|
9
9
|
private
|
10
10
|
|
11
11
|
def selected_element
|
12
|
-
message[:elements].split(',').map(&:strip).sample
|
12
|
+
message[:elements].split(',').map(&:strip).sample(number).join(', ')
|
13
|
+
end
|
14
|
+
|
15
|
+
def number
|
16
|
+
[message[:number].to_i, 1].max
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-kujibiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OSA Shunsuke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruboty
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.6.11
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Choose an element from comma separated strings.
|