puma_dynamic_tags 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +34 -5
- data/lib/puma/plugin/dynamic_tags/version.rb +9 -0
- data/lib/puma/plugin/dynamic_tags.rb +4 -1
- data/puma_dynamic_tags.gemspec +6 -4
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 896b5ec11fd097860d01664a585115609cd4e92ea51f1ceb2b75eeae54a71de2
|
4
|
+
data.tar.gz: ed002a412487ef4521aff2b19c5e5e56754239ed8d9aaedb5d64fa9efc82744e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69a2a369fd9deb6ce68e60810f66621e2b7abe91f4e8e625711273ed560b0b21cafca1fbe5c9100ba86012ecd69ff25b7a5c323be512d340955f299c3e1f52f2
|
7
|
+
data.tar.gz: 232ec0741d9dbd51335973446f523c5941710a9841744a10483f871f5104a49824a38664bc26cb96457a2c320ef8e1387733c88982aa9860cbcb82d97d3c2abd
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puma_dynamic_tags (0.
|
4
|
+
puma_dynamic_tags (0.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -87,7 +87,7 @@ PLATFORMS
|
|
87
87
|
arm64-darwin-21
|
88
88
|
|
89
89
|
DEPENDENCIES
|
90
|
-
armitage-rubocop (
|
90
|
+
armitage-rubocop (~> 1.26)
|
91
91
|
bundler (~> 2.3)
|
92
92
|
pry (~> 0.14)
|
93
93
|
puma_dynamic_tags!
|
data/README.md
CHANGED
@@ -19,27 +19,56 @@ bundle install
|
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
+
Setup your puma application:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
# config.ru
|
26
|
+
|
27
|
+
# (example)
|
28
|
+
require "sinatra"
|
29
|
+
run Sinatra::Application
|
30
|
+
```
|
31
|
+
|
32
|
+
Enable `dynamic_tags` plugin and configure dynamic `tag` option:
|
33
|
+
|
22
34
|
```ruby
|
23
35
|
# config/puma.rb
|
24
|
-
plugin "
|
36
|
+
plugin "dynamic_tags"
|
37
|
+
|
38
|
+
# and now you can use dynamic tags:
|
25
39
|
|
26
40
|
tag do
|
27
|
-
"some_dynamic_result" # your dynamic code
|
41
|
+
"some_dynamic_result: #{Time.now}" # your dynamic code
|
28
42
|
end
|
29
43
|
```
|
30
44
|
|
31
45
|
and then:
|
32
46
|
|
33
47
|
```shell
|
34
|
-
puma
|
48
|
+
# run your puma in your favorite mode
|
49
|
+
bundle exec puma -t 8:32 -w 3
|
35
50
|
```
|
36
51
|
|
37
|
-
and then:
|
52
|
+
and then (check your process names):
|
38
53
|
|
39
54
|
```shell
|
40
|
-
|
55
|
+
puma 5.6.4 (tcp://0.0.0.0:9292) [some_dynamic_result: 2022-04-08 03:01:04 +0300] # <--- dynamic process name
|
56
|
+
puma: cluster worker 2: 38624 [some_dynamic_result: 2022-04-08 03:02:50 +0300] # <--- dynamic process name
|
57
|
+
puma: cluster worker 1: 38624 [some_dynamic_result: 2022-04-08 03:02:50 +0300] # <--- dynamic process name
|
58
|
+
puma: cluster worker 0: 38624 [some_dynamic_result: 2022-04-08 03:02:50 +0300] # <--- dynamic process name
|
41
59
|
```
|
42
60
|
|
61
|
+
and then (run phase-restart and check recalculated process names with your dynamic tag):
|
62
|
+
|
63
|
+
```shell
|
64
|
+
puma 5.6.4 (tcp://0.0.0.0:9292) [some_dynamic_result: 2022-04-08 03:01:04 +0300] # <--- each tag has been recalculated
|
65
|
+
puma: cluster worker 2: 38624 [some_dynamic_result: 2022-04-08 03:03:25 +0300] # <--- each tag has been recalculated
|
66
|
+
puma: cluster worker 1: 38624 [some_dynamic_result: 2022-04-08 03:03:25 +0300] # <--- each tag has been recalculated
|
67
|
+
puma: cluster worker 0: 38624 [some_dynamic_result: 2022-04-08 03:03:25 +0300] # <--- each tag has been recalculated
|
68
|
+
````
|
69
|
+
|
70
|
+
*Profit!*
|
71
|
+
|
43
72
|
## Contributing
|
44
73
|
|
45
74
|
- Fork it ( https://github.com/0exp/puma_dynamic_tags )
|
data/puma_dynamic_tags.gemspec
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative 'lib/puma/plugin/dynamic_tags/version'
|
4
|
+
|
3
5
|
Gem::Specification.new do |spec|
|
4
6
|
spec.required_ruby_version = '>= 2.6.0'
|
5
7
|
|
6
8
|
spec.name = 'puma_dynamic_tags'
|
7
|
-
spec.version =
|
9
|
+
spec.version = Puma::Plugin::DuynamicTags::VERSION
|
8
10
|
spec.authors = ['Rustam Ibragimov']
|
9
11
|
spec.email = ['exfivedaiver@gmail.com']
|
10
12
|
spec.homepage = 'https://github.com/0exp/puma_dynamic_tags'
|
11
13
|
spec.license = 'MIT'
|
12
14
|
|
13
15
|
spec.summary = <<~GEM_SUMMARY
|
14
|
-
puma_dynamic_tags - allows
|
16
|
+
puma_dynamic_tags - allows to use a dynamic tag puma's option calculated by a proc.
|
15
17
|
GEM_SUMMARY
|
16
18
|
spec.description = <<~GEM_DESCRIPTION
|
17
|
-
puma_dynamic_tags - allows to use a dynamic tag option calculated by proc.
|
19
|
+
puma_dynamic_tags - allows to use a dynamic tag puma's option calculated by a proc.
|
18
20
|
GEM_DESCRIPTION
|
19
21
|
|
20
22
|
spec.metadata['homepage_uri'] = spec.homepage
|
@@ -29,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
29
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
32
|
spec.require_paths = ['lib']
|
31
33
|
|
32
|
-
spec.add_development_dependency 'armitage-rubocop', '
|
34
|
+
spec.add_development_dependency 'armitage-rubocop', '~> 1.26'
|
33
35
|
spec.add_development_dependency 'bundler', '~> 2.3'
|
34
36
|
spec.add_development_dependency 'rake', '~> 13.0'
|
35
37
|
spec.add_development_dependency 'rspec', '~> 3.11'
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma_dynamic_tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Ibragimov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: armitage-rubocop
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.26
|
19
|
+
version: '1.26'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.26
|
26
|
+
version: '1.26'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,8 +94,8 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.14'
|
97
|
-
description: 'puma_dynamic_tags - allows to use a dynamic tag option calculated
|
98
|
-
proc.
|
97
|
+
description: 'puma_dynamic_tags - allows to use a dynamic tag puma''s option calculated
|
98
|
+
by a proc.
|
99
99
|
|
100
100
|
'
|
101
101
|
email:
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- bin/setup
|
119
119
|
- lib/puma/plugin/dynamic_tags.rb
|
120
120
|
- lib/puma/plugin/dynamic_tags/puma_patches.rb
|
121
|
+
- lib/puma/plugin/dynamic_tags/version.rb
|
121
122
|
- puma_dynamic_tags.gemspec
|
122
123
|
homepage: https://github.com/0exp/puma_dynamic_tags
|
123
124
|
licenses:
|
@@ -144,6 +145,6 @@ requirements: []
|
|
144
145
|
rubygems_version: 3.3.10
|
145
146
|
signing_key:
|
146
147
|
specification_version: 4
|
147
|
-
summary: puma_dynamic_tags - allows
|
148
|
-
a proc.
|
148
|
+
summary: puma_dynamic_tags - allows to use a dynamic tag puma's option calculated
|
149
|
+
by a proc.
|
149
150
|
test_files: []
|