puma-status 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b7c4c76896b8d5f9b831403b258e7a377826767a18854292064e75a8eaf4974
4
- data.tar.gz: 49d28d79e5a509e91bd02e6d2a56ac50cbe33c4379d3ae5be404ff3d0e739293
3
+ metadata.gz: f4d3a61f4e72ae148d8debe88a983ecd0bf7d2953ef06a029c786bb99cd67172
4
+ data.tar.gz: 837e34c18531eba9841013afa5d2dd9894f8055df821e994a297e1193c40b3b0
5
5
  SHA512:
6
- metadata.gz: eb4396e097e5cdb2d35bc758c0a6de1ae2679e22cff729a5f0e10c6716068427d716640a223addde2ea07cb2df7ef65ad5ea7d88f32d95a3ae95ad6499f605d8
7
- data.tar.gz: 3b680055e5c4062f03cd7e8afb4c8c56b1c9afb20e0f070fe92c9ced43f015e61109a8dc49386d286f4bf95d0e96e8166ed70db69cc3a5cd1b7fbf8677168a57
6
+ metadata.gz: a555eee336a295db126fcffbbbd84af8a86fedcfe9b430bd778acd69e6395780bddeb784360b338569ec1d36b12af87531253031fd86bc5acdd882be37433fba
7
+ data.tar.gz: ed76d770e77983c41ddb0c9e300b1f96c5681e1e66ed36e830f8f7257447ea78c5dfdbf9f0de9ce5d8d3ea5ac20306d6fb48b3e7785c6107bc479580d9d6e4a4
data/bin/puma-status CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require './lib/puma-status'
3
+ require 'puma-status'
4
4
 
5
5
  run
data/lib/puma-status.rb CHANGED
@@ -3,6 +3,13 @@ require_relative './core.rb'
3
3
 
4
4
  def run
5
5
  debug "puma-status"
6
+
7
+ if ARGV.count != 1
8
+ puts "Call with:"
9
+ puts "\tpuma-status path/to/puma.state"
10
+ exit -1
11
+ end
12
+
6
13
  state_file_path = ARGV[0]
7
14
  debug "State file: #{state_file_path}"
8
15
  display_stats(get_stats(state_file_path))
data/lib/stats.rb CHANGED
@@ -43,6 +43,7 @@ class Stats
43
43
  end
44
44
 
45
45
  def uptime
46
+ return 0 unless @wstats.key?('started_at')
46
47
  (Time.now - Time.parse(@wstats['started_at'])).to_i
47
48
  end
48
49
 
@@ -82,6 +83,7 @@ class Stats
82
83
  end
83
84
 
84
85
  def uptime
86
+ return 0 unless @stats.key?('started_at')
85
87
  (Time.now - Time.parse(@stats['started_at'])).to_i
86
88
  end
87
89
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoann Lecuyer