ruboty-response 1.0.3 → 1.1.0

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: 4f8e8fdf1b06487413e2aeef08a7376419f6d176
4
- data.tar.gz: 9933903325476a3890b3509c571ced96998006ab
3
+ metadata.gz: a35bed6b5959dcee4da3803d93a4f0d2671b17e6
4
+ data.tar.gz: ef1cf0323809bfd8ea36934855a2da903906f003
5
5
  SHA512:
6
- metadata.gz: 5b817b6e9a36a7745ff2d695af5e816a59471ba9ca60d9c7120cb37e85eab664d8422fbd41a4f03e5da3f436a0c3c6d5b6021efdc8cbf800eab0fa1925280036
7
- data.tar.gz: 6a652a030524ee8203d641ea613f1b239f1101ee23b629f0b3867abb1368ebf3a71501fb0c5ad8a1cbfb9748398af8d645079551a41dc80f3ac7b85dd8bd6a9f
6
+ metadata.gz: ef091a4f81f6a4f0ec4a876eb376d5ae60a83c50fdfb257b7db961402834dfa34e1f3200b29642c56a279a1f43fe4268c95a1192d99dc7920ce4ad99d5a9be71
7
+ data.tar.gz: 114e156b266de488dd51d8f6c39e13695ce3cd089f41f068b2e6dc9aa269af2df134f6aa72cb3fe424f2054dbac472b62089f0031b21f4b4ae6f93f009c66a9b
@@ -7,7 +7,7 @@ module Ruboty
7
7
 
8
8
  on /(?<keyword>.+)/, name: 'catchall', hidden: true, all: true
9
9
 
10
- on /add response \/(?<regex>.+?)\/ (?<response>`?.+`?)/, name: 'add', description: 'Add a response'
10
+ on /add response \/(?<regex>.+?)\/ (?<response>.+)/, name: 'add', description: 'Add a response'
11
11
  on /delete response (?<id>.+)/, name: 'delete', description: 'Delete a response'
12
12
  on /list responses\z/, name: 'list', description: 'Show registered responses'
13
13
 
@@ -15,20 +15,7 @@ module Ruboty
15
15
  responses.each do |id, hash|
16
16
  next unless message[:keyword] =~ /#{hash[:regex]}/ rescue false
17
17
 
18
- # If the response is a code
19
- if match_data = hash[:response].match(/\A`(?<code>.+)`\z/)
20
- thread = Thread.start do
21
- stdout, stderr, _status = Open3.capture3(match_data[:code])
22
- message.reply(stdout.chomp) if stdout
23
- message.reply(stderr.chomp) if stderr
24
- end
25
- Thread.start do
26
- sleep 10
27
- thread.kill
28
- end
29
- else
30
- message.reply(hash[:response])
31
- end
18
+ message.reply(hash[:response])
32
19
  end
33
20
  rescue => e
34
21
  Ruboty.logger.error("Error: #{e.class}: #{e.message}}")
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Response
3
- VERSION = '1.0.3'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-response
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaihar4
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-04 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.4.5.1
91
+ rubygems_version: 2.6.8
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Ruboty handler to register a response.