bake-gem 0.13.0 → 0.14.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/gem/release/version.rb +1 -1
- data/bake/gem/release.rb +1 -1
- data/bake/gem.rb +9 -3
- data/lib/bake/gem/helper.rb +19 -3
- data/lib/bake/gem/shell.rb +4 -1
- data/lib/bake/gem/version.rb +2 -2
- data/lib/bake/gem.rb +1 -1
- data/license.md +1 -1
- data/readme.md +20 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -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: c8159704892dcd4d98b3562f7c4867a24e4efa26936dbda61f125e1d50173eea
|
|
4
|
+
data.tar.gz: 4c0001d022cef9b2a9a8eeae6d7a7a90e10b42a11cdb6311cbed87d6b2817db6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd14d2adc3026d423bc75826dcfc4d8fde6777c0df54d68fe6ba0a995e84081748a48e981317fb7312a9cffff81eaa7557d4070fc67ca8c3547d98525bc0329f
|
|
7
|
+
data.tar.gz: f9e1951d82b11086f3c05c77098d2b6b3ac12a51ead185e809874eaf88e85b15a6877fb8da89eea05e119039f4cc0b3feef898b157f09de93c5d36dc4532623b
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/bake/gem/release/version.rb
CHANGED
data/bake/gem/release.rb
CHANGED
data/bake/gem.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-
|
|
4
|
+
# Copyright, 2021-2026, by Samuel Williams.
|
|
5
5
|
# Copyright, 2025, by Copilot.
|
|
6
6
|
|
|
7
7
|
# Initialize the gem context with helper for gem operations.
|
|
@@ -31,8 +31,14 @@ end
|
|
|
31
31
|
# Build and install the gem into system gems.
|
|
32
32
|
# @parameter local [Boolean] only use locally available caches.
|
|
33
33
|
def install(local: false)
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
changes = @helper.uncommitted_changes
|
|
35
|
+
|
|
36
|
+
if changes.any?
|
|
37
|
+
Console.warn(self, "Installing from clean git worktree; uncommitted changes are not included in the installed gem.", changes: changes.map(&:chomp))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# For installing the gem, don't bother with signing it:
|
|
41
|
+
path = @helper.build_gem_in_worktree(signing_key: false)
|
|
36
42
|
|
|
37
43
|
arguments = []
|
|
38
44
|
arguments << "--local" if local
|
data/lib/bake/gem/helper.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-
|
|
4
|
+
# Copyright, 2021-2026, by Samuel Williams.
|
|
5
5
|
# Copyright, 2025, by Copilot.
|
|
6
6
|
|
|
7
7
|
require "rubygems"
|
|
@@ -103,7 +103,17 @@ module Bake
|
|
|
103
103
|
# @returns [String | Nil] The path to the version file, or nil if not found.
|
|
104
104
|
def version_path
|
|
105
105
|
if @gemspec
|
|
106
|
-
@gemspec.files.grep(/lib(.*?)\/version.rb/)
|
|
106
|
+
candidates = @gemspec.files.grep(/lib(.*?)\/version.rb/)
|
|
107
|
+
|
|
108
|
+
# If only one version file exists, use it:
|
|
109
|
+
return candidates.first if candidates.size == 1
|
|
110
|
+
|
|
111
|
+
# Try to match the gem name convention (e.g., "protocol-rack" -> "lib/protocol/rack/version.rb"):
|
|
112
|
+
expected_path = "lib/#{@gemspec.name.gsub('-', '/')}/version.rb"
|
|
113
|
+
return expected_path if candidates.include?(expected_path)
|
|
114
|
+
|
|
115
|
+
# Fall back to the shortest path (most likely to be the main gem version):
|
|
116
|
+
return candidates.min_by(&:length)
|
|
107
117
|
end
|
|
108
118
|
end
|
|
109
119
|
|
|
@@ -141,7 +151,7 @@ module Bake
|
|
|
141
151
|
# @returns [Boolean] True if the repository is clean.
|
|
142
152
|
# @raises [RuntimeError] If there are uncommitted changes in the repository.
|
|
143
153
|
def guard_clean
|
|
144
|
-
lines =
|
|
154
|
+
lines = uncommitted_changes
|
|
145
155
|
|
|
146
156
|
if lines.any?
|
|
147
157
|
raise "Repository has uncommited changes!\n#{lines.join('')}"
|
|
@@ -150,6 +160,12 @@ module Bake
|
|
|
150
160
|
return true
|
|
151
161
|
end
|
|
152
162
|
|
|
163
|
+
# Get the list of uncommitted changes in the repository.
|
|
164
|
+
# @returns [Array(String)] The porcelain status lines for uncommitted changes.
|
|
165
|
+
def uncommitted_changes
|
|
166
|
+
readlines("git", "status", "--porcelain", chdir: @root)
|
|
167
|
+
end
|
|
168
|
+
|
|
153
169
|
# Verify that the last commit was not a version bump.
|
|
154
170
|
# @returns [Boolean] True if the last commit was not a version bump.
|
|
155
171
|
# @raises [RuntimeError] If the last commit was a version bump.
|
data/lib/bake/gem/shell.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-
|
|
4
|
+
# Copyright, 2021-2026, by Samuel Williams.
|
|
5
5
|
# Copyright, 2025, by Copilot.
|
|
6
6
|
|
|
7
7
|
require "console"
|
|
@@ -11,6 +11,9 @@ module Bake
|
|
|
11
11
|
module Gem
|
|
12
12
|
# Exception raised when a command execution fails.
|
|
13
13
|
class CommandExecutionError < RuntimeError
|
|
14
|
+
# Initialize the exception with the specified message and process status.
|
|
15
|
+
# @parameter message [String] The error message.
|
|
16
|
+
# @parameter status [Process::Status] The status object of the failed command.
|
|
14
17
|
def initialize(message, status)
|
|
15
18
|
super(message)
|
|
16
19
|
@status = status
|
data/lib/bake/gem/version.rb
CHANGED
data/lib/bake/gem.rb
CHANGED
data/license.md
CHANGED
data/readme.md
CHANGED
|
@@ -14,6 +14,10 @@ Please see the [project documentation](https://ioquatix.github.io/bake-gem/) for
|
|
|
14
14
|
|
|
15
15
|
Please see the [project releases](https://ioquatix.github.io/bake-gem/releases/index) for all releases.
|
|
16
16
|
|
|
17
|
+
### v0.13.1
|
|
18
|
+
|
|
19
|
+
- Better `version.rb` detection in `version_path` method.
|
|
20
|
+
|
|
17
21
|
### v0.13.0
|
|
18
22
|
|
|
19
23
|
- Add `after_gem_release` hook for post-release actions.
|
|
@@ -54,6 +58,22 @@ We welcome contributions to this project.
|
|
|
54
58
|
4. Push to the branch (`git push origin my-new-feature`).
|
|
55
59
|
5. Create new Pull Request.
|
|
56
60
|
|
|
61
|
+
### Running Tests
|
|
62
|
+
|
|
63
|
+
To run the test suite:
|
|
64
|
+
|
|
65
|
+
``` shell
|
|
66
|
+
bundle exec sus
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Making Releases
|
|
70
|
+
|
|
71
|
+
To make a new release:
|
|
72
|
+
|
|
73
|
+
``` shell
|
|
74
|
+
bundle exec bake gem:release:patch # or minor or major
|
|
75
|
+
```
|
|
76
|
+
|
|
57
77
|
### Developer Certificate of Origin
|
|
58
78
|
|
|
59
79
|
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|