cognition 2.0.2 → 2.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 +4 -4
- data/lib/cognition/plugins/base.rb +1 -0
- data/lib/cognition/plugins/cognition/plugins/default/views/help.html.erb +1 -1
- data/lib/cognition/plugins/default.rb +1 -2
- data/lib/cognition/version.rb +1 -1
- data/test/fixtures/hello.rb +2 -0
- data/test/test_default_plugin.rb +2 -2
- 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: 06462dac8c1c3f92692619d523bc9f1a58fc4de4
|
4
|
+
data.tar.gz: db097768b8ff030201e53fb93f3aaf1efb8c997d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9a2814d94865711e1605188d017ccd865a416c714b9e6d21b15dba5691862119b6d425cc0696f9fbe1fed932744e3e1bbb4dda8c760d3614181b1471aa2a483
|
7
|
+
data.tar.gz: e8ab955d9bbe0862248e6b233c0e7dd2212db532ba342a145cb8d4264ceca1f5657ce9f00a3ff321bca53732f30652cee37161a7c10f0129e06bb8f90ed81794
|
@@ -16,11 +16,10 @@ module Cognition
|
|
16
16
|
|
17
17
|
def help(msg, match_data = nil)
|
18
18
|
type = msg.metadata[:type] ||= "text"
|
19
|
-
if match_data[
|
19
|
+
if match_data[:command].nil? || match_data[:command].empty?
|
20
20
|
@help = bot.help
|
21
21
|
else
|
22
22
|
@help = bot.help.find_all { |text| text.match match_data[:command] }
|
23
|
-
|
24
23
|
end
|
25
24
|
render(type: type)
|
26
25
|
end
|
data/lib/cognition/version.rb
CHANGED
data/test/fixtures/hello.rb
CHANGED
data/test/test_default_plugin.rb
CHANGED
@@ -7,12 +7,12 @@ class DefaultPluginTest < Minitest::Test
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_returns_help
|
10
|
-
help = "ping - Test if the endpoint is responding. Returns PONG.\nhelp - Lists all commands with help\nhelp <command> - Lists help for <command
|
10
|
+
help = "ping - Test if the endpoint is responding. Returns PONG.\nhelp - Lists all commands with help\nhelp <command> - Lists help for <command>\n"
|
11
11
|
assert_equal help, @bot.process("help")
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_returns_filtered_help
|
15
|
-
help = "ping - Test if the endpoint is responding. Returns PONG
|
15
|
+
help = "ping - Test if the endpoint is responding. Returns PONG.\n"
|
16
16
|
assert_equal help, @bot.process("help ping")
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cognition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.4.
|
167
|
+
rubygems_version: 2.4.8
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: A rules engine for running commands.
|