puma-status 1.0 → 1.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/lib/core.rb +1 -1
  3. data/lib/puma-status.rb +14 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f95a656741b1b1aafddb43954a144399db944b78ca6384e9ec77cc0783ca750
4
- data.tar.gz: a1b2f9addd173d84404bb94e26ec38522586d72fca0e190562d86d9a3e95b92a
3
+ metadata.gz: 12ca14da024cebc278c903552c9bfe21afccfabec8baea2972ac4b3e7b241ab1
4
+ data.tar.gz: f738a71b63d55124ee43e921f69f9d81295360c9d43925716ed0bb3716751907
5
5
  SHA512:
6
- metadata.gz: a44a39a95544ba5a9cd42b4e87ac2409a5b0c3623dad6af622c7a589be755c91ab26af03daf7a7304d2ba0da8e9a216a6a850dd5409e7f75d8eee2e5a6c79a23
7
- data.tar.gz: a344489b4164ff044ff37ac39b4cfaab7a9f4ea74fe2c1cc12a6c124d3804a94260423c2be8ca12d02b42f30754a30f630de8bf93cd723a12385a6b7dad211a6
6
+ metadata.gz: 4b96bb8f8ebd7776dd6a3b023c533e53638bf63da61efe5e5c9abb9111ff0ad05aa615584ffa3a804e00ddc1d7cc8cabbec46be677044139e97b722a60eb7f62
7
+ data.tar.gz: e136edb4aed4f52dc06ecda5e48b43b4c92e13b79619277c0d63cc4ac960009855ec4a8d475fe8c23721e0164799b6692f4863b506ac2eb7cf5039551d723af6
@@ -9,7 +9,7 @@ def get_stats(state_file_path)
9
9
  puma_state = YAML.load_file(state_file_path)
10
10
 
11
11
  uri = URI.parse(puma_state["control_url"])
12
-
12
+
13
13
  address = if uri.scheme =~ /unix/i
14
14
  [uri.scheme, '://', uri.host, uri.path].join
15
15
  else
@@ -17,11 +17,21 @@ def run
17
17
  begin
18
18
  debug "State file: #{state_file_path}"
19
19
  format_stats(get_stats(state_file_path))
20
- rescue Errno::ENOENT
21
- errors << "#{warn(state_file_path)} doesn't exists"
20
+ rescue Errno::ENOENT => e
21
+ if e.message =~ /#{state_file_path}/
22
+ errors << "#{warn(state_file_path)} doesn't exists"
23
+ elsif e.message =~ /connect\(2\) for [^\/]/
24
+ errors << "#{warn("Relative Unix socket")}: the Unix socket of the control app has a relative path. Please, ensure you are running from the same folder has puma."
25
+ else
26
+ errors << "#{error(state_file_path)} an unhandled error occured: #{e.inspect}"
27
+ end
22
28
  nil
23
- rescue Errno::EISDIR
24
- errors << "#{warn(state_file_path)} isn't a state file"
29
+ rescue Errno::EISDIR => e
30
+ if e.message =~ /#{state_file_path}/
31
+ errors << "#{warn(state_file_path)} isn't a state file"
32
+ else
33
+ errors << "#{error(state_file_path)} an unhandled error occured: #{e.inspect}"
34
+ end
25
35
  nil
26
36
  rescue => e
27
37
  errors << "#{error(state_file_path)} an unhandled error occured: #{e.inspect}"
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: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoann Lecuyer