procodile 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '08e686a096345f3522112998618bf86e470624e5'
4
- data.tar.gz: 15432576aae3bb463a987fe91f31a8ad68309583
3
+ metadata.gz: 3efcb781b257140b9018f9e7dfc1b841ad9be467
4
+ data.tar.gz: 2778571ca5b2dd6525090434aa7f0999950dbb97
5
5
  SHA512:
6
- metadata.gz: 0ab3208e3e3f6a16f9a00d555981caaa4dac0d16fbe2973e2f03d1d2dfc35ef68da1c3141f8b218fc173a846bf61107c447e2923278dfc0d31260a257c177a60
7
- data.tar.gz: bdb05ad0b32b565c829ffb1117b115873b2213ac7b9e5e755e5187f47637c774b712421460031685452bc458bd863f45632f2ca0938f648f7454df8e744a0bc9
6
+ metadata.gz: 5f5a372edc34fa2282cb1a59d166866d51320c623e45d5d47206f431be67b6b8070d69d15fc5ef0dcf37a9a94d312dc103f549974fe75f8f2315800ee281763b
7
+ data.tar.gz: 19295ee0becef4df9867e72a1c5355810545b6f172e309dcaeb99d9f7cd7c5c3789afc57d26e1e8580a661b09f3bed9a2cd146c2fb4394f32ca7310d245bb5e2
@@ -306,6 +306,10 @@ module Procodile
306
306
  cli.options[:json] = true
307
307
  end
308
308
 
309
+ opts.on("--json-pretty", "Return the status as a JSON hash printed nicely") do
310
+ cli.options[:json_pretty] = true
311
+ end
312
+
309
313
  opts.on("--simple", "Return overall status") do
310
314
  cli.options[:simple] = true
311
315
  end
@@ -315,6 +319,8 @@ module Procodile
315
319
  status = ControlClient.run(@config.sock_path, 'status')
316
320
  if @options[:json]
317
321
  puts status.to_json
322
+ elsif @options[:json_pretty]
323
+ puts JSON.pretty_generate(status)
318
324
  elsif @options[:simple]
319
325
  if status['messages'].empty?
320
326
  message = status['instances'].map { |p,i| "#{p}[#{i.size}]" }
@@ -28,6 +28,8 @@ module Procodile
28
28
  @processes = process_list.each_with_index.each_with_object({}) do |((name, command), index), hash|
29
29
  hash[name] = create_process(name, command, COLORS[index.divmod(COLORS.size)[1]])
30
30
  end
31
+
32
+ @loaded_at = Time.now
31
33
  end
32
34
 
33
35
  def reload
@@ -36,6 +38,7 @@ module Procodile
36
38
  @process_options = nil
37
39
  @local_options = nil
38
40
  @local_process_options = nil
41
+ @loaded_at = nil
39
42
 
40
43
  if @processes
41
44
  process_list.each do |name, command|
@@ -62,12 +65,17 @@ module Procodile
62
65
  end
63
66
  end
64
67
  end
68
+ @loaded_at = Time.now
65
69
  end
66
70
 
67
71
  def root
68
72
  @root
69
73
  end
70
74
 
75
+ def loaded_at
76
+ @loaded_at
77
+ end
78
+
71
79
  def user
72
80
  local_options['user'] || options['user']
73
81
  end
@@ -57,7 +57,6 @@ module Procodile
57
57
  "200 #{result.to_json}"
58
58
  end
59
59
 
60
-
61
60
  def status(options)
62
61
  instances = {}
63
62
  @supervisor.processes.each do |process, process_instances|
@@ -76,7 +75,15 @@ module Procodile
76
75
  :supervisor => @supervisor.to_hash,
77
76
  :instances => instances,
78
77
  :processes => processes,
79
- :environment_variables => @supervisor.config.environment_variables
78
+ :environment_variables => @supervisor.config.environment_variables,
79
+ :procfile_path => @supervisor.config.procfile_path,
80
+ :options_path => @supervisor.config.options_path,
81
+ :local_options_path => @supervisor.config.local_options_path,
82
+ :sock_path => @supervisor.config.sock_path,
83
+ :log_root => @supervisor.config.log_root,
84
+ :supervisor_pid_path => @supervisor.config.supervisor_pid_path,
85
+ :pid_root => @supervisor.config.pid_root,
86
+ :loaded_at => @supervisor.config.loaded_at.to_i,
80
87
  }
81
88
  "200 #{result.to_json}"
82
89
  end
@@ -9,7 +9,7 @@ module Procodile
9
9
  mutex.synchronize do
10
10
  text.to_s.lines.map(&:chomp).each do |message|
11
11
  output = ""
12
- output += "#{Time.now.strftime("%H:%M:%S")} #{name.ljust(15, ' ')} | ".color(color)
12
+ output += "#{Time.now.strftime("%H:%M:%S")} #{name.ljust(18, ' ')} | ".color(color)
13
13
  output += message
14
14
  $stdout.puts output
15
15
  $stdout.flush
@@ -1,3 +1,3 @@
1
1
  module Procodile
2
- VERSION = '1.0.21'
2
+ VERSION = '1.0.22'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procodile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.21
4
+ version: 1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-25 00:00:00.000000000 Z
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: Run Ruby/Rails processes in the background on Linux servers with ease.
27
+ description: A sophisticated process manager for applications running on Linux & macOS.
28
28
  email:
29
29
  - me@adamcooke.io
30
30
  executables:
@@ -73,6 +73,6 @@ rubyforge_project:
73
73
  rubygems_version: 2.5.2.3
74
74
  signing_key:
75
75
  specification_version: 4
76
- summary: This gem will help you run Ruby processes from a Procfile on Linux servers
77
- in the background.
76
+ summary: This gem will help you run processes from a Procfile on Linux/macOS machines
77
+ in the background or the foreground.
78
78
  test_files: []