ruboty-exec_command 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/ruboty/exec_command/actions/command.rb +20 -16
- data/lib/ruboty/exec_command/command.rb +2 -2
- data/lib/ruboty/exec_command/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56fe2b61e09a86e6b8e45ee53e9b513291890b8e
|
4
|
+
data.tar.gz: 1e66be77634e6d45deb741aacfd8e054eefb713b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6de981a7e94b0da0be7b5f9b0a0c50a907dde7113fcd6f4df77bc1935a61b080289a0bec3b54289d852dfa925c74b0f14a8e88a28751c431441f591aa4e6073
|
7
|
+
data.tar.gz: 8d71e2a8824599f52028654c09a7f848cabcd9d587d977a6ebe6855c7eafc397d72b34ea8be3fe57f4b32e2d967e4a5081d5e40016b2ff04e4bc28893d36f958
|
data/README.md
CHANGED
@@ -49,6 +49,12 @@ Or install it yourself as:
|
|
49
49
|
|
50
50
|
## History
|
51
51
|
|
52
|
+
- 0.1.5:
|
53
|
+
- add: rescue errors of invoked Thread could raise
|
54
|
+
|
55
|
+
- 0.1.4:
|
56
|
+
- fix: refer to Ruboty::Bundler if ruboty-bundler is used
|
57
|
+
|
52
58
|
- 0.1.3:
|
53
59
|
- fix: output_file_names time stamp jitter
|
54
60
|
|
@@ -32,23 +32,27 @@ module Ruboty
|
|
32
32
|
|
33
33
|
# Waiter thread
|
34
34
|
thread = Thread.new do
|
35
|
-
|
36
|
-
|
35
|
+
begin
|
36
|
+
ignore_pid, status = Process.wait2(pid)
|
37
|
+
command_slot.forget(pid)
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
39
|
+
if status.exitstatus == 0
|
40
|
+
msg = "[#{comm.command_name}] completed successfully. PID: #{comm.pid}"
|
41
|
+
Ruboty.logger.info { "[EXEC_COMMAND] #{msg}" }
|
42
|
+
message.reply(msg)
|
43
|
+
message.reply(comm.stdout_log.chomp)
|
44
|
+
elsif status.signaled?
|
45
|
+
msg = "[#{comm.command_name}] killed by signal #{status.termsig} PID: #{comm.pid}"
|
46
|
+
Ruboty.logger.info { "[EXEC_COMMAND] #{msg}" }
|
47
|
+
message.reply(msg)
|
48
|
+
else
|
49
|
+
msg = "[#{comm.command_name}] exit status with #{status} PID: #{comm.pid}\n" +
|
50
|
+
comm.stdout_log + "stderr: " + comm.stderr_log.chomp
|
51
|
+
Ruboty.logger.info { "[EXEC_COMMAND] #{msg}" }
|
52
|
+
message.reply(msg)
|
53
|
+
end
|
54
|
+
rescue Exception => e
|
55
|
+
Ruboty.logger.error { "[EXEC_COMMAND] #{e.class} #{e.message} #{e.backtrace.first}" }
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-exec_command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nakai Tooru
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruboty
|