daemons 0.4.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README +1 -1
  2. data/TODO +1 -1
  3. data/lib/daemons.rb +1 -1
  4. data/lib/daemons/pid.rb +13 -2
  5. metadata +23 -22
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = Daemons Version 0.4.4
1
+ = Daemons Version 1.0.0
2
2
 
3
3
  (See Releases for release-specific information)
4
4
 
data/TODO CHANGED
@@ -1,6 +1,6 @@
1
1
  * write the README (2005-02-07) *DONE*
2
2
  * write some real tests (2005-02-08)
3
- * document the new options (2005-03-14)
3
+ * document the new options (2005-03-14) *DONE*
4
4
  * start/stop with --force options (2005-04-05)
5
5
  * option to give some console output on start/stop commands (2005-04-05)
6
6
 
data/lib/daemons.rb CHANGED
@@ -65,7 +65,7 @@ require 'daemons/controller'
65
65
  #
66
66
  module Daemons
67
67
 
68
- VERSION = "0.4.4"
68
+ VERSION = "1.0.0"
69
69
 
70
70
  require 'daemons/daemonize'
71
71
 
data/lib/daemons/pid.rb CHANGED
@@ -4,8 +4,19 @@ module Daemons
4
4
  class Pid
5
5
 
6
6
  def Pid.running?(pid, additional = nil)
7
- output = `ps ax`
8
- return (/#{pid} / =~ output and (additional ? /#{additional}/ =~ output : true))
7
+ match_pid = Regexp.new("^\s*#{pid}\s")
8
+ got_match = false
9
+
10
+ ps_all = IO.popen("ps ax")
11
+ ps_all.each { |psline|
12
+ next unless psline =~ match_pid
13
+ got_match = true
14
+ got_match = false if additional and psline !~ /#{additional}/
15
+ break
16
+ }
17
+ ps_all.close
18
+
19
+ return got_match
9
20
  end
10
21
 
11
22
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: daemons
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.4
7
- date: 2006-04-07 00:00:00 +02:00
6
+ version: 1.0.0
7
+ date: 2006-08-29 00:00:00 +02:00
8
8
  summary: A toolkit to create and control daemons in different ways
9
9
  require_paths:
10
10
  - lib
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - Thomas Uehlinger
30
31
  files:
@@ -34,41 +35,41 @@ files:
34
35
  - README
35
36
  - setup.rb
36
37
  - lib/daemons.rb
38
+ - lib/daemons/application.rb
39
+ - lib/daemons/application_group.rb
37
40
  - lib/daemons/cmdline.rb
38
- - lib/daemons/exceptions.rb
41
+ - lib/daemons/controller.rb
39
42
  - lib/daemons/daemonize.rb
40
- - lib/daemons/pidfile.rb
43
+ - lib/daemons/exceptions.rb
41
44
  - lib/daemons/monitor.rb
42
- - lib/daemons/application_group.rb
43
- - lib/daemons/controller.rb
44
45
  - lib/daemons/pid.rb
46
+ - lib/daemons/pidfile.rb
45
47
  - lib/daemons/pidmem.rb
46
- - lib/daemons/application.rb
47
- - test/tmp
48
- - test/testapp.rb
49
- - test/test1.rb
50
48
  - test/call_as_daemon.rb
51
49
  - test/tc_main.rb
52
- - examples/run
50
+ - test/test1.rb
51
+ - test/testapp.rb
52
+ - test/tmp
53
53
  - examples/call
54
54
  - examples/daemonize
55
+ - examples/run
56
+ - examples/call/call.rb
57
+ - examples/call/call_monitor.rb
58
+ - examples/daemonize/daemonize.rb
59
+ - examples/run/ctrl_crash.rb
55
60
  - examples/run/ctrl_exec.rb
56
61
  - examples/run/ctrl_exit.rb
62
+ - examples/run/ctrl_monitor.rb
57
63
  - examples/run/ctrl_multiple.rb
58
- - examples/run/myserver_crashing.rb.output
59
- - examples/run/ctrl_proc.output
60
64
  - examples/run/ctrl_normal.rb
61
- - examples/run/ctrl_monitor.rb
62
- - examples/run/myserver.rb
63
- - examples/run/myserver_crashing.rb
65
+ - examples/run/ctrl_ontop.rb
66
+ - examples/run/ctrl_proc.output
64
67
  - examples/run/ctrl_proc.rb
65
68
  - examples/run/ctrl_proc.rb.output
66
- - examples/run/ctrl_ontop.rb
69
+ - examples/run/myserver.rb
70
+ - examples/run/myserver_crashing.rb
71
+ - examples/run/myserver_crashing.rb.output
67
72
  - examples/run/myserver_exiting.rb
68
- - examples/run/ctrl_crash.rb
69
- - examples/call/call_monitor.rb
70
- - examples/call/call.rb
71
- - examples/daemonize/daemonize.rb
72
73
  test_files:
73
74
  - test/tc_main.rb
74
75
  rdoc_options: []