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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cab9a8597dc26cd21fafcd3003f9dd09106fd827b6d37c4b8b70a92644ac59f3
4
- data.tar.gz: dcc0956fcd3c7acc4ba5e809c8342a929b7a59b3bf808ec05040a9deaa6eb657
3
+ metadata.gz: 896b5ec11fd097860d01664a585115609cd4e92ea51f1ceb2b75eeae54a71de2
4
+ data.tar.gz: ed002a412487ef4521aff2b19c5e5e56754239ed8d9aaedb5d64fa9efc82744e
5
5
  SHA512:
6
- metadata.gz: 796af3f02cdf2cdb0f94b0348a2833782c59eea50161c21674d3ec2b3283a94ae77098b6c264e3e609b63782c23865f0aff67fbe01879694ce1276216a852f2d
7
- data.tar.gz: f03091202c4e7a054d91aae8a230da5e61b875ff3ab0426445d4872c4474270d2cd91eb0506a55f61e552dd767b013e275621f2cb1dfb7fdce41fdb58094debc
6
+ metadata.gz: 69a2a369fd9deb6ce68e60810f66621e2b7abe91f4e8e625711273ed560b0b21cafca1fbe5c9100ba86012ecd69ff25b7a5c323be512d340955f299c3e1f52f2
7
+ data.tar.gz: 232ec0741d9dbd51335973446f523c5941710a9841744a10483f871f5104a49824a38664bc26cb96457a2c320ef8e1387733c88982aa9860cbcb82d97d3c2abd
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ *.gem
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.2.0] - 2022-04-08
5
+
6
+ - Initial release
7
+
4
8
  ## [0.1.2] - 2022-04-08
5
9
 
6
10
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puma_dynamic_tags (0.1.2)
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 (>= 1.26.1.1)
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 "puma_dynamic_tags"
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
- pas aux | grep puma
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 )
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Puma
4
+ class Plugin
5
+ module DuynamicTags
6
+ VERSION = '0.2.0'
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Puma::Plugin.create { require_relative 'dynamic_tags/puma_patches' }
3
+ Puma::Plugin.create do
4
+ require_relative 'dynamic_tags/puma_patches'
5
+ require_relative 'dynamic_tags/version'
6
+ end
@@ -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 = '0.1.2'
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 you to use a dynamic tag option calculated by a proc.
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', '>= 1.26.1.1'
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.1.2
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-07 00:00:00.000000000 Z
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.1.1
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.1.1
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 by
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 you to use a dynamic tag option calculated by
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: []