daemonite 0.2.0 → 0.2.1

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 +4 -4
  2. data/daemonite.gemspec +1 -1
  3. data/lib/daemonite.rb +7 -7
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 110be5d9b8265d48d494af41bbf77147f4e3888d
4
- data.tar.gz: 3e5a0e19ce757b0ef8b9c0ed330c730b210825da
3
+ metadata.gz: d8dd415ba23cfc44e6fa21802971ccaac6797957
4
+ data.tar.gz: 74922ccfb54147bc3624da1bceff8c81b1cd3e29
5
5
  SHA512:
6
- metadata.gz: 1fc91737dab032004750c06f03c7da6df133657ecda5a88a0b52e431999e86ea60d3b92e914bc6fba74ee68af11da5eb39b8902a23f3a9d5c8993e04a5573bc4
7
- data.tar.gz: 25df84c14bd7d4f429be0e37faffe4bee2262d86d87f86d445b8a41747a845825457ee37738d19055c2168f6207d519bb1b73f84c03000fd0d0a6481cca97ab4
6
+ metadata.gz: 85e18b83a5e1efc943cac2393c2e8c6c342b6f521936fa730b054926b74695ae5d6647216e622f13a0d005d878b65676d1f4b8484938a920e4a34bbc9432c6dd
7
+ data.tar.gz: e9fc593596f15e36c4a32ddd05f851f209234d6e7c68286ec3da91b4d99b30269c99cd1a71cdebbf0342136994b7f4a52ff671e341d0c7acd64dd4c53fe50306
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "daemonite"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
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."
@@ -41,6 +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
45
  instance_exec(opts,&block) if block_given?
45
46
 
46
47
  ########################################################################################################################
@@ -70,7 +71,6 @@ module Daemonism
70
71
  @at_exit = nil
71
72
  end
72
73
  ########################################################################################################################
73
- opts[:repeat] = nil
74
74
  opts[:runtime_proc].call(opts) unless opts[:runtime_proc].nil?
75
75
 
76
76
  ########################################################################################################################
@@ -86,11 +86,11 @@ module Daemonism
86
86
  end
87
87
  end
88
88
  if opts[:cmdl_operation] == "info" && status.call == false
89
- puts "Server #{opts[:cmdl_info].nil? ? ' ' : '(' + opts[:cmdl_info].to_s + ') '}not running"
89
+ puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}not running"
90
90
  exit
91
91
  end
92
92
  if opts[:cmdl_operation] == "info" && status.call == true
93
- puts "Server #{opts[:cmdl_info].nil? ? ' ' : '(' + opts[:cmdl_info].to_s + ') '}running as #{pid}"
93
+ puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}running as #{pid}"
94
94
  begin
95
95
  stats = `ps -o "vsz,rss,lstart,time" -p #{pid}`.split("\n")[1].strip.split(/ +/)
96
96
  puts "Virtual: #{"%0.2f" % (stats[0].to_f/1024)} MiB"
@@ -102,7 +102,7 @@ module Daemonism
102
102
  exit
103
103
  end
104
104
  if %w{start}.include?(opts[:cmdl_operation]) && status.call == true
105
- puts "Server #{opts[:cmdl_info].nil? ? ' ' : '(' + opts[:cmdl_info].to_s + ') '}already started"
105
+ puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}already started"
106
106
  exit
107
107
  end
108
108
 
@@ -111,9 +111,9 @@ module Daemonism
111
111
  ########################################################################################################################
112
112
  if %w{stop restart}.include?(opts[:cmdl_operation])
113
113
  if status.call == false
114
- puts "Server #{opts[:cmdl_info].nil? ? ' ' : '(' + opts[:cmdl_info].to_s + ') '}maybe not started?"
114
+ puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}maybe not started?"
115
115
  else
116
- puts "Server #{opts[:cmdl_info].nil? ? ' ' : '(' + opts[:cmdl_info].to_s + ') '}stopped"
116
+ puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}stopped"
117
117
  puts "Waiting while server goes down ..."
118
118
  while status.call
119
119
  Process.kill "SIGTERM", pid
@@ -130,7 +130,7 @@ module Daemonism
130
130
  ro[2].call(status.call) if opts[:cmdl_operation] == ro[0]
131
131
  end
132
132
 
133
- puts "Server #{opts[:cmdl_info].nil? ? ' ' : '(' + opts[:cmdl_info].to_s + ') '}started as PID:#{Process.pid}"
133
+ puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}started as PID:#{Process.pid}"
134
134
  Process.daemon(opts[:basepath]) unless opts[:verbose]
135
135
  File.write(opts[:basepath] + '/' + opts[:pidfile],Process.pid) # after daemon, so that we get the forked pid
136
136
  Dir.chdir(opts[:basepath])
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.0
4
+ version: 0.2.1
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-24 00:00:00.000000000 Z
11
+ date: 2018-04-27 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