bluepill 0.0.40 → 0.0.42

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.40
1
+ 0.0.42
data/bin/bluepill CHANGED
@@ -28,7 +28,7 @@ OptionParser.new do |opts|
28
28
  options[:privileged] = v
29
29
  end
30
30
 
31
- help = lambda do
31
+ help = proc do
32
32
  puts opts
33
33
  puts
34
34
  puts "Commands:"
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.40"
8
+ s.version = "0.0.42"
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-21}
12
+ s.date = %q{2010-08-23}
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/dsl.rb CHANGED
@@ -69,12 +69,18 @@ module Bluepill
69
69
  process
70
70
  end
71
71
  end
72
-
73
72
  app_proxy = Class.new do
74
- @@app = app
75
- @@process_proxy = process_proxy
76
- @@process_keys = Hash.new # because I don't want to require Set just for validations
77
- @@pid_files = Hash.new
73
+ if RUBY_VERSION >= '1.9'
74
+ class_variable_set(:@@app, app)
75
+ class_variable_set(:@@process_proxy, process_proxy)
76
+ class_variable_set(:@@process_keys, Hash.new) # because I don't want to require Set just for validations
77
+ class_variable_set(:@@pid_files, Hash.new)
78
+ else
79
+ @@app = app
80
+ @@process_proxy = process_proxy
81
+ @@process_keys = Hash.new
82
+ @@pid_files = Hash.new
83
+ end
78
84
  attr_accessor :working_dir, :uid, :gid, :environment
79
85
 
80
86
  def validate_process(process, process_name)
@@ -68,7 +68,7 @@ module Bluepill
68
68
  to_daemonize = lambda do
69
69
  # Setting end PWD env emulates bash behavior when dealing with symlinks
70
70
  Dir.chdir(ENV["PWD"] = options[:working_dir]) if options[:working_dir]
71
- options[:environment].each { |key, value| ENV[key] = value } if options[:environment]
71
+ options[:environment].each { |key, value| ENV[key.to_s] = value.to_s } if options[:environment]
72
72
 
73
73
  redirect_io(*options.values_at(:stdin, :stdout, :stderr))
74
74
 
@@ -115,7 +115,7 @@ module Bluepill
115
115
  drop_privileges(options[:uid], options[:gid])
116
116
 
117
117
  Dir.chdir(ENV["PWD"] = options[:working_dir]) if options[:working_dir]
118
- options[:environment].each { |key, value| ENV[key] = value } if options[:environment]
118
+ options[:environment].each { |key, value| ENV[key.to_s] = value.to_s } if options[:environment]
119
119
 
120
120
  # close unused fds so ancestors wont hang. This line is the only reason we are not
121
121
  # using something like popen3. If this fd is not closed, the .read call on the parent
@@ -1,3 +1,3 @@
1
1
  module Bluepill
2
- VERSION = "0.0.40"
2
+ VERSION = "0.0.42"
3
3
  end
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: 79
4
+ hash: 75
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 40
10
- version: 0.0.40
9
+ - 42
10
+ version: 0.0.42
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-21 00:00:00 -07:00
20
+ date: 2010-08-23 00:00:00 -07:00
21
21
  default_executable: bluepill
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency