sashimi_tanpopo 0.3.2 → 0.3.4
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/CHANGELOG.md +21 -9
- data/Dockerfile +1 -1
- data/lib/sashimi_tanpopo/dsl.rb +37 -19
- data/lib/sashimi_tanpopo/version.rb +1 -1
- data/rbs_collection.lock.yaml +4 -0
- data/sig/sashimi_tanpopo/dsl.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32c85eb518fc708ee605fc416ed159cdb54762a036fb62f2172cf7bb7f09253e
|
|
4
|
+
data.tar.gz: e38e61ab6353d5160fa25683acb79bdacbfa612b41429fafae26d20675bd383c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f81582f540a40fb63aba094d8dfc9654116fddc1e42b792a94ccafa1556be4127811217cbd6a9c3d8f5399667348b152241fa8f0802bd9dd7abe5ad18a78135
|
|
7
|
+
data.tar.gz: cba55fb39a6d0d0f5689e1064f0c721cc0e452b255f6719db0c41a75384f497ee914c8180d2d5f970950a8e0602b9c2e7e3229f9ba9e4fa5d4837df69bf47935
|
data/CHANGELOG.md
CHANGED
|
@@ -1,48 +1,60 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
|
-
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.
|
|
2
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.4...main)
|
|
3
3
|
|
|
4
|
-
## [
|
|
4
|
+
## [v0.3.4](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.3.4) - 2025-11-30
|
|
5
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.3...v0.3.4)
|
|
6
|
+
|
|
7
|
+
* Release gem from GitHub Actions
|
|
8
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/73
|
|
9
|
+
|
|
10
|
+
## [v0.3.3](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.3.3) - 2025-11-05
|
|
11
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.2...v0.3.3)
|
|
12
|
+
|
|
13
|
+
* Fixed an issue where file was not updated when `update_file` was called multiple times on the same file
|
|
14
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/70
|
|
15
|
+
|
|
16
|
+
## [v0.3.2](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.3.2) - 2025-11-02
|
|
5
17
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.1...v0.3.2)
|
|
6
18
|
|
|
7
19
|
* Do not remove left-hand space in logger
|
|
8
20
|
* https://github.com/sue445/sashimi_tanpopo/pull/68
|
|
9
21
|
|
|
10
|
-
## [
|
|
22
|
+
## [v0.3.1](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.3.1) - 2025-10-31
|
|
11
23
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.3.0...v0.3.1)
|
|
12
24
|
|
|
13
25
|
* Disable file existence checks when using `--github-step-summary`
|
|
14
26
|
* https://github.com/sue445/sashimi_tanpopo/pull/66
|
|
15
27
|
|
|
16
|
-
## [
|
|
28
|
+
## [v0.3.0](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.3.0) - 2025-10-30
|
|
17
29
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.2.0...v0.3.0)
|
|
18
30
|
|
|
19
31
|
* Support GitHub Actions Job Summary
|
|
20
32
|
* https://github.com/sue445/sashimi_tanpopo/pull/62
|
|
21
33
|
|
|
22
|
-
## [
|
|
34
|
+
## [v0.2.0](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.2.0) - 2025-10-22
|
|
23
35
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.1.3...v0.2.0)
|
|
24
36
|
|
|
25
37
|
* Change `--pr-target-branch` and `--mr-target-branch` 's default value to repository's default branch
|
|
26
38
|
* https://github.com/sue445/sashimi_tanpopo/pull/52
|
|
27
39
|
|
|
28
|
-
## [
|
|
40
|
+
## [v0.1.3](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.1.3) - 2025-10-19
|
|
29
41
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.1.2...v0.1.3)
|
|
30
42
|
|
|
31
43
|
* Fix docker push on CI
|
|
32
44
|
* https://github.com/sue445/sashimi_tanpopo/pull/46
|
|
33
45
|
|
|
34
|
-
## [
|
|
46
|
+
## [v0.1.2](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.1.2) - 2025-10-19
|
|
35
47
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.1.1...v0.1.2)
|
|
36
48
|
|
|
37
49
|
* Fix docker build on CI
|
|
38
50
|
* https://github.com/sue445/sashimi_tanpopo/pull/44
|
|
39
51
|
|
|
40
|
-
## [
|
|
52
|
+
## [v0.1.1](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.1.1) - 2025-10-19
|
|
41
53
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.1.0...v0.1.1)
|
|
42
54
|
|
|
43
55
|
* Build and push docker image to ghcr.io
|
|
44
56
|
* https://github.com/sue445/sashimi_tanpopo/pull/42
|
|
45
57
|
|
|
46
|
-
## [
|
|
58
|
+
## [v0.1.0](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.1.0) - 2025-10-18
|
|
47
59
|
|
|
48
60
|
* Initial release
|
data/Dockerfile
CHANGED
data/lib/sashimi_tanpopo/dsl.rb
CHANGED
|
@@ -90,6 +90,15 @@ module SashimiTanpopo
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
# @return [Hash<String, { before_content: String, after_content: String, mode: String }>] key: file path, value: Hash
|
|
93
|
+
#
|
|
94
|
+
# @example
|
|
95
|
+
# {
|
|
96
|
+
# "path/to/changed-file.txt" => {
|
|
97
|
+
# before_content: "foo",
|
|
98
|
+
# after_content: "bar",
|
|
99
|
+
# mode: "100644",
|
|
100
|
+
# }
|
|
101
|
+
# }
|
|
93
102
|
def changed_files
|
|
94
103
|
@__changed_files__ ||= {}
|
|
95
104
|
end
|
|
@@ -122,22 +131,36 @@ module SashimiTanpopo
|
|
|
122
131
|
def update_file(pattern, &block)
|
|
123
132
|
Dir.glob(pattern).each do |path|
|
|
124
133
|
full_file_path = File.join(@__target_dir__, path)
|
|
125
|
-
|
|
134
|
+
|
|
135
|
+
next unless File.exist?(full_file_path)
|
|
136
|
+
|
|
137
|
+
before_content =
|
|
138
|
+
if changed_files[path]
|
|
139
|
+
changed_files[path][:after_content]
|
|
140
|
+
else
|
|
141
|
+
File.read(full_file_path)
|
|
142
|
+
end
|
|
126
143
|
|
|
127
144
|
SashimiTanpopo.logger.info "Checking #{full_file_path}"
|
|
128
145
|
|
|
129
|
-
after_content = update_single_file(
|
|
146
|
+
after_content = update_single_file(before_content, &block)
|
|
130
147
|
|
|
131
148
|
unless after_content
|
|
132
149
|
SashimiTanpopo.logger.info "#{full_file_path} isn't changed"
|
|
133
150
|
next
|
|
134
151
|
end
|
|
135
152
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
File.write(full_file_path, after_content) if !dry_run? && @__is_update_local__
|
|
154
|
+
|
|
155
|
+
if changed_files[path]
|
|
156
|
+
changed_files[path][:after_content] = after_content
|
|
157
|
+
else
|
|
158
|
+
changed_files[path] = {
|
|
159
|
+
before_content: before_content,
|
|
160
|
+
after_content: after_content,
|
|
161
|
+
mode: File.stat(full_file_path).mode.to_s(8)
|
|
162
|
+
}
|
|
163
|
+
end
|
|
141
164
|
|
|
142
165
|
if dry_run?
|
|
143
166
|
SashimiTanpopo.logger.info "#{full_file_path} will be changed (dryrun)"
|
|
@@ -149,28 +172,23 @@ module SashimiTanpopo
|
|
|
149
172
|
|
|
150
173
|
private
|
|
151
174
|
|
|
152
|
-
# @param
|
|
175
|
+
# @param content [String]
|
|
153
176
|
#
|
|
154
177
|
# @yieldparam content [String] content of file
|
|
155
178
|
#
|
|
156
179
|
# @return [String] Content of changed file if file is changed
|
|
157
180
|
# @return [nil] file isn't changed
|
|
158
|
-
def update_single_file(
|
|
159
|
-
|
|
181
|
+
def update_single_file(content)
|
|
182
|
+
after_content = content.dup
|
|
160
183
|
|
|
161
|
-
|
|
162
|
-
before_content = content.dup
|
|
163
|
-
|
|
164
|
-
yield content
|
|
184
|
+
yield after_content
|
|
165
185
|
|
|
166
186
|
# File isn't changed
|
|
167
|
-
return nil if
|
|
168
|
-
|
|
169
|
-
show_diff(before_content, content)
|
|
187
|
+
return nil if after_content == content
|
|
170
188
|
|
|
171
|
-
|
|
189
|
+
show_diff(content, after_content)
|
|
172
190
|
|
|
173
|
-
|
|
191
|
+
after_content
|
|
174
192
|
end
|
|
175
193
|
|
|
176
194
|
# @param str1 [String]
|
data/rbs_collection.lock.yaml
CHANGED
data/sig/sashimi_tanpopo/dsl.rbs
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sashimi_tanpopo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- sue445
|
|
@@ -304,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
304
304
|
- !ruby/object:Gem::Version
|
|
305
305
|
version: '0'
|
|
306
306
|
requirements: []
|
|
307
|
-
rubygems_version: 3.6.
|
|
307
|
+
rubygems_version: 3.6.7
|
|
308
308
|
specification_version: 4
|
|
309
309
|
summary: Change files and create patches
|
|
310
310
|
test_files: []
|