auto_scale_workers 0.1.0 → 0.3.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: f720d1618ea0b36d1b93bbf9e9d57abc7dfb3332573bc73016e7e1695804d7ea
4
+ data.tar.gz: a331220d93b33461c578102701c3868c81c5233823dcd7e1d5ed73fa109afff7
5
5
  SHA512:
6
- metadata.gz: be7309b0395624776ee86371f1622b09518efe9927655a2b4c8de86ff562d9e0439bfa4d7079fc3c621f8ef1785c4e09f32c65bb6f02b4a818bd013344754657
7
- data.tar.gz: dec42bdb069127eebae7ff9c83a726f29d7c209ce32c979303f2b33074bec9ccf4581fafbd12bd65f7a70acfc5ba980f3bef0c01271b407c73cb498d62c8c665
6
+ metadata.gz: 11144438f456e6ac51400f4b6b2c4a2b7099d34c6e641aefbf73a7dfec25ccf2846b871d8614994c39344a7a837afe8c0ec5f2b0e1f6eb1a60ce0fc7371cd154
7
+ data.tar.gz: 4327c945fff360b527c98d2ae4ec488ac2651bca0ce6117b7e1c1177421e479bc1fa63e19429617ef0574604ddb9c7fedfe7fa008ac83d50accfc47a06fd7440
@@ -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.3.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.3.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: []