sashimi_tanpopo 0.5.2 → 0.5.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 +15 -1
- data/Dockerfile +2 -2
- data/Rakefile +1 -1
- data/docs/RECIPE.md +6 -3
- data/lib/sashimi_tanpopo/dsl.rb +16 -8
- data/lib/sashimi_tanpopo/provider/base.rb +1 -0
- data/lib/sashimi_tanpopo/version.rb +1 -1
- data/rbs_collection.lock.yaml +21 -21
- data/sig/sashimi_tanpopo/dsl.rbs +3 -0
- 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: c4d1cda9cd0b6344b2af6b76030c3d72c086493afdb0f21d4142a101bc47ef77
|
|
4
|
+
data.tar.gz: 2e478e577b653e4dc891b23081c07f8ac121fc2b8dd27c3ec92391f0082bd9db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 440bdff2fa1db8bcbabcfb7761794176e8a82b78db5818bac6c367277063fea84a5aec839885d1bb6acf7f072a2edee3baf612e6042cf30e420035552e9120f6
|
|
7
|
+
data.tar.gz: bdaa104cb58d535952d46c514c412650002d9489ecddfee186c16cad8406db57527ccef0d76e7a164e7b0082d35e9a83f54eca2ef6466f7603d46c7e679178a4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
|
-
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.
|
|
2
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.4...main)
|
|
3
|
+
|
|
4
|
+
## [v0.5.4](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.5.4) - 2025-12-30
|
|
5
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.3...v0.5.4)
|
|
6
|
+
|
|
7
|
+
* Fixed problem where not all changes were applied when passing multiple recipes
|
|
8
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/103
|
|
9
|
+
* Upgrade to Ruby 4.0 in Dockerfile
|
|
10
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/102
|
|
11
|
+
|
|
12
|
+
## [v0.5.3](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.5.3) - 2025-12-07
|
|
13
|
+
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.2...v0.5.3)
|
|
14
|
+
|
|
15
|
+
* Fixes Docker image was not pushed to ghcr.io (TAKE 3)
|
|
16
|
+
* https://github.com/sue445/sashimi_tanpopo/pull/88
|
|
3
17
|
|
|
4
18
|
## [v0.5.2](https://github.com/sue445/sashimi_tanpopo/releases/tag/v0.5.2) - 2025-12-07
|
|
5
19
|
[full changelog](http://github.com/sue445/sashimi_tanpopo/compare/v0.5.1...v0.5.2)
|
data/Dockerfile
CHANGED
data/Rakefile
CHANGED
|
@@ -36,6 +36,6 @@ task :fix_version do
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
# Run fix_version before release:source_control_push (inside of release task)
|
|
39
|
-
Rake::Task["release:source_control_push"].enhance([:fix_version])
|
|
39
|
+
Rake::Task["release:source_control_push"].enhance([:fix_version]) unless ENV["CI"]
|
|
40
40
|
|
|
41
41
|
task default: %i[spec rbs]
|
data/docs/RECIPE.md
CHANGED
|
@@ -41,21 +41,24 @@ params
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
### `update_file`
|
|
44
|
-
Update files
|
|
44
|
+
Update files
|
|
45
45
|
|
|
46
46
|
```ruby
|
|
47
|
-
# Update single file
|
|
47
|
+
# Update single file if exists
|
|
48
48
|
update_file "test.txt" do |content|
|
|
49
49
|
content.gsub!("name", params[:name])
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
# Update multiple files
|
|
52
|
+
# Update multiple files if exists
|
|
53
53
|
update_file ".github/workflows/*.yml" do |content|
|
|
54
54
|
content.gsub!(/ruby-version: "(.+)"/, %Q{ruby-version: "#{params[:ruby_version]}"})
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
# Create new file if file doesn’t exist
|
|
58
58
|
update_file "new_file.txt", create: true do |content|
|
|
59
|
+
# content
|
|
60
|
+
# # => ""
|
|
61
|
+
|
|
59
62
|
content.replace("My name is " + params[:name])
|
|
60
63
|
end
|
|
61
64
|
```
|
data/lib/sashimi_tanpopo/dsl.rb
CHANGED
|
@@ -10,6 +10,7 @@ module SashimiTanpopo
|
|
|
10
10
|
# @param dry_run [Boolean]
|
|
11
11
|
# @param is_colored [Boolean] Whether show color diff
|
|
12
12
|
# @param is_update_local [Boolean] Whether update local file in `update_file`
|
|
13
|
+
# @param changed_files [Hash<String, { before_content: String, after_content: String, mode: String }>] key: file path, value: Hash
|
|
13
14
|
#
|
|
14
15
|
# @return [Hash<String, { before_content: String, after_content: String, mode: String }>] changed files (key: file path, value: Hash)
|
|
15
16
|
#
|
|
@@ -21,7 +22,7 @@ module SashimiTanpopo
|
|
|
21
22
|
# mode: "100644",
|
|
22
23
|
# }
|
|
23
24
|
# }
|
|
24
|
-
def perform(recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:)
|
|
25
|
+
def perform(recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files: {})
|
|
25
26
|
evaluate(
|
|
26
27
|
recipe_body: File.read(recipe_path),
|
|
27
28
|
recipe_path: recipe_path,
|
|
@@ -30,6 +31,7 @@ module SashimiTanpopo
|
|
|
30
31
|
dry_run: dry_run,
|
|
31
32
|
is_colored: is_colored,
|
|
32
33
|
is_update_local: is_update_local,
|
|
34
|
+
changed_files: changed_files,
|
|
33
35
|
)
|
|
34
36
|
end
|
|
35
37
|
|
|
@@ -42,6 +44,7 @@ module SashimiTanpopo
|
|
|
42
44
|
# @param dry_run [Boolean]
|
|
43
45
|
# @param is_colored [Boolean] Whether show color diff
|
|
44
46
|
# @param is_update_local [Boolean] Whether update local file in `update_file`
|
|
47
|
+
# @param changed_files [Hash<String, { before_content: String, after_content: String, mode: String }>] key: file path, value: Hash
|
|
45
48
|
#
|
|
46
49
|
# @return [Hash<String, { before_content: String, after_content: String, mode: String }>] changed files (key: file path, value: Hash)
|
|
47
50
|
#
|
|
@@ -53,8 +56,8 @@ module SashimiTanpopo
|
|
|
53
56
|
# mode: "100644",
|
|
54
57
|
# }
|
|
55
58
|
# }
|
|
56
|
-
def evaluate(recipe_body:, recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:)
|
|
57
|
-
context = EvalContext.new(params: params, dry_run: dry_run, is_colored: is_colored, target_dir: target_dir, is_update_local: is_update_local)
|
|
59
|
+
def evaluate(recipe_body:, recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files:)
|
|
60
|
+
context = EvalContext.new(params: params, dry_run: dry_run, is_colored: is_colored, target_dir: target_dir, is_update_local: is_update_local, changed_files: changed_files)
|
|
58
61
|
InstanceEval.new(recipe_body: recipe_body, recipe_path: recipe_path, target_dir: target_dir, context: context).call
|
|
59
62
|
context.changed_files
|
|
60
63
|
end
|
|
@@ -65,12 +68,14 @@ module SashimiTanpopo
|
|
|
65
68
|
# @param is_colored [Boolean] Whether show color diff
|
|
66
69
|
# @param target_dir [String]
|
|
67
70
|
# @param is_update_local [Boolean] Whether update local file in `update_file`
|
|
68
|
-
|
|
71
|
+
# @param changed_files [Hash<String, { before_content: String, after_content: String, mode: String }>] key: file path, value: Hash
|
|
72
|
+
def initialize(params:, dry_run:, is_colored:, target_dir:, is_update_local:, changed_files:)
|
|
69
73
|
@__params__ = params
|
|
70
74
|
@__dry_run__ = dry_run
|
|
71
75
|
@__target_dir__ = target_dir
|
|
72
76
|
@__is_update_local__ = is_update_local
|
|
73
77
|
@__is_colored__ = is_colored
|
|
78
|
+
@__changed_files__ = changed_files
|
|
74
79
|
end
|
|
75
80
|
|
|
76
81
|
# passed from `--params`
|
|
@@ -100,7 +105,7 @@ module SashimiTanpopo
|
|
|
100
105
|
# }
|
|
101
106
|
# }
|
|
102
107
|
def changed_files
|
|
103
|
-
@__changed_files__
|
|
108
|
+
@__changed_files__
|
|
104
109
|
end
|
|
105
110
|
|
|
106
111
|
# @return [Boolean] Whether dry run
|
|
@@ -113,25 +118,28 @@ module SashimiTanpopo
|
|
|
113
118
|
@__dry_run__
|
|
114
119
|
end
|
|
115
120
|
|
|
116
|
-
# Update files
|
|
121
|
+
# Update files
|
|
117
122
|
#
|
|
118
123
|
# @param pattern [String] Path to target file (relative path from `--target-dir`). This supports [`Dir.glob`](https://ruby-doc.org/current/Dir.html#method-c-glob) pattern. (e.g. `.github/workflows/*.yml`)
|
|
119
124
|
# @param create [Boolean] Whether create new file if file doesn't exist
|
|
120
125
|
#
|
|
121
126
|
# @yieldparam content [String] Content of file. If `content` is changed in block, file will be changed.
|
|
122
127
|
#
|
|
123
|
-
# @example Update single file
|
|
128
|
+
# @example Update single file if exists
|
|
124
129
|
# update_file "test.txt" do |content|
|
|
125
130
|
# content.gsub!("name", params[:name])
|
|
126
131
|
# end
|
|
127
132
|
#
|
|
128
|
-
# @example Update multiple files
|
|
133
|
+
# @example Update multiple files if exists
|
|
129
134
|
# update_file ".github/workflows/*.yml" do |content|
|
|
130
135
|
# content.gsub!(/ruby-version: "(.+)"/, %Q{ruby-version: "#{params[:ruby_version]}"})
|
|
131
136
|
# end
|
|
132
137
|
#
|
|
133
138
|
# @example Create new file if file doesn't exist
|
|
134
139
|
# update_file "new_file.txt", create: true do |content|
|
|
140
|
+
# # content
|
|
141
|
+
# # # => ""
|
|
142
|
+
#
|
|
135
143
|
# content.replace("My name is " + params[:name])
|
|
136
144
|
# end
|
|
137
145
|
def update_file(pattern, create: false, &block)
|
data/rbs_collection.lock.yaml
CHANGED
|
@@ -6,23 +6,19 @@ gems:
|
|
|
6
6
|
source:
|
|
7
7
|
type: git
|
|
8
8
|
name: ruby/gem_rbs_collection
|
|
9
|
-
revision:
|
|
9
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
11
11
|
repo_dir: gems
|
|
12
12
|
- name: base64
|
|
13
|
-
version:
|
|
13
|
+
version: 0.3.0
|
|
14
14
|
source:
|
|
15
|
-
type:
|
|
16
|
-
name: ruby/gem_rbs_collection
|
|
17
|
-
revision: f1d2dae32fe8d46683fbc79bbd0f1ca391d5e11a
|
|
18
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
19
|
-
repo_dir: gems
|
|
15
|
+
type: rubygems
|
|
20
16
|
- name: bigdecimal
|
|
21
17
|
version: '3.1'
|
|
22
18
|
source:
|
|
23
19
|
type: git
|
|
24
20
|
name: ruby/gem_rbs_collection
|
|
25
|
-
revision:
|
|
21
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
26
22
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
27
23
|
repo_dir: gems
|
|
28
24
|
- name: csv
|
|
@@ -30,7 +26,7 @@ gems:
|
|
|
30
26
|
source:
|
|
31
27
|
type: git
|
|
32
28
|
name: ruby/gem_rbs_collection
|
|
33
|
-
revision:
|
|
29
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
34
30
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
35
31
|
repo_dir: gems
|
|
36
32
|
- name: date
|
|
@@ -46,7 +42,7 @@ gems:
|
|
|
46
42
|
source:
|
|
47
43
|
type: git
|
|
48
44
|
name: ruby/gem_rbs_collection
|
|
49
|
-
revision:
|
|
45
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
50
46
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
51
47
|
repo_dir: gems
|
|
52
48
|
- name: diffy
|
|
@@ -54,7 +50,7 @@ gems:
|
|
|
54
50
|
source:
|
|
55
51
|
type: git
|
|
56
52
|
name: ruby/gem_rbs_collection
|
|
57
|
-
revision:
|
|
53
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
58
54
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
59
55
|
repo_dir: gems
|
|
60
56
|
- name: erb
|
|
@@ -66,7 +62,7 @@ gems:
|
|
|
66
62
|
source:
|
|
67
63
|
type: git
|
|
68
64
|
name: ruby/gem_rbs_collection
|
|
69
|
-
revision:
|
|
65
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
70
66
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
71
67
|
repo_dir: gems
|
|
72
68
|
- name: fileutils
|
|
@@ -82,7 +78,7 @@ gems:
|
|
|
82
78
|
source:
|
|
83
79
|
type: git
|
|
84
80
|
name: ruby/gem_rbs_collection
|
|
85
|
-
revision:
|
|
81
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
86
82
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
87
83
|
repo_dir: gems
|
|
88
84
|
- name: hashdiff
|
|
@@ -90,7 +86,7 @@ gems:
|
|
|
90
86
|
source:
|
|
91
87
|
type: git
|
|
92
88
|
name: ruby/gem_rbs_collection
|
|
93
|
-
revision:
|
|
89
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
94
90
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
95
91
|
repo_dir: gems
|
|
96
92
|
- name: httparty
|
|
@@ -98,7 +94,7 @@ gems:
|
|
|
98
94
|
source:
|
|
99
95
|
type: git
|
|
100
96
|
name: ruby/gem_rbs_collection
|
|
101
|
-
revision:
|
|
97
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
102
98
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
103
99
|
repo_dir: gems
|
|
104
100
|
- name: io-console
|
|
@@ -118,13 +114,17 @@ gems:
|
|
|
118
114
|
source:
|
|
119
115
|
type: git
|
|
120
116
|
name: ruby/gem_rbs_collection
|
|
121
|
-
revision:
|
|
117
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
122
118
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
123
119
|
repo_dir: gems
|
|
124
120
|
- name: monitor
|
|
125
121
|
version: '0'
|
|
126
122
|
source:
|
|
127
123
|
type: stdlib
|
|
124
|
+
- name: multi_xml
|
|
125
|
+
version: 0.8.0
|
|
126
|
+
source:
|
|
127
|
+
type: rubygems
|
|
128
128
|
- name: net-http
|
|
129
129
|
version: '0'
|
|
130
130
|
source:
|
|
@@ -138,7 +138,7 @@ gems:
|
|
|
138
138
|
source:
|
|
139
139
|
type: git
|
|
140
140
|
name: ruby/gem_rbs_collection
|
|
141
|
-
revision:
|
|
141
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
142
142
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
143
143
|
repo_dir: gems
|
|
144
144
|
- name: parallel
|
|
@@ -146,7 +146,7 @@ gems:
|
|
|
146
146
|
source:
|
|
147
147
|
type: git
|
|
148
148
|
name: ruby/gem_rbs_collection
|
|
149
|
-
revision:
|
|
149
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
150
150
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
151
151
|
repo_dir: gems
|
|
152
152
|
- name: pp
|
|
@@ -170,7 +170,7 @@ gems:
|
|
|
170
170
|
source:
|
|
171
171
|
type: git
|
|
172
172
|
name: ruby/gem_rbs_collection
|
|
173
|
-
revision:
|
|
173
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
174
174
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
175
175
|
repo_dir: gems
|
|
176
176
|
- name: rdoc
|
|
@@ -186,7 +186,7 @@ gems:
|
|
|
186
186
|
source:
|
|
187
187
|
type: git
|
|
188
188
|
name: ruby/gem_rbs_collection
|
|
189
|
-
revision:
|
|
189
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
190
190
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
191
191
|
repo_dir: gems
|
|
192
192
|
- name: timeout
|
|
@@ -206,7 +206,7 @@ gems:
|
|
|
206
206
|
source:
|
|
207
207
|
type: git
|
|
208
208
|
name: ruby/gem_rbs_collection
|
|
209
|
-
revision:
|
|
209
|
+
revision: 3a33fa6f8e486f880c80ca401f2be1c1f621cf11
|
|
210
210
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
211
211
|
repo_dir: gems
|
|
212
212
|
gemfile_lock_path: Gemfile.lock
|
data/sig/sashimi_tanpopo/dsl.rbs
CHANGED
|
@@ -7,6 +7,7 @@ module SashimiTanpopo
|
|
|
7
7
|
dry_run: bool,
|
|
8
8
|
is_colored: bool,
|
|
9
9
|
is_update_local: bool,
|
|
10
|
+
changed_files: changed_files,
|
|
10
11
|
) -> changed_files
|
|
11
12
|
|
|
12
13
|
def evaluate: (
|
|
@@ -17,6 +18,7 @@ module SashimiTanpopo
|
|
|
17
18
|
dry_run: bool,
|
|
18
19
|
is_colored: bool,
|
|
19
20
|
is_update_local: bool,
|
|
21
|
+
changed_files: changed_files,
|
|
20
22
|
) -> changed_files
|
|
21
23
|
|
|
22
24
|
class EvalContext
|
|
@@ -33,6 +35,7 @@ module SashimiTanpopo
|
|
|
33
35
|
is_colored: bool,
|
|
34
36
|
target_dir: String,
|
|
35
37
|
is_update_local: bool,
|
|
38
|
+
changed_files: changed_files,
|
|
36
39
|
) -> void
|
|
37
40
|
|
|
38
41
|
def params: () -> Hash[Symbol, String]
|
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.5.
|
|
4
|
+
version: 0.5.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:
|
|
307
|
+
rubygems_version: 4.0.3
|
|
308
308
|
specification_version: 4
|
|
309
309
|
summary: Change files and create patches
|
|
310
310
|
test_files: []
|