bluepill 0.0.42 → 0.0.43

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.42
1
+ 0.0.43
data/bluepill.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bluepill}
8
- s.version = "0.0.42"
8
+ s.version = "0.0.43"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Arya Asemanfar", "Gary Tsang", "Rohith Ravi"]
12
- s.date = %q{2010-08-23}
12
+ s.date = %q{2010-09-18}
13
13
  s.default_executable = %q{bluepill}
14
14
  s.description = %q{Bluepill keeps your daemons up while taking up as little resources as possible. After all you probably want the resources of your server to be used by whatever daemons you are running rather than the thing that's supposed to make sure they are brought back up, should they die or misbehave.}
15
15
  s.email = %q{entombedvirus@gmail.com}
data/lib/bluepill.rb CHANGED
@@ -28,4 +28,4 @@ require "bluepill/process_conditions"
28
28
 
29
29
  require "bluepill/util/rotational_array"
30
30
 
31
- require "bluepill/version"
31
+ require "bluepill/version"
@@ -33,11 +33,11 @@ module Bluepill
33
33
  end
34
34
 
35
35
  def get_children(parent_pid)
36
- Array.new.tap do |child_pids|
37
- ps_axu.each_pair do |pid, chunks|
38
- child_pids << chunks[IDX_MAP[:pid]].to_i if chunks[IDX_MAP[:ppid]].to_i == parent_pid.to_i
39
- end
36
+ child_pids = Array.new
37
+ ps_axu.each_pair do |pid, chunks|
38
+ child_pids << chunks[IDX_MAP[:pid]].to_i if chunks[IDX_MAP[:ppid]].to_i == parent_pid.to_i
40
39
  end
40
+ child_pids
41
41
  end
42
42
 
43
43
  # Returns the pid of the child that executes the cmd
@@ -55,6 +55,12 @@ module Bluepill
55
55
  block.call(self[rotational_idx(start + i)])
56
56
  end
57
57
  end
58
+
59
+ unless method_defined?(:nitems)
60
+ def nitems
61
+ compact.length
62
+ end
63
+ end
58
64
 
59
65
  private
60
66
 
@@ -1,3 +1,3 @@
1
1
  module Bluepill
2
- VERSION = "0.0.42"
2
+ VERSION = "0.0.43"
3
3
  end
data/lib/example.rb CHANGED
@@ -6,7 +6,7 @@ ROOT_DIR = "/tmp/bp"
6
6
 
7
7
  # Watch with
8
8
  # watch -n0.2 'ps axu | egrep "(CPU|forking|bluepill|sleep)" | grep -v grep | sort'
9
- Bluepill.application(:sample_app) do |app|
9
+ Bluepill.application(:sample_app, :base_dir => "/tmp/bluepill") do |app|
10
10
  0.times do |i|
11
11
  app.process("process_#{i}") do |process|
12
12
  process.pid_file = "#{ROOT_DIR}/pids/process_#{i}.pid"
@@ -63,8 +63,8 @@ Bluepill.application(:sample_app) do |app|
63
63
 
64
64
  1.times do |i|
65
65
  app.process("group_process_#{i}") do |process|
66
- process.uid = "rohith"
67
- process.gid = "wheel"
66
+ # process.uid = "rohith"
67
+ # process.gid = "wheel"
68
68
 
69
69
  process.stderr = "/tmp/err.log"
70
70
  process.stdout = "/tmp/err.log"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bluepill
3
3
  version: !ruby/object:Gem::Version
4
- hash: 75
4
+ hash: 73
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 42
10
- version: 0.0.42
9
+ - 43
10
+ version: 0.0.43
11
11
  platform: ruby
12
12
  authors:
13
13
  - Arya Asemanfar
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-08-23 00:00:00 -07:00
20
+ date: 2010-09-18 00:00:00 -07:00
21
21
  default_executable: bluepill
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency