kettle-dev 2.3.5 → 2.3.6
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/CHANGELOG.md +40 -11
- data/README.md +2 -2
- data/exe/kettle-release +26 -2
- data/lib/kettle/dev/ci_monitor.rb +4 -4
- data/lib/kettle/dev/release_cli.rb +8 -2
- data/lib/kettle/dev/version.rb +1 -1
- data/sig/kettle/dev.rbs +583 -1
- data.tar.gz.sig +0 -0
- metadata +15 -59
- metadata.gz.sig +0 -0
- data/AGPL-3.0-only.md +0 -235
- data/CITATION.cff +0 -20
- data/CODE_OF_CONDUCT.md +0 -134
- data/CONTRIBUTING.md +0 -275
- data/FUNDING.md +0 -70
- data/RUBOCOP.md +0 -71
- data/SECURITY.md +0 -21
- data/certs/pboling.pem +0 -27
- data/sig/kettle/dev/appraisals_ast_merger.rbs +0 -72
- data/sig/kettle/dev/changelog_cli.rbs +0 -69
- data/sig/kettle/dev/ci_helpers.rbs +0 -42
- data/sig/kettle/dev/ci_monitor.rbs +0 -17
- data/sig/kettle/dev/commit_msg.rbs +0 -8
- data/sig/kettle/dev/dvcs_cli.rbs +0 -8
- data/sig/kettle/dev/exit_adapter.rbs +0 -8
- data/sig/kettle/dev/gem_spec_reader.rbs +0 -33
- data/sig/kettle/dev/git_adapter.rbs +0 -17
- data/sig/kettle/dev/git_commit_footer.rbs +0 -16
- data/sig/kettle/dev/input_adapter.rbs +0 -8
- data/sig/kettle/dev/modular_gemfiles.rbs +0 -12
- data/sig/kettle/dev/open_collective_config.rbs +0 -8
- data/sig/kettle/dev/pre_release_cli.rbs +0 -34
- data/sig/kettle/dev/prism_utils.rbs +0 -56
- data/sig/kettle/dev/readme_backers.rbs +0 -21
- data/sig/kettle/dev/release_cli.rbs +0 -20
- data/sig/kettle/dev/setup_cli.rbs +0 -8
- data/sig/kettle/dev/source_merger.rbs +0 -70
- data/sig/kettle/dev/tasks/ci_task.rbs +0 -9
- data/sig/kettle/dev/tasks/install_task.rbs +0 -10
- data/sig/kettle/dev/tasks/template_task.rbs +0 -10
- data/sig/kettle/dev/tasks.rbs +0 -7
- data/sig/kettle/dev/template_helpers.rbs +0 -84
- data/sig/kettle/dev/version.rbs +0 -8
- data/sig/kettle/dev/versioning.rbs +0 -21
- data/sig/kettle/emoji_regex.rbs +0 -5
- data/sig/kettle-dev.rbs +0 -0
data/sig/kettle/dev.rbs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
# TypeProf 0.21.11
|
|
2
|
+
|
|
1
3
|
module Kettle
|
|
2
4
|
module Dev
|
|
3
5
|
module Version
|
|
6
|
+
VERSION: String
|
|
4
7
|
end
|
|
5
8
|
|
|
6
9
|
class Error < ::StandardError
|
|
7
10
|
end
|
|
8
|
-
|
|
9
11
|
DEBUGGING: bool
|
|
10
12
|
IS_CI: bool
|
|
11
13
|
REQUIRE_BENCH: bool
|
|
@@ -18,5 +20,585 @@ module Kettle
|
|
|
18
20
|
def self.install_tasks: () -> void
|
|
19
21
|
def self.defaults: () -> Array[String]
|
|
20
22
|
def self.register_default: (String | Symbol task_name) -> Array[String]
|
|
23
|
+
VERSION: String
|
|
24
|
+
# AST-driven merger for Appraisals files using Prism
|
|
25
|
+
module AppraisalsAstMerger
|
|
26
|
+
TRACKED_METHODS: Array[Symbol]
|
|
27
|
+
|
|
28
|
+
# Merge template and destination Appraisals files preserving comments
|
|
29
|
+
def self.merge: (String template_content, String dest_content) -> String
|
|
30
|
+
|
|
31
|
+
# Extract blocks and preamble from parse result
|
|
32
|
+
def self.extract_blocks: (
|
|
33
|
+
Prism::ParseResult parse_result,
|
|
34
|
+
String source_content
|
|
35
|
+
) -> [Array[Prism::Comment], Array[Hash[Symbol, untyped]]]
|
|
36
|
+
|
|
37
|
+
# Check if node is an appraise call
|
|
38
|
+
def self.appraise_call?: (Prism::Node node) -> bool
|
|
39
|
+
|
|
40
|
+
# Extract appraise block name from node
|
|
41
|
+
def self.extract_appraise_name: (Prism::Node? node) -> String?
|
|
42
|
+
|
|
43
|
+
# Merge preamble comments from template and destination
|
|
44
|
+
def self.merge_preambles: (
|
|
45
|
+
Array[Prism::Comment] tmpl_comments,
|
|
46
|
+
Array[Prism::Comment] dest_comments
|
|
47
|
+
) -> Array[String]
|
|
48
|
+
|
|
49
|
+
# Extract block header comments
|
|
50
|
+
def self.extract_block_header: (
|
|
51
|
+
Prism::Node node,
|
|
52
|
+
Array[String] source_lines,
|
|
53
|
+
Array[Hash[Symbol, untyped]] previous_blocks
|
|
54
|
+
) -> String
|
|
55
|
+
|
|
56
|
+
# Merge blocks from template and destination
|
|
57
|
+
def self.merge_blocks: (
|
|
58
|
+
Array[Hash[Symbol, untyped]] tmpl_blocks,
|
|
59
|
+
Array[Hash[Symbol, untyped]] dest_blocks,
|
|
60
|
+
Prism::ParseResult tmpl_result,
|
|
61
|
+
Prism::ParseResult dest_result
|
|
62
|
+
) -> Array[Hash[Symbol, untyped]]
|
|
63
|
+
|
|
64
|
+
# Merge statements within a block
|
|
65
|
+
def self.merge_block_statements: (
|
|
66
|
+
Prism::Node? tmpl_body,
|
|
67
|
+
Prism::Node? dest_body,
|
|
68
|
+
Prism::ParseResult dest_result
|
|
69
|
+
) -> Array[Hash[Symbol, untyped]]
|
|
70
|
+
|
|
71
|
+
# Generate statement key for deduplication
|
|
72
|
+
def self.statement_key: (Prism::Node node) -> [Symbol, String?]?
|
|
73
|
+
|
|
74
|
+
# Build output from preamble and blocks
|
|
75
|
+
def self.build_output: (
|
|
76
|
+
Array[String] preamble_lines,
|
|
77
|
+
Array[Hash[Symbol, untyped]] blocks
|
|
78
|
+
) -> String
|
|
79
|
+
|
|
80
|
+
# Normalize statement to use parentheses
|
|
81
|
+
def self.normalize_statement: (Prism::Node node) -> String
|
|
82
|
+
|
|
83
|
+
# Normalize argument to canonical format
|
|
84
|
+
def self.normalize_argument: (Prism::Node arg) -> String
|
|
85
|
+
|
|
86
|
+
# Extract original statements from node
|
|
87
|
+
def self.extract_original_statements: (Prism::Node node) -> Array[Hash[Symbol, untyped]]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# CLI for updating CHANGELOG.md with new version sections
|
|
91
|
+
class ChangelogCLI
|
|
92
|
+
UNRELEASED_SECTION_HEADING: String
|
|
93
|
+
|
|
94
|
+
@root: String
|
|
95
|
+
@changelog_path: String
|
|
96
|
+
@coverage_path: String
|
|
97
|
+
|
|
98
|
+
def initialize: (?strict: bool, ?enforce_coverage_thresholds: bool, ?update_prep: bool, ?root: String) -> void
|
|
99
|
+
|
|
100
|
+
# Main entry point that updates CHANGELOG.md
|
|
101
|
+
def run: () -> void
|
|
102
|
+
|
|
103
|
+
def pending_release_status: () -> Hash[Symbol, untyped]
|
|
104
|
+
|
|
105
|
+
def release_state: () -> Hash[Symbol, untyped]
|
|
106
|
+
|
|
107
|
+
def release_state_table: (?Hash[Symbol, untyped] state) -> String
|
|
108
|
+
|
|
109
|
+
private
|
|
110
|
+
|
|
111
|
+
# Abort with error message
|
|
112
|
+
def abort: (String msg) -> void
|
|
113
|
+
|
|
114
|
+
# Detect version from lib/**/version.rb
|
|
115
|
+
def detect_version: () -> String
|
|
116
|
+
|
|
117
|
+
# Extract unreleased section from changelog
|
|
118
|
+
def extract_unreleased: (String content) -> [String?, String?, String?]
|
|
119
|
+
|
|
120
|
+
# Detect previous version from after text
|
|
121
|
+
def detect_previous_version: (String after_text) -> String?
|
|
122
|
+
|
|
123
|
+
# Filter unreleased sections keeping only those with content
|
|
124
|
+
def filter_unreleased_sections: (String unreleased_block) -> String
|
|
125
|
+
|
|
126
|
+
# Get coverage lines from coverage.json
|
|
127
|
+
def coverage_lines: () -> [String?, String?]
|
|
128
|
+
|
|
129
|
+
# Get YARD documentation percentage
|
|
130
|
+
def yard_percent_documented: () -> String?
|
|
131
|
+
|
|
132
|
+
# Convert legacy heading tag suffix to list format
|
|
133
|
+
def convert_heading_tag_suffix_to_list: (String text) -> String
|
|
134
|
+
|
|
135
|
+
# Update link references in changelog
|
|
136
|
+
def update_link_refs: (
|
|
137
|
+
String content,
|
|
138
|
+
String? owner,
|
|
139
|
+
String? repo,
|
|
140
|
+
String? prev_version,
|
|
141
|
+
String new_version
|
|
142
|
+
) -> String
|
|
143
|
+
|
|
144
|
+
# Normalize spacing around headings
|
|
145
|
+
def normalize_heading_spacing: (String text) -> String
|
|
146
|
+
|
|
147
|
+
# Ensure proper footer spacing
|
|
148
|
+
def ensure_footer_spacing: (String text) -> String
|
|
149
|
+
|
|
150
|
+
# Detect initial compare base from changelog
|
|
151
|
+
def detect_initial_compare_base: (Array[String] lines) -> String
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
module CIHelpers
|
|
155
|
+
# singleton (module) methods
|
|
156
|
+
def self.project_root: () -> String
|
|
157
|
+
def self.repo_info: () -> [String, String]?
|
|
158
|
+
def self.current_branch: () -> String?
|
|
159
|
+
def self.current_head_sha: () -> String?
|
|
160
|
+
def self.workflows_list: (?String root) -> Array[String]
|
|
161
|
+
def self.exclusions: () -> Array[String]
|
|
162
|
+
|
|
163
|
+
def self.latest_run: (
|
|
164
|
+
owner: String,
|
|
165
|
+
repo: String,
|
|
166
|
+
workflow_file: String,
|
|
167
|
+
?branch: String?,
|
|
168
|
+
?token: String?,
|
|
169
|
+
?require_head: bool,
|
|
170
|
+
?head_sha: String?
|
|
171
|
+
) -> { "status" => String, "conclusion" => String?, "html_url" => String, "id" => Integer, "head_sha" => String? }?
|
|
172
|
+
|
|
173
|
+
def self.success?: ({ "status" => String, "conclusion" => String? }?) -> bool
|
|
174
|
+
def self.failed?: ({ "status" => String, "conclusion" => String? }?) -> bool
|
|
175
|
+
|
|
176
|
+
def self.default_token: () -> String?
|
|
177
|
+
|
|
178
|
+
# GitLab
|
|
179
|
+
def self.origin_url: () -> String?
|
|
180
|
+
def self.repo_info_gitlab: () -> [String, String]?
|
|
181
|
+
def self.default_gitlab_token: () -> String?
|
|
182
|
+
def self.gitlab_latest_pipeline: (
|
|
183
|
+
owner: String,
|
|
184
|
+
repo: String,
|
|
185
|
+
?branch: String?,
|
|
186
|
+
?host: String,
|
|
187
|
+
?token: String?
|
|
188
|
+
) -> { "status" => String, "web_url" => String, "id" => Integer, "failure_reason" => String? }?
|
|
189
|
+
def self.gitlab_success?: ({ "status" => String }?) -> bool
|
|
190
|
+
def self.gitlab_failed?: ({ "status" => String }?) -> bool
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
module CIMonitor
|
|
194
|
+
def self.status_emoji: (String? status, String? conclusion) -> String
|
|
195
|
+
def self.monitor_all!: (?restart_hint: String, ?workflows: Array[String]?, **untyped) -> void
|
|
196
|
+
def self.monitor_gitlab!: (?restart_hint: String) -> bool
|
|
197
|
+
def self.collect_all: () -> { github: Array[untyped], gitlab: untyped? }
|
|
198
|
+
def self.summarize_results: ({ github: Array[untyped], gitlab: untyped? }) -> bool
|
|
199
|
+
def self.monitor_and_prompt_for_release!: (?restart_hint: String) -> void
|
|
200
|
+
def self.collect_github: () -> Array[untyped]?
|
|
201
|
+
def self.collect_gitlab: () -> { status: String, url: String? }?
|
|
202
|
+
def self.monotonic_time: () -> Float
|
|
203
|
+
def self.github_start_timeout: () -> Integer
|
|
204
|
+
def self.github_poll_interval: () -> Float
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
module CommitMsg
|
|
208
|
+
BRANCH_RULES: ::Hash[String, ::Regexp]
|
|
209
|
+
def self.enforce_branch_rule!: (String path) -> void
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
class DvcsCLI
|
|
213
|
+
def initialize: (Array[String] argv) -> void
|
|
214
|
+
def run!: () -> Integer
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
module ExitAdapter
|
|
218
|
+
def self.abort: (String msg) -> void
|
|
219
|
+
def self.exit: (?Integer status) -> void
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
class GemSpecReader
|
|
223
|
+
DEFAULT_MINIMUM_RUBY: Gem::Version
|
|
224
|
+
|
|
225
|
+
def self.load: (String root) -> {
|
|
226
|
+
gemspec_path: String?,
|
|
227
|
+
gem_name: String,
|
|
228
|
+
min_ruby: Gem::Version,
|
|
229
|
+
homepage: String,
|
|
230
|
+
gh_org: String,
|
|
231
|
+
forge_org: String,
|
|
232
|
+
funding_org: String?,
|
|
233
|
+
gh_repo: String?,
|
|
234
|
+
namespace: String,
|
|
235
|
+
namespace_shield: String,
|
|
236
|
+
entrypoint_require: String,
|
|
237
|
+
gem_shield: String,
|
|
238
|
+
authors: Array[String],
|
|
239
|
+
email: Array[String],
|
|
240
|
+
summary: String,
|
|
241
|
+
description: String,
|
|
242
|
+
licenses: Array[String],
|
|
243
|
+
required_ruby_version: Gem::Requirement?,
|
|
244
|
+
require_paths: Array[String],
|
|
245
|
+
bindir: String,
|
|
246
|
+
executables: Array[String],
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
def self.derive_forge_and_origin_repo: (String? homepage_val) -> { forge_org: String?, origin_repo: String? }
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
class GitAdapter
|
|
253
|
+
def initialize: () -> void
|
|
254
|
+
def capture: (Array[String] args) -> [String, bool]
|
|
255
|
+
def push: (String? remote, String branch, force: bool) -> bool
|
|
256
|
+
def current_branch: () -> String?
|
|
257
|
+
def remotes: () -> Array[String]
|
|
258
|
+
def remotes_with_urls: () -> Hash[String, String]
|
|
259
|
+
def remote_url: (String name) -> String?
|
|
260
|
+
def checkout: (String branch) -> bool
|
|
261
|
+
def pull: (String remote, String branch) -> bool
|
|
262
|
+
def fetch: (String remote, String? ref) -> bool
|
|
263
|
+
def clean?: () -> bool
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
module InputAdapter
|
|
267
|
+
def self.gets: (*untyped args) -> String?
|
|
268
|
+
def self.readline: (*untyped args) -> String
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
module ModularGemfiles
|
|
272
|
+
def self.sync!: (
|
|
273
|
+
helpers: untyped,
|
|
274
|
+
project_root: String,
|
|
275
|
+
gem_checkout_root: String,
|
|
276
|
+
min_ruby: untyped
|
|
277
|
+
) -> void
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
module OpenCollectiveConfig
|
|
281
|
+
def self.yaml_path: (?String) -> String
|
|
282
|
+
def self.handle: (?required: bool, ?root: String, ?strict: bool) -> String?
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
class PreReleaseCLI
|
|
286
|
+
IMAGE_URL_CACHE_TTL_SECONDS: Integer
|
|
287
|
+
DEFAULT_IMAGE_URL_SKIP_PATTERNS: Array[String]
|
|
288
|
+
FAMILY_CONFIG_PATHS: Array[String]
|
|
289
|
+
|
|
290
|
+
module HTTP
|
|
291
|
+
def self.parse_http_uri: (String url_str) -> ::URI
|
|
292
|
+
def self.head_ok?: (String url_str, ?limit: Integer, ?timeout: Integer) -> bool
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
module Markdown
|
|
296
|
+
def self.extract_image_urls_from_text: (String text) -> Array[String]
|
|
297
|
+
def self.extract_image_urls_from_files: (?String glob_pattern) -> Array[String]
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
class ImageUrlCache
|
|
301
|
+
VERSION: Integer
|
|
302
|
+
|
|
303
|
+
def self.default_path: () -> String?
|
|
304
|
+
def initialize: (path: String?, ?ttl_seconds: Integer, ?clock: ^() -> Time) -> void
|
|
305
|
+
def fresh_success?: (String url) -> bool
|
|
306
|
+
def write_success: (String url) -> void
|
|
307
|
+
def to_h: () -> Hash[String, untyped]
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def initialize: (?check_num: Integer) -> void
|
|
311
|
+
def run: () -> void
|
|
312
|
+
def check_markdown_uri_normalization!: () -> void
|
|
313
|
+
def check_markdown_images_http!: () -> void
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Shared utilities for working with Prism AST nodes
|
|
317
|
+
module PrismUtils
|
|
318
|
+
# Parse Ruby source code and return Prism parse result with comments
|
|
319
|
+
def self.parse_with_comments: (String source) -> Prism::ParseResult
|
|
320
|
+
|
|
321
|
+
# Extract statements from a Prism body node
|
|
322
|
+
def self.extract_statements: (Prism::Node? body_node) -> Array[Prism::Node]
|
|
323
|
+
|
|
324
|
+
# Generate a unique key for a statement node to identify equivalent statements
|
|
325
|
+
def self.statement_key: (
|
|
326
|
+
Prism::Node node,
|
|
327
|
+
?tracked_methods: Array[Symbol]
|
|
328
|
+
) -> [Symbol, String?]?
|
|
329
|
+
|
|
330
|
+
# Extract literal value from string or symbol nodes
|
|
331
|
+
def self.extract_literal_value: (Prism::Node? node) -> (String | Symbol)?
|
|
332
|
+
|
|
333
|
+
# Extract qualified constant name from a constant node
|
|
334
|
+
def self.extract_const_name: (Prism::Node? node) -> String?
|
|
335
|
+
|
|
336
|
+
# Find leading comments for a statement node
|
|
337
|
+
def self.find_leading_comments: (
|
|
338
|
+
Prism::ParseResult parse_result,
|
|
339
|
+
Prism::Node current_stmt,
|
|
340
|
+
Prism::Node? prev_stmt,
|
|
341
|
+
Prism::Node body_node
|
|
342
|
+
) -> Array[Prism::Comment]
|
|
343
|
+
|
|
344
|
+
# Find inline comments for a statement node
|
|
345
|
+
def self.inline_comments_for_node: (
|
|
346
|
+
Prism::ParseResult parse_result,
|
|
347
|
+
Prism::Node stmt
|
|
348
|
+
) -> Array[Prism::Comment]
|
|
349
|
+
|
|
350
|
+
# Convert a Prism AST node to Ruby source code
|
|
351
|
+
def self.node_to_source: (Prism::Node? node) -> String
|
|
352
|
+
|
|
353
|
+
# Normalize a call node to use parentheses format
|
|
354
|
+
def self.normalize_call_node: (Prism::Node node) -> String
|
|
355
|
+
|
|
356
|
+
# Normalize an argument node to canonical format
|
|
357
|
+
def self.normalize_argument: (Prism::Node arg) -> String
|
|
358
|
+
|
|
359
|
+
# Check if a node is a specific method call
|
|
360
|
+
def self.call_to?: (Prism::Node node, Symbol method_name) -> bool
|
|
361
|
+
|
|
362
|
+
# Check if a node is a block call to a specific method
|
|
363
|
+
def self.block_call_to?: (Prism::Node node, Symbol method_name) -> bool
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
class ReadmeBackers
|
|
367
|
+
def initialize: (
|
|
368
|
+
handle: String?,
|
|
369
|
+
readme_path: String?,
|
|
370
|
+
osc_api_base: String?,
|
|
371
|
+
osc_default_name: String?,
|
|
372
|
+
osc_empty_message: String?
|
|
373
|
+
) -> void
|
|
374
|
+
|
|
375
|
+
def run!: () -> void
|
|
376
|
+
def validate: () -> void
|
|
377
|
+
|
|
378
|
+
# Selected public helpers (kept minimal)
|
|
379
|
+
def readme_osc_tag: () -> String
|
|
380
|
+
def tag_strings: () -> [String, String]
|
|
381
|
+
def resolve_handle: () -> String
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
class ReleaseCLI
|
|
385
|
+
def initialize: (?start_step: Integer, ?local_ci: bool, ?version: String?, ?appraisal_task: String?, ?skip_steps: untyped, ?skip_bundle_audit: bool?, ?ci_workflows: untyped, **untyped) -> void
|
|
386
|
+
def run: () -> void
|
|
387
|
+
|
|
388
|
+
private
|
|
389
|
+
|
|
390
|
+
def update_readme_kloc_badge!: () -> void
|
|
391
|
+
def update_badge_number_in_file: (String path, String kloc_str) -> void
|
|
392
|
+
def update_rakefile_example_header!: (String version) -> void
|
|
393
|
+
def validate_copyright_years!: () -> void
|
|
394
|
+
def extract_years_from_file: (String path) -> ::Set[Integer]
|
|
395
|
+
def collapse_years: (::_ToA[Integer] enum) -> String
|
|
396
|
+
def reformat_copyright_year_lines!: (String path) -> void
|
|
397
|
+
def inject_years_into_file!: (String path, ::Set[Integer] years_set) -> void
|
|
398
|
+
def extract_release_notes_footer: () -> String?
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
class SetupCLI
|
|
402
|
+
def initialize: (Array[String] argv) -> void
|
|
403
|
+
def run!: () -> void
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# Prism-based AST merging for templated Ruby files.
|
|
407
|
+
# Handles strategy dispatch (skip/replace/append/merge).
|
|
408
|
+
#
|
|
409
|
+
# Uses prism-merge for AST-aware merging with support for:
|
|
410
|
+
# - Freeze blocks (kettle-dev:freeze / kettle-dev:unfreeze)
|
|
411
|
+
# - Comment preservation
|
|
412
|
+
# - Signature-based node matching
|
|
413
|
+
module SourceMerger
|
|
414
|
+
BUG_URL: String
|
|
415
|
+
|
|
416
|
+
# Apply a templating strategy to merge source and destination Ruby files
|
|
417
|
+
#
|
|
418
|
+
# @param strategy [Symbol] Merge strategy - :skip, :replace, :append, or :merge
|
|
419
|
+
# @param src [String] Template source content
|
|
420
|
+
# @param dest [String] Destination file content
|
|
421
|
+
# @param path [String] File path (for error messages)
|
|
422
|
+
# @return [String] Merged content with comments preserved
|
|
423
|
+
# @raise [Kettle::Dev::Error] If strategy is unknown or merge fails
|
|
424
|
+
def self.apply: (
|
|
425
|
+
strategy: Symbol,
|
|
426
|
+
src: String,
|
|
427
|
+
dest: String,
|
|
428
|
+
path: String
|
|
429
|
+
) -> String
|
|
430
|
+
|
|
431
|
+
# Normalize strategy symbol
|
|
432
|
+
#
|
|
433
|
+
# @param strategy [Symbol, nil] Strategy to normalize
|
|
434
|
+
# @return [Symbol] Normalized strategy (:skip if nil)
|
|
435
|
+
def self.normalize_strategy: (Symbol? strategy) -> Symbol
|
|
436
|
+
|
|
437
|
+
# Warn about bugs and print error information
|
|
438
|
+
#
|
|
439
|
+
# @param path [String] File path that caused the error
|
|
440
|
+
# @param error [StandardError] The error that occurred
|
|
441
|
+
# @return [void]
|
|
442
|
+
def self.warn_bug: (String path, StandardError error) -> void
|
|
443
|
+
|
|
444
|
+
# Ensure text ends with newline
|
|
445
|
+
#
|
|
446
|
+
# @param text [String, nil] Text to process
|
|
447
|
+
# @return [String] Text with trailing newline
|
|
448
|
+
def self.ensure_trailing_newline: (String? text) -> String
|
|
449
|
+
|
|
450
|
+
# Apply append strategy using prism-merge
|
|
451
|
+
#
|
|
452
|
+
# @param src_content [String] Template source content
|
|
453
|
+
# @param dest_content [String] Destination content
|
|
454
|
+
# @return [String] Merged content with destination preference
|
|
455
|
+
def self.apply_append: (String src_content, String dest_content) -> String
|
|
456
|
+
|
|
457
|
+
# Apply merge strategy using prism-merge
|
|
458
|
+
#
|
|
459
|
+
# @param src_content [String] Template source content
|
|
460
|
+
# @param dest_content [String] Destination content
|
|
461
|
+
# @return [String] Merged content with template preference
|
|
462
|
+
def self.apply_merge: (String src_content, String dest_content) -> String
|
|
463
|
+
|
|
464
|
+
# Create a signature generator for prism-merge
|
|
465
|
+
# Handles various Ruby node types for proper matching during merge operations
|
|
466
|
+
#
|
|
467
|
+
# @return [Proc] Signature generator lambda
|
|
468
|
+
def self.create_signature_generator: () -> ^(Prism::Node) -> (Array[untyped] | Prism::Node)
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
module Tasks
|
|
472
|
+
# Namespace module for task-related classes and Rake task loaders.
|
|
473
|
+
# Namespace module for task-related classes and Rake task loaders.
|
|
474
|
+
# Namespace module for task-related classes and Rake task loaders.
|
|
475
|
+
# Namespace module for task-related classes and Rake task loaders.
|
|
476
|
+
module CITask
|
|
477
|
+
def self.act: (?String opt) -> void
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
module InstallTask
|
|
481
|
+
# Entrypoint to perform installation steps and project setup.
|
|
482
|
+
def self.run: () -> void
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
module TemplateTask
|
|
486
|
+
# Entrypoint to copy/update template files into a host project.
|
|
487
|
+
def self.run: () -> void
|
|
488
|
+
end
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# Helpers shared by kettle:dev Rake tasks for templating and file ops.
|
|
492
|
+
module TemplateHelpers
|
|
493
|
+
# Symbol actions recorded by templating helpers
|
|
494
|
+
type template_action = :create | :replace | :skip | :dir_create | :dir_replace
|
|
495
|
+
|
|
496
|
+
# Root of the host project where Rake was invoked
|
|
497
|
+
def self.project_root: () -> String
|
|
498
|
+
|
|
499
|
+
# Root of this gem's checkout (repository root when working from source)
|
|
500
|
+
def self.gem_checkout_root: () -> String
|
|
501
|
+
|
|
502
|
+
# Simple yes/no prompt.
|
|
503
|
+
def self.ask: (String prompt, bool default) -> bool
|
|
504
|
+
|
|
505
|
+
# Write file content creating directories as needed
|
|
506
|
+
def self.write_file: (String dest_path, String content) -> void
|
|
507
|
+
|
|
508
|
+
# Record a template action for a destination path
|
|
509
|
+
def self.record_template_result: (String dest_path, template_action action) -> void
|
|
510
|
+
|
|
511
|
+
# Access all template results (read-only clone)
|
|
512
|
+
def self.template_results: () -> Hash[String, { action: template_action, timestamp: ::Time }]
|
|
513
|
+
|
|
514
|
+
# Returns true if the given path was created or replaced by the template task in this run
|
|
515
|
+
def self.modified_by_template?: (String dest_path) -> bool
|
|
516
|
+
|
|
517
|
+
# Ensure git working tree is clean before making changes in a task.
|
|
518
|
+
# If not a git repo, this is a no-op.
|
|
519
|
+
def self.ensure_clean_git!: (root: String, task_label: String) -> void
|
|
520
|
+
|
|
521
|
+
# Copy a single file with interactive prompts for create/replace.
|
|
522
|
+
def self.copy_file_with_prompt: (
|
|
523
|
+
String src_path,
|
|
524
|
+
String dest_path,
|
|
525
|
+
?allow_create: bool,
|
|
526
|
+
?allow_replace: bool
|
|
527
|
+
) -> void
|
|
528
|
+
|
|
529
|
+
# Copy a directory tree, prompting before creating or overwriting.
|
|
530
|
+
def self.copy_dir_with_prompt: (String src_dir, String dest_dir) -> void
|
|
531
|
+
|
|
532
|
+
# Apply common token replacements used when templating text files
|
|
533
|
+
def self.apply_common_replacements: (
|
|
534
|
+
String content,
|
|
535
|
+
org: String?,
|
|
536
|
+
gem_name: String,
|
|
537
|
+
namespace: String,
|
|
538
|
+
namespace_shield: String,
|
|
539
|
+
gem_shield: String,
|
|
540
|
+
?funding_org: String?,
|
|
541
|
+
?min_ruby: String?
|
|
542
|
+
) -> String
|
|
543
|
+
|
|
544
|
+
# Parse gemspec metadata and derive useful strings
|
|
545
|
+
# When no gemspec is present, gemspec_path may be nil; gh_org/gh_repo may be nil when not derivable.
|
|
546
|
+
def self.gemspec_metadata: (?String root) -> {
|
|
547
|
+
gemspec_path: String?,
|
|
548
|
+
gem_name: String,
|
|
549
|
+
min_ruby: String,
|
|
550
|
+
homepage: String,
|
|
551
|
+
gh_org: String?,
|
|
552
|
+
forge_org: String?,
|
|
553
|
+
funding_org: String?,
|
|
554
|
+
gh_repo: String?,
|
|
555
|
+
namespace: String,
|
|
556
|
+
namespace_shield: String,
|
|
557
|
+
entrypoint_require: String,
|
|
558
|
+
gem_shield: String,
|
|
559
|
+
authors: Array[String],
|
|
560
|
+
email: Array[String],
|
|
561
|
+
summary: String,
|
|
562
|
+
description: String,
|
|
563
|
+
license: String,
|
|
564
|
+
licenses: Array[String],
|
|
565
|
+
required_ruby_version: String,
|
|
566
|
+
require_paths: Array[String],
|
|
567
|
+
bindir: String,
|
|
568
|
+
executables: Array[String],
|
|
569
|
+
}
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
# Shared helpers for version detection and bump classification
|
|
573
|
+
module Versioning
|
|
574
|
+
# Detects a unique VERSION constant declared under lib/**/version.rb
|
|
575
|
+
def self.detect_version: (String root) -> String
|
|
576
|
+
|
|
577
|
+
# Classify the bump type from prev -> cur
|
|
578
|
+
def self.classify_bump: (String prev, String cur) -> Symbol
|
|
579
|
+
|
|
580
|
+
# Whether MAJOR is an EPIC version (strictly > 1000)
|
|
581
|
+
def self.epic_major?: (Integer major) -> bool
|
|
582
|
+
|
|
583
|
+
# Abort via ExitAdapter if available; otherwise Kernel.abort
|
|
584
|
+
def self.abort!: (String msg) -> void
|
|
585
|
+
end
|
|
21
586
|
end
|
|
22
587
|
end
|
|
588
|
+
|
|
589
|
+
class GitCommitFooter
|
|
590
|
+
NAME_ASSIGNMENT_REGEX: ::Regexp
|
|
591
|
+
FOOTER_APPEND: bool
|
|
592
|
+
SENTINEL: String?
|
|
593
|
+
|
|
594
|
+
def self.git_toplevel: () -> String?
|
|
595
|
+
def self.local_hooks_dir: () -> String?
|
|
596
|
+
def self.global_hooks_dir: () -> String
|
|
597
|
+
def self.hooks_path_for: (String filename) -> String
|
|
598
|
+
def self.commit_goalie_path: () -> String
|
|
599
|
+
def self.goalie_allows_footer?: (String subject_line) -> bool
|
|
600
|
+
def self.render: (*Array[String]) -> void
|
|
601
|
+
|
|
602
|
+
def initialize: () -> void
|
|
603
|
+
def render: () -> String
|
|
604
|
+
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|