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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6bf683742af9c9b3473845aafaac133f5da59c2
4
- data.tar.gz: 4262b2409d592bb7815254139533791c54417556
3
+ metadata.gz: 56fe2b61e09a86e6b8e45ee53e9b513291890b8e
4
+ data.tar.gz: 1e66be77634e6d45deb741aacfd8e054eefb713b
5
5
  SHA512:
6
- metadata.gz: 8b712904a895ce3c75e55104e743833a3d36fdbed3f8fc1e9e455f968d8f94fd52cf75df36dda25e77333df2d3d7d98b43522430d4b7df59c66f7fb9e2583e72
7
- data.tar.gz: e625b0c987d8c17615e1ebb98e40f23e902ad3d4e3377b78c18d2af6cf862f581e9b39ea7f88d080c708cc07987ed4a1029563a23cc88ac3af93041f41d85437
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
- ignore_pid, status = Process.wait2(pid)
36
- command_slot.forget(pid)
35
+ begin
36
+ ignore_pid, status = Process.wait2(pid)
37
+ command_slot.forget(pid)
37
38
 
38
- if status.exitstatus == 0
39
- msg = "[#{comm.command_name}] completed successfully. PID: #{comm.pid}"
40
- Ruboty.logger.info { "[EXEC_COMMAND] #{msg}" }
41
- message.reply(msg)
42
- message.reply(comm.stdout_log.chomp)
43
- elsif status.signaled?
44
- msg = "[#{comm.command_name}] killed by signal #{status.termsig} PID: #{comm.pid}"
45
- Ruboty.logger.info { "[EXEC_COMMAND] #{msg}" }
46
- message.reply(msg)
47
- else
48
- msg = "[#{comm.command_name}] exit status with #{status} PID: #{comm.pid}\n" +
49
- comm.stdout_log + "stderr: " + comm.stderr_log.chomp
50
- Ruboty.logger.info { "[EXEC_COMMAND] #{msg}" }
51
- message.reply(msg)
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
 
@@ -146,8 +146,8 @@ module Ruboty
146
146
  end
147
147
 
148
148
  def with_clean_env(&block)
149
- if defined?(Bundler)
150
- Bundler.with_clean_env do
149
+ if defined?(::Bundler)
150
+ ::Bundler.with_clean_env do
151
151
  yield
152
152
  end
153
153
  else
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module ExecCommand
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
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.3
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: 2015-11-07 00:00:00.000000000 Z
11
+ date: 2016-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty