daemonite 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/daemonite.gemspec +1 -1
  3. data/lib/daemonite.rb +12 -4
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d8dd415ba23cfc44e6fa21802971ccaac6797957
4
- data.tar.gz: 74922ccfb54147bc3624da1bceff8c81b1cd3e29
2
+ SHA256:
3
+ metadata.gz: d3693b02cb092a8df074a832d0e3d452ca256ac735f07b64edb230dab5c9bd2e
4
+ data.tar.gz: 2ade323e0bcf2cdb07658d087b292c258dd627cbcf6362057acb6c0548bf1386
5
5
  SHA512:
6
- metadata.gz: 85e18b83a5e1efc943cac2393c2e8c6c342b6f521936fa730b054926b74695ae5d6647216e622f13a0d005d878b65676d1f4b8484938a920e4a34bbc9432c6dd
7
- data.tar.gz: e9fc593596f15e36c4a32ddd05f851f209234d6e7c68286ec3da91b4d99b30269c99cd1a71cdebbf0342136994b7f4a52ff671e341d0c7acd64dd4c53fe50306
6
+ metadata.gz: d037d2d8626b46fc92ee8029dc0d822e405032ccd998c0d42de444e0ae62ef1bd118b2dec931663a6395130ad1808bb81624d64862a776a209b3189158832a28
7
+ data.tar.gz: fa584bc13539dc02410cec2b7b71ced225c3cad9db63e683497239f4e9906d18b40c713b03babe59eb5226b3402a03cc1de18f23081f125d9c583db58fcf17a7
data/daemonite.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "daemonite"
3
- s.version = "0.2.1"
3
+ s.version = "0.3.0"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Daemonite - Process.daemon and argparse wrapper for loopies."
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[:repeat] = nil
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[:repeat] = block
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[:repeat].call(@opts)
164
- end unless @opts[:repeat].nil?
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.2.1
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-04-27 00:00:00.000000000 Z
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.6.6
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.