ruboty 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 985c3008104c6e170325097857be489a8128f97b
4
- data.tar.gz: aad5cc9b0fba7c702b5059aa994b0878abed94c1
3
+ metadata.gz: 73ee9ea5c245fbbabc40338c12ea83ab04c88fc7
4
+ data.tar.gz: 503ad69ea92cbb2cc83e2e3c28547e33f873a933
5
5
  SHA512:
6
- metadata.gz: 07696686fdaab75c885b4136d03370b1a2c16e1fe4273213e96ed87fbd3f93952e657d3875bbc475568fd37e24f56a71ee9cd5b4efe996a3854bbad1e9a46852
7
- data.tar.gz: f6783b8b5fd0d864a8328ee619b98545ee44b065ead9238072d9fe85cdbc33def02bac1f7e32b82c2da357f38d731e56614f1c58d1bcc3421d54c4f6544c2d8d
6
+ metadata.gz: a3a2c7588f3410da124234be8ee7e4b662832ceb65d767bb1e35b6ce6d88f0381f4fc83b4dda863c38e66fa28ab78c952b733bda5169b493a082ee5983ee35df
7
+ data.tar.gz: 646b6f04f870d9009a1101aef13b2930afe7121c5ab9e76cea805e52d81748aa64145049f8ed62ba0278efa48a7c62e2c2ea3f0900a714457d79cb3232b39a28
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.2.4
2
+ - Improve help command output (thx @k0kubun)
3
+
1
4
  ## 1.2.3
2
5
  - User default Logger class (thx @eagletmt)
3
6
 
@@ -2,19 +2,24 @@ module Ruboty
2
2
  module Actions
3
3
  class Help < Base
4
4
  def call
5
- message.reply(body, code: true)
5
+ descriptions = filtered_descriptions
6
+ if descriptions.empty?
7
+ message.reply("No description matched to '#{message[:filter]}'")
8
+ else
9
+ message.reply(descriptions.join("\n"), code: true)
10
+ end
6
11
  end
7
12
 
8
13
  private
9
14
 
10
- def body
15
+ def filtered_descriptions
11
16
  descriptions = all_descriptions
12
17
  if message[:filter]
13
18
  descriptions.select! do |description|
14
19
  description.include?(message[:filter])
15
20
  end
16
21
  end
17
- descriptions.join("\n")
22
+ descriptions
18
23
  end
19
24
 
20
25
  def all_descriptions
@@ -1,3 +1,3 @@
1
1
  module Ruboty
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport