daemonz 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/daemonz.gemspec CHANGED
@@ -1,59 +1,57 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{daemonz}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Victor Costan"]
12
- s.date = %q{2010-04-19}
12
+ s.date = %q{2011-04-10}
13
13
  s.email = %q{victor@costan.us}
14
14
  s.extra_rdoc_files = [
15
15
  "README.textile"
16
16
  ]
17
17
  s.files = [
18
18
  "MIT-LICENSE",
19
- "README.textile",
20
- "Rakefile",
21
- "VERSION",
22
- "config_template.yml",
23
- "daemonz.gemspec",
24
- "init.rb",
25
- "lib/daemonz.rb",
26
- "lib/daemonz/config.rb",
27
- "lib/daemonz/generators/config/config_generator.rb",
28
- "lib/daemonz/generators/config/templates/config.yml",
29
- "lib/daemonz/generators/config/templates/prepackaged/ferret.yml",
30
- "lib/daemonz/generators/config/templates/prepackaged/starling.yml",
31
- "lib/daemonz/generators/daemon/daemon_generator.rb",
32
- "lib/daemonz/generators/daemon/templates/config.yml",
33
- "lib/daemonz/generators/daemon/templates/daemon.rb.erb",
34
- "lib/daemonz/generators/daemon/templates/integration_test.rb.erb",
35
- "lib/daemonz/killer.rb",
36
- "lib/daemonz/logging.rb",
37
- "lib/daemonz/manage.rb",
38
- "lib/daemonz/master.rb",
39
- "lib/daemonz/process.rb",
40
- "lib/daemonz/railtie.rb",
41
- "lib/daemonz/tasks/daemonz_tasks.rake"
19
+ "README.textile",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "config_template.yml",
23
+ "daemonz.gemspec",
24
+ "init.rb",
25
+ "lib/daemonz.rb",
26
+ "lib/daemonz/config.rb",
27
+ "lib/daemonz/generators/config/config_generator.rb",
28
+ "lib/daemonz/generators/config/templates/config.yml",
29
+ "lib/daemonz/generators/config/templates/prepackaged/ferret.yml",
30
+ "lib/daemonz/generators/config/templates/prepackaged/starling.yml",
31
+ "lib/daemonz/generators/daemon/daemon_generator.rb",
32
+ "lib/daemonz/generators/daemon/templates/config.yml",
33
+ "lib/daemonz/generators/daemon/templates/daemon.rb.erb",
34
+ "lib/daemonz/generators/daemon/templates/integration_test.rb.erb",
35
+ "lib/daemonz/killer.rb",
36
+ "lib/daemonz/logging.rb",
37
+ "lib/daemonz/manage.rb",
38
+ "lib/daemonz/master.rb",
39
+ "lib/daemonz/process.rb",
40
+ "lib/daemonz/railtie.rb",
41
+ "lib/daemonz/tasks/daemonz_tasks.rake"
42
42
  ]
43
43
  s.homepage = %q{http://github.com/costan/daemonz}
44
- s.rdoc_options = ["--charset=UTF-8"]
45
44
  s.require_paths = ["lib"]
46
- s.rubygems_version = %q{1.3.6}
45
+ s.rubygems_version = %q{1.6.0}
47
46
  s.summary = %q{Automatically starts and stops the daemons in a Rails application}
48
47
  s.test_files = [
49
48
  "test/daemonz_test.rb"
50
49
  ]
51
50
 
52
51
  if s.respond_to? :specification_version then
53
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54
52
  s.specification_version = 3
55
53
 
56
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
54
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
57
55
  s.add_runtime_dependency(%q<simple-daemon>, [">= 0"])
58
56
  s.add_runtime_dependency(%q<zerg_support>, [">= 0"])
59
57
  else
@@ -19,7 +19,7 @@ module Daemonz
19
19
  if Daemonz.config[:is_master]
20
20
  Daemonz.configure_daemons
21
21
  Daemonz.start_daemons!
22
- end
22
+ end
23
23
  end
24
24
 
25
25
  # Complete shutdown used by rake:start and at Rails application exit.
@@ -39,21 +39,19 @@ module Daemonz
39
39
 
40
40
  # attempts to claim the master lock
41
41
  def self.claim_master
42
- loop do
43
- begin
44
- # try to grab that lock
45
- master_pid = grab_master_lock
46
- if master_pid
47
- logger.info "Daemonz in slave mode; PID #{master_pid} has master lock"
48
- return false
49
- else
50
- logger.info "Daemonz grabbed master lock"
51
- return true
52
- end
53
- #rescue Exception => e
54
- # logger.warn "Daemonz mastering failed: #{e.class.name} - #{e}"
55
- # logger.info "Retrying daemonz mastering"
42
+ begin
43
+ # try to grab that lock
44
+ master_pid = grab_master_lock
45
+ if master_pid
46
+ logger.info "Daemonz in slave mode; PID #{master_pid} has master lock"
47
+ return false
48
+ else
49
+ logger.info "Daemonz grabbed master lock"
50
+ return true
56
51
  end
52
+ rescue Exception => e
53
+ logger.warn "Daemonz mastering failed: #{e.class.name} - #{e}"
54
+ return false
57
55
  end
58
56
  end
59
57
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daemonz
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 21
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 2
9
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Victor Costan
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-04-19 00:00:00 -04:00
18
+ date: 2011-04-10 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: simple-daemon
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
@@ -33,9 +36,11 @@ dependencies:
33
36
  name: zerg_support
34
37
  prerelease: false
35
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
41
  - - ">="
38
42
  - !ruby/object:Gem::Version
43
+ hash: 3
39
44
  segments:
40
45
  - 0
41
46
  version: "0"
@@ -74,33 +79,38 @@ files:
74
79
  - lib/daemonz/process.rb
75
80
  - lib/daemonz/railtie.rb
76
81
  - lib/daemonz/tasks/daemonz_tasks.rake
82
+ - test/daemonz_test.rb
77
83
  has_rdoc: true
78
84
  homepage: http://github.com/costan/daemonz
79
85
  licenses: []
80
86
 
81
87
  post_install_message:
82
- rdoc_options:
83
- - --charset=UTF-8
88
+ rdoc_options: []
89
+
84
90
  require_paths:
85
91
  - lib
86
92
  required_ruby_version: !ruby/object:Gem::Requirement
93
+ none: false
87
94
  requirements:
88
95
  - - ">="
89
96
  - !ruby/object:Gem::Version
97
+ hash: 3
90
98
  segments:
91
99
  - 0
92
100
  version: "0"
93
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
+ none: false
94
103
  requirements:
95
104
  - - ">="
96
105
  - !ruby/object:Gem::Version
106
+ hash: 3
97
107
  segments:
98
108
  - 0
99
109
  version: "0"
100
110
  requirements: []
101
111
 
102
112
  rubyforge_project:
103
- rubygems_version: 1.3.6
113
+ rubygems_version: 1.6.0
104
114
  signing_key:
105
115
  specification_version: 3
106
116
  summary: Automatically starts and stops the daemons in a Rails application