god 0.4.1 → 0.4.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.
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.4.3
2
+ * Bug Fixes
3
+ * fix Process#alive? to not raise on no such file
4
+
5
+ == 0.4.2
6
+ * Bug Fixes
7
+ * fix netlink events [dkresge]
8
+
1
9
  == 0.4.1
2
10
  * Bug Fixes
3
11
  * require 'stringio' for ruby 1.8.5
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'hoe'
3
3
 
4
- Hoe.new('god', '0.4.1') do |p|
4
+ Hoe.new('god', '0.4.3') do |p|
5
5
  p.rubyforge_name = 'god'
6
6
  p.author = 'Tom Preston-Werner'
7
7
  p.email = 'tom@rubyisawesome.com'
@@ -126,8 +126,9 @@ connect_to_netlink()
126
126
  msg->id.val = CN_VAL_PROC;
127
127
  msg->seq = 0;
128
128
  msg->ack = 0;
129
+ msg->flags = 0;
129
130
  msg->len = sizeof(int);
130
- msg->data[0] = PROC_CN_MCAST_LISTEN;
131
+ *(int*)msg->data = PROC_CN_MCAST_LISTEN;
131
132
 
132
133
  if (-1 == send(nl_sock, hdr, hdr->nlmsg_len, 0)) {
133
134
  rb_raise(rb_eStandardError, strerror(errno));
data/lib/god.rb CHANGED
@@ -52,8 +52,16 @@ end
52
52
 
53
53
  God::EventHandler.load
54
54
 
55
+ module Kernel
56
+ # Override abort to exit without executing the at_exit hook
57
+ def abort(text)
58
+ puts text
59
+ exit!
60
+ end
61
+ end
62
+
55
63
  module God
56
- VERSION = '0.4.1'
64
+ VERSION = '0.4.3'
57
65
 
58
66
  LOG = Logger.new
59
67
 
data/lib/god/process.rb CHANGED
@@ -12,8 +12,12 @@ module God
12
12
  end
13
13
 
14
14
  def alive?
15
- pid = File.read(self.pid_file).strip.to_i
16
- System::Process.new(pid).exists?
15
+ begin
16
+ pid = File.read(self.pid_file).strip.to_i
17
+ System::Process.new(pid).exists?
18
+ rescue Errno::ENOENT
19
+ false
20
+ end
17
21
  end
18
22
 
19
23
  def valid?
data/test/helper.rb CHANGED
@@ -94,6 +94,12 @@ def no_stderr
94
94
  $stderr.reopen(old_stderr)
95
95
  end
96
96
 
97
+ module Kernel
98
+ def abort(text)
99
+ raise SystemExit
100
+ end
101
+ end
102
+
97
103
  module Test::Unit::Assertions
98
104
  def assert_abort
99
105
  assert_raise SystemExit do
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: god
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.1
6
+ version: 0.4.3
7
7
  date: 2007-09-10 00:00:00 -07:00
8
8
  summary: Like monit, only awesome
9
9
  require_paths: