ruboty-message_suffix 0.0.2 → 0.0.3

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: 93198f533d9499a1da35c0371827cbade7c3f0e4
4
- data.tar.gz: 0854fc5156f8a20f7356a19c6481425cd5971070
3
+ metadata.gz: 46a9b22813bf2e4d4b360df0cb5b185de58cdbd5
4
+ data.tar.gz: 54d58e981c9003c3ce1663539af457f19b86ac1c
5
5
  SHA512:
6
- metadata.gz: f68d996670ff09fafebba22f97105626aa320a0ff16b61b47bb44bf4f3991be99c21330c2d9ee0bcfb2b0100f05c1dccb402b5f3ecd3409f13cbc8485e1f3261
7
- data.tar.gz: d092a557221e2b3ee8f95839c7f49e09ab241df366e700b47a63887fa02d34a52c2644953aa26508ed0d2da881f55ba2b4eae4b1224c7038cfa8dae3164cb1a5
6
+ metadata.gz: 4a3cc72cdd486eba574cd9d1747954de9aba248e0db7be47b31b3177044092a8fa3d5df39b08ba9c0ee57a866a9f283db436a75ff807d829762f3a17a624dc51
7
+ data.tar.gz: 4f121138533a1d5c7a557363943549b8d099ecf289809412f50940be1475be14c3675e855230a0c64b88021e8cc149db345cb5d7e2c3c16641fafa7a2e705fda
data/README.md CHANGED
@@ -10,14 +10,27 @@ Grant any word to suffix of message.
10
10
 
11
11
  ## Usage
12
12
 
13
+ ### Basic
13
14
  ```bash
14
- export RUBOT_MESSAGE_SUFFIX='どすぅ'
15
- bundle exec ruboty
15
+ $ export RUBOT_MESSAGE_SUFFIX='どすぅ'
16
+ $ bundle exec ruboty
16
17
  > ruboty ping
17
18
  pong どすぅ
18
19
 
19
20
  ```
20
21
 
22
+ ### Randomly extracted from multiple
23
+ ```bash
24
+ $ export RUBOT_MESSAGE_SUFFIX='っしょ,じゃけぇ,ばってん'
25
+ $ bundle exec ruboty
26
+ > ruboty ping
27
+ pong じゃけぇ
28
+ > ruboty ping
29
+ pong っしょ
30
+ > ruboty ping
31
+ pong ばってん
32
+ ```
33
+
21
34
  ## Demo
22
35
 
23
36
  Coming soon...
@@ -5,8 +5,12 @@ module ExtensionMessage
5
5
  def message_suffix_reply(body, options = {})
6
6
  raise "Please set the value to the ENV variable 'RUBOT_MESSAGE_SUFFIX'" unless ENV.has_key?("RUBOT_MESSAGE_SUFFIX")
7
7
 
8
- attributes = { body: body << " " << ENV["RUBOT_MESSAGE_SUFFIX"], from: to, to: from, original: original }.merge(options)
9
- robot.say(attributes)
8
+ unless body.nil?
9
+ suffixes = ENV["RUBOT_MESSAGE_SUFFIX"].split(",")
10
+ body << " " << suffixes[Random.new.rand(suffixes.size)]
11
+ end
12
+
13
+ original_reply(body, options)
10
14
  end
11
15
  end
12
16
 
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module MessageSuffix
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-message_suffix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fukui ReTu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-20 00:00:00.000000000 Z
11
+ date: 2014-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty