auto_scale_workers 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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: f720d1618ea0b36d1b93bbf9e9d57abc7dfb3332573bc73016e7e1695804d7ea
|
4
|
+
data.tar.gz: a331220d93b33461c578102701c3868c81c5233823dcd7e1d5ed73fa109afff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11144438f456e6ac51400f4b6b2c4a2b7099d34c6e641aefbf73a7dfec25ccf2846b871d8614994c39344a7a837afe8c0ec5f2b0e1f6eb1a60ce0fc7371cd154
|
7
|
+
data.tar.gz: 4327c945fff360b527c98d2ae4ec488ac2651bca0ce6117b7e1c1177421e479bc1fa63e19429617ef0574604ddb9c7fedfe7fa008ac83d50accfc47a06fd7440
|
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.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:
|
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: []
|