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 +4 -4
- data/auto_scale_workers.gemspec +2 -2
- data/lib/auto_scale_workers/version.rb +1 -1
- data/publish_gem.rb +45 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ed08cc6c8840fadb13b33a2a263d577edba69bd0e9fce9f76e2d4f44526fa5
|
4
|
+
data.tar.gz: 974270334afcaad4a17be54c6c7171b8ef680ed30f3165e7ffa230775c5af591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 686a0f1c837c2cc5daee31ae9c67e4bac4f72cb8e6cf0142a2c186f0ea832ca4379d9429abd45b31dad20a9c64c1f17aa27cb195b4b55917083cae8aab43ed9b
|
7
|
+
data.tar.gz: afc14522e81cd84d535fdd49d5161938c6266a420121547f7211af7f95f088620b11c6b8b4bc105ce64005e4d083713efe73967e923e3acc0d80f2f96c2e8430
|
data/auto_scale_workers.gemspec
CHANGED
@@ -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
|
12
|
-
spec.description =
|
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"
|
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.
|
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:
|
56
|
-
|
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
|
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: []
|