daemonite 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/daemonite.gemspec +1 -1
- data/lib/daemonite.rb +12 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d3693b02cb092a8df074a832d0e3d452ca256ac735f07b64edb230dab5c9bd2e
|
4
|
+
data.tar.gz: 2ade323e0bcf2cdb07658d087b292c258dd627cbcf6362057acb6c0548bf1386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d037d2d8626b46fc92ee8029dc0d822e405032ccd998c0d42de444e0ae62ef1bd118b2dec931663a6395130ad1808bb81624d64862a776a209b3189158832a28
|
7
|
+
data.tar.gz: fa584bc13539dc02410cec2b7b71ced225c3cad9db63e683497239f4e9906d18b40c713b03babe59eb5226b3402a03cc1de18f23081f125d9c583db58fcf17a7
|
data/daemonite.gemspec
CHANGED
data/lib/daemonite.rb
CHANGED
@@ -41,7 +41,7 @@ module Daemonism
|
|
41
41
|
Dir.chdir(opts[:basepath])
|
42
42
|
|
43
43
|
# set more default options and do other stuff
|
44
|
-
opts[:
|
44
|
+
opts[:block] = nil
|
45
45
|
instance_exec(opts,&block) if block_given?
|
46
46
|
|
47
47
|
########################################################################################################################
|
@@ -154,14 +154,22 @@ class Daemonite
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def run(&block)
|
157
|
-
@opts[:
|
157
|
+
@opts[:block] = block
|
158
|
+
end
|
159
|
+
|
160
|
+
def go!
|
161
|
+
begin
|
162
|
+
@opts[:block].call(@opts)
|
163
|
+
rescue => e
|
164
|
+
puts "Server stopped due to error (PID:#{Process.pid})"
|
165
|
+
end
|
158
166
|
end
|
159
167
|
|
160
168
|
def loop!
|
161
169
|
begin
|
162
170
|
loop do
|
163
|
-
@opts[:
|
164
|
-
end unless @opts[:
|
171
|
+
@opts[:block].call(@opts)
|
172
|
+
end unless @opts[:block].nil?
|
165
173
|
rescue => e
|
166
174
|
puts "Server stopped due to error (PID:#{Process.pid})"
|
167
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daemonite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Daemonite - Process.daemon and argparse wrapper for loopies.
|
14
14
|
email: juergen.mangler@gmail.com
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
47
|
rubyforge_project:
|
48
|
-
rubygems_version: 2.
|
48
|
+
rubygems_version: 2.7.6
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: Daemonite - Process.daemon and argparse wrapper for loopies.
|