sevenwire-simple-daemon 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ = simple-daemon
2
+
3
+ == DESCRIPTION:
4
+
5
+ A simple, 78-line daemon module for Ruby. Adds daemon functionality to any Ruby class (start, stop, restart; pid file; logging). Built on a module by Sharon Rosner released to DZone Snippets.
@@ -1,5 +1,7 @@
1
- require 'simple-daemon/version'
1
+ require File.dirname(__FILE__)+'/simple-daemon/version'
2
2
  require 'fileutils'
3
+ require 'logger'
4
+
3
5
 
4
6
  module SimpleDaemon
5
7
 
@@ -16,6 +18,9 @@ module SimpleDaemon
16
18
  Controller.daemonize(self)
17
19
  end
18
20
 
21
+ def self.logger
22
+ @logger ||= Logger.new("#{SimpleDaemon::LOG_DIRECTORY}/#{classname}.log")
23
+ end
19
24
 
20
25
  private
21
26
 
@@ -65,12 +70,6 @@ module SimpleDaemon
65
70
  exit 1
66
71
  end
67
72
  PidFile.store(daemon, Process.pid)
68
- Dir.chdir SimpleDaemon::LOG_DIRECTORY
69
- File.umask 0000
70
- log = File.new("#{daemon.classname}.log", "a")
71
- STDIN.reopen "/dev/null"
72
- STDOUT.reopen log
73
- STDERR.reopen STDOUT
74
73
  trap("TERM") {daemon.stop; exit}
75
74
  daemon.start
76
75
  end
@@ -2,7 +2,7 @@ module SimpleDaemon #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevenwire-simple-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Dahl
@@ -32,6 +32,7 @@ extra_rdoc_files:
32
32
  - History.txt
33
33
  - License.txt
34
34
  - Manifest.txt
35
+ - README.markdown
35
36
  - README.txt
36
37
  - website/index.txt
37
38
  files:
@@ -39,6 +40,7 @@ files:
39
40
  - License.txt
40
41
  - Manifest.txt
41
42
  - README.markdown
43
+ - README.txt
42
44
  - Rakefile
43
45
  - lib/simple-daemon.rb
44
46
  - lib/simple-daemon/version.rb
@@ -52,7 +54,6 @@ files:
52
54
  - website/javascripts/rounded_corners_lite.inc.js
53
55
  - website/stylesheets/screen.css
54
56
  - website/template.rhtml
55
- - README.txt
56
57
  has_rdoc: true
57
58
  homepage: http://simple-daemon.rubyforge.org
58
59
  post_install_message: