Sutto-perennial 0.2.3.4 → 0.2.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -98,9 +98,9 @@ class Class
98
98
  ns = Perennial::Manifest.namespace
99
99
  return if ns.blank?
100
100
  mixins.each do |mixin|
101
- real_name = mixin.to_s.camelize
102
- if ns.const_defined?(real_name)
103
- include ns.const_get(real_name)
101
+ begin
102
+ include ns.const_get(mixin.to_s.camelize)
103
+ rescue NameError
104
104
  end
105
105
  end
106
106
  end
@@ -62,9 +62,9 @@ module Perennial
62
62
  # the double fork approach. Also, changes process file
63
63
  # mask to 000 and reopens STDIN / OUT to /dev/null
64
64
  def daemonize!
65
- exit if fork
65
+ fork_off_and_die
66
66
  Process.setsid
67
- exit if fork
67
+ fork_off_and_die
68
68
  self.write_pid
69
69
  File.umask 0000
70
70
  STDIN.reopen "/dev/null"
@@ -118,6 +118,13 @@ module Perennial
118
118
  File.open(f, "w+") { |f| f.puts pids.join("\n") }
119
119
  end
120
120
 
121
+ def fork_off_and_die
122
+ if pid = fork
123
+ Process.detach(pid)
124
+ exit
125
+ end
126
+ end
127
+
121
128
  end
122
129
  end
123
130
  end
data/lib/perennial.rb CHANGED
@@ -9,7 +9,7 @@ require 'perennial/exceptions'
9
9
 
10
10
  module Perennial
11
11
 
12
- VERSION = "0.2.3.4"
12
+ VERSION = "0.2.3.5"
13
13
 
14
14
  has_library :dispatchable, :hookable, :loader, :logger,
15
15
  :loggable, :manifest, :settings, :argument_parser,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Sutto-perennial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.4
4
+ version: 0.2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock
@@ -73,6 +73,7 @@ files:
73
73
  - templates/test_helper.erb
74
74
  has_rdoc: false
75
75
  homepage: http://sutto.net/
76
+ licenses:
76
77
  post_install_message:
77
78
  rdoc_options: []
78
79
 
@@ -93,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
94
  requirements: []
94
95
 
95
96
  rubyforge_project:
96
- rubygems_version: 1.2.0
97
+ rubygems_version: 1.3.5
97
98
  signing_key:
98
99
  specification_version: 3
99
100
  summary: A simple (generally event-oriented) application library for Ruby