bake-modernize 0.54.0 → 0.55.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
- checksums.yaml.gz.sig +0 -0
- data/bake/modernize/decode.rb +28 -0
- data/bake/modernize/gemspec.rb +13 -3
- data/bake/modernize.rb +1 -0
- data/lib/bake/modernize/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data/template/actions/.github/workflows/documentation-coverage.yaml +1 -0
- data/template/decode/gems.rb +22 -0
- data.tar.gz.sig +0 -0
- metadata +3 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9939ca760f8cf47d60abb88db42503d28cc787c4782f30832aa5ae6884c8a28
|
|
4
|
+
data.tar.gz: 626c314ed2994774e8cd67c066adb35d6097bb4573bc2709916c75ddb38999cf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c50dddf6c5fa71a5616c6e02db2872eb2999199b2218ecfb13c9bddefccbb10455af9d640d488c4eb3098eb47544efc52487d3e4a2235ad520c95a459382656
|
|
7
|
+
data.tar.gz: ba7279eeb3a720ba13242e4d5e5215bcaf2a1a5a1bdd4a6f5d93586aa42defb3cd6a85271ebf5ab9ab7011a9e678c1935ffad9ff0fa5f3629b51ae9d816828e4
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2025-2026, by Samuel Williams.
|
|
5
|
+
|
|
6
|
+
require "bake/modernize"
|
|
7
|
+
|
|
8
|
+
DECODE_TEMPLATE_ROOT = Bake::Modernize.template_path_for("decode")
|
|
9
|
+
|
|
10
|
+
# Move the `decode` gem from the `test` group to the `maintenance` group.
|
|
11
|
+
#
|
|
12
|
+
# @parameter root [String] The root directory of the project.
|
|
13
|
+
def decode(root: Dir.pwd)
|
|
14
|
+
gems_path = File.join(root, "gems.rb")
|
|
15
|
+
|
|
16
|
+
return unless File.exist?(gems_path)
|
|
17
|
+
|
|
18
|
+
require "async/ollama"
|
|
19
|
+
|
|
20
|
+
existing = File.read(gems_path)
|
|
21
|
+
template = File.read(DECODE_TEMPLATE_ROOT + "gems.rb")
|
|
22
|
+
updated = Async::Ollama::Transform.call(existing,
|
|
23
|
+
model: "qwen3-coder:latest",
|
|
24
|
+
instruction: "Move the `decode` gem from the `test` group to the `maintenance` group. If the `decode` gem is not in a `test` group, leave the file unchanged. If there is no `maintenance` group, create one.",
|
|
25
|
+
template: template,
|
|
26
|
+
)
|
|
27
|
+
File.write(gems_path, updated)
|
|
28
|
+
end
|
data/bake/modernize/gemspec.rb
CHANGED
|
@@ -22,7 +22,7 @@ def update(path: default_gemspec_path, output: $stdout)
|
|
|
22
22
|
spec = ::Gem::Specification.load(path)
|
|
23
23
|
|
|
24
24
|
root = File.dirname(path)
|
|
25
|
-
version_path = version_path(root)
|
|
25
|
+
version_path = version_path(root, spec.name)
|
|
26
26
|
|
|
27
27
|
constant = File.read(version_path)
|
|
28
28
|
.scan(/(?:class|module)\s+(.*?)$/)
|
|
@@ -170,8 +170,18 @@ def default_gemspec_path
|
|
|
170
170
|
Dir["*.gemspec"].first
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
-
def version_path(root)
|
|
174
|
-
Dir["lib/**/version.rb", base: root]
|
|
173
|
+
def version_path(root, gem_name)
|
|
174
|
+
candidates = Dir["lib/**/version.rb", base: root]
|
|
175
|
+
|
|
176
|
+
# If only one version file exists, use it:
|
|
177
|
+
return candidates.first if candidates.size == 1
|
|
178
|
+
|
|
179
|
+
# Try to match the gem name convention (e.g., "protocol-rack" -> "lib/protocol/rack/version.rb"):
|
|
180
|
+
expected_path = "lib/#{gem_name.gsub('-', '/')}/version.rb"
|
|
181
|
+
return expected_path if candidates.include?(expected_path)
|
|
182
|
+
|
|
183
|
+
# Fall back to the shortest path (most likely to be the main gem version):
|
|
184
|
+
return candidates.min_by(&:length)
|
|
175
185
|
end
|
|
176
186
|
|
|
177
187
|
require "async"
|
data/bake/modernize.rb
CHANGED
data/readme.md
CHANGED
|
@@ -12,6 +12,10 @@ Please see the [project documentation](https://ioquatix.github.io/bake-modernize
|
|
|
12
12
|
|
|
13
13
|
Please see the [project releases](https://ioquatix.github.io/bake-modernize/releases/index) for all releases.
|
|
14
14
|
|
|
15
|
+
### v0.54.1
|
|
16
|
+
|
|
17
|
+
- Better `version.rb` detection in `modernize:gemspec`.
|
|
18
|
+
|
|
15
19
|
### v0.53.0
|
|
16
20
|
|
|
17
21
|
- Make `modernize:releases` part of the default `modernize` task.
|
data/releases.md
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gemspec
|
|
6
|
+
|
|
7
|
+
group :maintenance, optional: true do
|
|
8
|
+
gem "bake-gem"
|
|
9
|
+
gem "bake-releases"
|
|
10
|
+
|
|
11
|
+
gem "decode"
|
|
12
|
+
|
|
13
|
+
gem "utopia-project"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
group :test do
|
|
17
|
+
gem "sus"
|
|
18
|
+
gem "covered"
|
|
19
|
+
|
|
20
|
+
gem "bake-test"
|
|
21
|
+
gem "bake-test-external"
|
|
22
|
+
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bake-modernize
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.55.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -133,6 +133,7 @@ files:
|
|
|
133
133
|
- bake/modernize/contributing.rb
|
|
134
134
|
- bake/modernize/contributors.rb
|
|
135
135
|
- bake/modernize/copilot.rb
|
|
136
|
+
- bake/modernize/decode.rb
|
|
136
137
|
- bake/modernize/editorconfig.rb
|
|
137
138
|
- bake/modernize/gemfile.rb
|
|
138
139
|
- bake/modernize/gemspec.rb
|
|
@@ -154,6 +155,7 @@ files:
|
|
|
154
155
|
- template/actions/.github/workflows/test-external.yaml
|
|
155
156
|
- template/actions/.github/workflows/test.yaml
|
|
156
157
|
- template/copilot/.github/copilot-instructions.md
|
|
158
|
+
- template/decode/gems.rb
|
|
157
159
|
- template/editorconfig/.editorconfig
|
|
158
160
|
- template/git/.gitignore
|
|
159
161
|
- template/readme/readme.md
|
metadata.gz.sig
CHANGED
|
Binary file
|