ruboty-evaluate 0.0.1 → 1.0.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: b4cf7351565daf304a42db406aa3bbc41f5a2ab7
4
- data.tar.gz: f3fe2bbc0c8dbebb09ca423f38469f3798ae5b80
3
+ metadata.gz: 202e2b59659a061e8622b11601f1bfb54279f166
4
+ data.tar.gz: 7a7224317c01d3504768ebb6315e0f7072de1629
5
5
  SHA512:
6
- metadata.gz: 200cd2d4eb255dec2163ea2c57d559832e198b3c2f914e27ff12dca47450637a97be8be39a94ce19b3288e8a013154175f1f71e020c3befff37d63bd1d03e5b5
7
- data.tar.gz: 3059bdf1e6bfd7292e6e6026ad5d6b5e65ceba56ef9d0643ebb7068e4451353a5ce2b28ad70bdff389da2d33b8a3c557872b30966b377c3f8da6c74f9e7f47cf
6
+ metadata.gz: c6a383ee35b53c7c0b2efffd6dd836838b3632e1dcf2512dd6e09e877fd112bd81dabbdf166f88e7e696f719f1bf64edf5c397cce69cbcccae5718d7e37ada0c
7
+ data.tar.gz: 4fb3f613d3efc9c6d213a5afbf3b8ed4ee2b1f2e9df0a1cb5398d3c121b71f8087da1a04db430733c7a135f4d3f0f4ada8d459aca16c18b81de210736ea801ad
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Evaluate
3
- VERSION = '0.0.1'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -5,8 +5,13 @@ module Ruboty
5
5
 
6
6
  def evaluate(message)
7
7
  thread = Thread.start do
8
- result = `#{message[:command]}`.chomp!
9
- message.reply(result)
8
+ stdout, stderr, status = Open3.capture3(message[:command])
9
+ message.reply(stdout.chomp) if stdout
10
+ message.reply(stderr.chomp) if stderr
11
+
12
+ unless status.success?
13
+ message.reply("Command Failed:\n#{message[:command]}", code: true)
14
+ end
10
15
  end
11
16
  Thread.start do
12
17
  sleep 10
@@ -20,6 +20,4 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency 'bundler'
22
22
  spec.add_development_dependency 'rake'
23
- spec.add_development_dependency 'pry'
24
- spec.add_development_dependency 'awesome_print'
25
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-evaluate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaihar4
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-23 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: awesome_print
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
55
  description: Ruboty handler to evaluate a command.
84
56
  email:
85
57
  - kaihar4@gmail.com