public
Fork of mojombo/god
Description: Ruby process monitor
Homepage: http://god.rubyforge.org
Clone URL: git://github.com/Bertg/god.git
timer tests, log output cleanup, rakefile, gitignore
mojombo (author)
Thu Oct 25 23:55:52 -0700 2007
commit  f867b5414048078fc0a35cc353ed06fe1f9e6f55
tree    d2c1b36d3fb850d9bc978dba13806d7fe55db59d
parent  79188aba4643c214decf6b53956ccbedb6d1cd0a
...
25
26
27
 
 
 
 
 
 
 
28
29
...
25
26
27
28
29
30
31
32
33
34
35
36
0
@@ -25,4 +25,11 @@ end
0
 desc "Upload site to Rubyforge"
0
 task :site_edge do
0
   sh "scp -r site/* mojombo@god.rubyforge.org:/var/www/gforge-projects/god/edge"
0
+end
0
+
0
+desc "Run rcov"
0
+task :coverage do
0
+ `rm -fr coverage`
0
+ `rcov test/test_*.rb`
0
+ `open coverage/index.html`
0
 end
0
\ No newline at end of file
...
89
90
91
92
 
 
93
94
95
...
89
90
91
 
92
93
94
95
96
0
@@ -89,7 +89,8 @@ module Kernel
0
   def abort(text = nil)
0
     $run = false
0
     applog(nil, :error, text) if text
0
- text ? abort_orig(text) : exit(1)
0
+ # text ? abort_orig(text) : exit(1)
0
+ exit(1)
0
   end
0
   
0
   alias_method :exit_orig, :exit
...
53
54
55
 
56
57
58
...
53
54
55
56
57
58
59
0
@@ -53,6 +53,7 @@ module God
0
             message = format("Unhandled exception (%s): %s\n%s",
0
                              e.class, e.message, e.backtrace.join("\n"))
0
             applog(nil, :fatal, message)
0
+ sleep INTERVAL
0
           end
0
         end
0
       end
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@ God.watch do |w|
0
   # determine when process has finished starting
0
   w.transition([:start, :restart], :up) do |on|
0
     on.condition(:process_running) do |c|
0
- # c.running = true
0
+ c.running = true
0
     end
0
     
0
     # failsafe
...
51
52
53
 
 
 
 
 
 
 
 
 
54
55
56
...
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
0
@@ -51,6 +51,15 @@ class TestTimer < Test::Unit::TestCase
0
     assert_equal 1, @t.events.size
0
   end
0
   
0
+ def test_time_should_recover_from_exceptions
0
+ @t.expects(:trigger).raises(Exception.new)
0
+ no_stdout do
0
+ @t.schedule(stub(:interval => 0))
0
+ sleep(0.3)
0
+ @t.schedule(stub(:interval => 0))
0
+ end
0
+ end
0
+
0
   # join
0
   
0
   def test_join_should_join

Comments

    No one has commented yet.