puma_doctor 0.0.1 → 0.0.2

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
- SHA1:
3
- metadata.gz: 71aabad56a6b33023c08b80b5a51e3abd7019aac
4
- data.tar.gz: 0dbe0a44f19e7dbbdf7d587c8b6ec2562a9da3f0
2
+ SHA256:
3
+ metadata.gz: a4d7779c89964a27406f825666c8d0b66d5c59229ed5a8aca1fdd7320afbb327
4
+ data.tar.gz: a5266fccb10905f148b3c039647425518efecb1b2935ac6833a16e18cbd2bd7b
5
5
  SHA512:
6
- metadata.gz: 7a575219806300a993916df39ae762cbfd35a013cf93fc2dcf452169a28e09f77e6201d35ebd652e91a2d327f44d0477d7a693c5cd7924a37ae776cbbc95bada
7
- data.tar.gz: acb853b60daaedcff2f915e013879b5d8815c7ab1e7742977289e1266f8c0d6cc250d384eb664c2ca833d54a1f505d2f2c353b6bad7b36a3f5e3f95fb5bd79dc
6
+ metadata.gz: '08ebfe16659dc621aae8d3753aad335c38eb495a44184a5886793d7a6d4778db2daaf6fdaf36e3938f245585360df09f7cd243498efdfa540676ede557909719'
7
+ data.tar.gz: 979dde8be119435cd6d9ac74cf3ce4ed19df4a9cb85ae6d23441f67b37297d673e868b089804475201189993ad9b0562a429030bacb753e4ea50ee9e15acc3c9
data/README.md CHANGED
@@ -4,6 +4,20 @@ Inspired by ( https://github.com/schneems/puma_worker_killer ). Idea is to run
4
4
  separate process as a daemon to measure puma memory and restart worker when memory
5
5
  threshold reached.
6
6
 
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'puma_doctor'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install puma_doctor
20
+
7
21
  ## Usage
8
22
 
9
23
  ### Running from ruby code.
@@ -65,21 +79,6 @@ Available options with defaults:
65
79
 
66
80
  You can always see what `puma_doctor` is doing by reading logs.
67
81
 
68
-
69
- ## Installation
70
-
71
- Add this line to your application's Gemfile:
72
-
73
- gem 'puma_doctor'
74
-
75
- And then execute:
76
-
77
- $ bundle
78
-
79
- Or install it yourself as:
80
-
81
- $ gem install puma_doctor
82
-
83
82
  ## TODO
84
83
 
85
84
  Test
@@ -13,11 +13,7 @@ namespace :puma_doctor do
13
13
  desc 'Config daemon. Generate and send puma_doctor.rb'
14
14
  task :config do
15
15
  on roles(:app), in: :sequence, wait: 5 do
16
- path = File.expand_path("../daemon_template.rb.erb", __FILE__)
17
- if File.file?(path)
18
- erb = File.read(path)
19
- upload! StringIO.new(ERB.new(erb).result(binding)), fetch(:puma_doctor_daemon_file)
20
- end
16
+ config
21
17
  end
22
18
  end
23
19
 
@@ -25,7 +21,7 @@ namespace :puma_doctor do
25
21
  task :start do
26
22
  on roles(:app), in: :sequence, wait: 5 do
27
23
  within release_path do
28
- invoke 'puma_doctor:check'
24
+ config
29
25
  execute :bundle, :exec, :ruby, fetch(:puma_doctor_daemon_file), 'start'
30
26
  end
31
27
  end
@@ -35,7 +31,7 @@ namespace :puma_doctor do
35
31
  task :stop do
36
32
  on roles(:app), in: :sequence, wait: 5 do
37
33
  within release_path do
38
- invoke 'puma_doctor:check'
34
+ config
39
35
  execute :bundle, :exec, :ruby, fetch(:puma_doctor_daemon_file), 'stop'
40
36
  end
41
37
  end
@@ -45,7 +41,7 @@ namespace :puma_doctor do
45
41
  task :restart do
46
42
  on roles(:app), in: :sequence, wait: 5 do
47
43
  within release_path do
48
- invoke 'puma_doctor:check'
44
+ config
49
45
  execute :bundle, :exec, :ruby, fetch(:puma_doctor_daemon_file), 'restart'
50
46
  end
51
47
  end
@@ -54,9 +50,17 @@ namespace :puma_doctor do
54
50
  desc 'Check if config file exixts on server. If not - create and upload one.'
55
51
  task :check do
56
52
  on roles(:app), in: :sequence, wait: 5 do
57
- invoke 'puma_doctor:config' unless test "[ -f #{fetch(:puma_doctor_daemon_file)} ]"
53
+ config unless test "[ -f #{fetch(:puma_doctor_daemon_file)} ]"
58
54
  end
59
55
  end
60
56
 
61
57
  after 'deploy:finished', 'puma_doctor:restart'
58
+
59
+ def config
60
+ path = File.expand_path("../daemon_template.rb.erb", __FILE__)
61
+ if File.file?(path)
62
+ erb = File.read(path)
63
+ upload! StringIO.new(ERB.new(erb).result(binding)), fetch(:puma_doctor_daemon_file)
64
+ end
65
+ end
62
66
  end
@@ -1,3 +1,3 @@
1
1
  module PumaDoctor
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma_doctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Krasynskyi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2019-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons
@@ -104,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubyforge_project:
108
- rubygems_version: 2.2.0
107
+ rubygems_version: 3.0.1
109
108
  signing_key:
110
109
  specification_version: 4
111
110
  summary: Process to keep your puma workers healthy.