auto_scale_workers 0.1.0 → 0.4.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: 9ab9be73b6e2b14e1a664574cb14bcbf20481e7d62d886efc0773732b80e189c
4
- data.tar.gz: 930a11f3e65bccf641a65be0bfb084e4ff76199199b2ac36bbce5d76be126739
3
+ metadata.gz: 11ed08cc6c8840fadb13b33a2a263d577edba69bd0e9fce9f76e2d4f44526fa5
4
+ data.tar.gz: 974270334afcaad4a17be54c6c7171b8ef680ed30f3165e7ffa230775c5af591
5
5
  SHA512:
6
- metadata.gz: be7309b0395624776ee86371f1622b09518efe9927655a2b4c8de86ff562d9e0439bfa4d7079fc3c621f8ef1785c4e09f32c65bb6f02b4a818bd013344754657
7
- data.tar.gz: dec42bdb069127eebae7ff9c83a726f29d7c209ce32c979303f2b33074bec9ccf4581fafbd12bd65f7a70acfc5ba980f3bef0c01271b407c73cb498d62c8c665
6
+ metadata.gz: 686a0f1c837c2cc5daee31ae9c67e4bac4f72cb8e6cf0142a2c186f0ea832ca4379d9429abd45b31dad20a9c64c1f17aa27cb195b4b55917083cae8aab43ed9b
7
+ data.tar.gz: afc14522e81cd84d535fdd49d5161938c6266a420121547f7211af7f95f088620b11c6b8b4bc105ce64005e4d083713efe73967e923e3acc0d80f2f96c2e8430
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["joseneto"]
9
9
  spec.email = ["jose.lopes.santos.neto@gmail.com"]
10
10
 
11
- spec.summary = "Gem to autoscale RORO Render workers using Sidekiq."
12
- spec.description = "This gem is used to feed the auto_scale_workers app with data to scale registered RENDER workers according to the queu size"
11
+ spec.summary = "Gem to autoscale (and downscale to ZERO) Rails Apps Sidekiq Workers Running on Render based on Queues Size"
12
+ spec.description = spec.summary
13
13
  spec.homepage = "https://mcfox.com.br"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 2.6.0"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AutoScaleWorkers
4
- VERSION = "0.1.0"
4
+ VERSION = '0.4.0'
5
5
  end
data/publish_gem.rb ADDED
@@ -0,0 +1,45 @@
1
+ # publish_gem.rb
2
+
3
+ def read_current_version
4
+ version_path = './lib/auto_scale_workers/version.rb'
5
+ version_content = File.read(version_path)
6
+ version_match = version_content.match(/VERSION\s*=\s*["'](\d+\.\d+\.\d+)["']/)
7
+ unless version_match
8
+ raise "Version not found in #{version_path}. Make sure it's specified as VERSION = 'x.y.z'."
9
+ end
10
+ current_version = version_match[1]
11
+ [current_version, version_path]
12
+ end
13
+
14
+ def increment_minor_version(version)
15
+ major, minor, patch = version.split('.').map(&:to_i)
16
+ "#{major}.#{minor + 1}.0"
17
+ end
18
+
19
+ def update_version_file(version_path, new_version)
20
+ content = File.read(version_path)
21
+ new_content = content.sub(/VERSION\s*=\s*["']\d+\.\d+\.\d+["']/, "VERSION = '#{new_version}'")
22
+ File.open(version_path, 'w') { |file| file.puts new_content }
23
+ end
24
+
25
+ def build_and_push_gem(new_version)
26
+ gemspec_path = Dir.glob('*.gemspec').first
27
+ system("gem build #{gemspec_path}")
28
+ gem_name = gemspec_path.split('/').last.sub('.gemspec', '')
29
+ gem_file = "#{gem_name}-#{new_version}.gem"
30
+ system("gem push #{gem_file}")
31
+ end
32
+
33
+ def new_version(current_version)
34
+ increment_minor_version(current_version)
35
+ end
36
+
37
+ begin
38
+ current_version, version_path = read_current_version
39
+ ver = new_version(current_version)
40
+ update_version_file(version_path, ver)
41
+ build_and_push_gem(ver)
42
+ puts "Published gem version #{ver} successfully!"
43
+ rescue => e
44
+ puts "Error: #{e.message}"
45
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_scale_workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - joseneto
@@ -52,8 +52,8 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: This gem is used to feed the auto_scale_workers app with data to scale
56
- registered RENDER workers according to the queu size
55
+ description: Gem to autoscale (and downscale to ZERO) Rails Apps Sidekiq Workers Running
56
+ on Render based on Queues Size
57
57
  email:
58
58
  - jose.lopes.santos.neto@gmail.com
59
59
  executables: []
@@ -72,6 +72,7 @@ files:
72
72
  - lib/auto_scale_workers/sidekiq_collector.rb
73
73
  - lib/auto_scale_workers/version.rb
74
74
  - publish.sh
75
+ - publish_gem.rb
75
76
  - sig/auto_scale_workers.rbs
76
77
  homepage: https://mcfox.com.br
77
78
  licenses:
@@ -99,5 +100,6 @@ requirements: []
99
100
  rubygems_version: 3.3.7
100
101
  signing_key:
101
102
  specification_version: 4
102
- summary: Gem to autoscale RORO Render workers using Sidekiq.
103
+ summary: Gem to autoscale (and downscale to ZERO) Rails Apps Sidekiq Workers Running
104
+ on Render based on Queues Size
103
105
  test_files: []