kettle-drift 1.0.0 → 1.0.1
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 +16 -3
- data/CONTRIBUTING.md +5 -0
- data/README.md +7 -2
- data/lib/kettle/drift/plugin.rb +49 -3
- data/lib/kettle/drift/version.rb +1 -1
- data/sig/kettle/drift/version.rbs +0 -1
- data.tar.gz.sig +0 -0
- metadata +19 -13
- 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: 66e6c1d163f35fa238c1b39db2f70408d852a138882b743b4406b9d42e312ae8
|
|
4
|
+
data.tar.gz: b966b2faa94714d091e640002b8acb610dfaca2e6603d947ca2d594a8f04acc4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11fdc0183e706bc250d45b09bf8741d7ed342a5d12dc57e5fb14c02e855c8a8ab567dff6a2fc69531c422fdc9d0e75dfd3af16a291b774caa6d3bf681794e849
|
|
7
|
+
data.tar.gz: b494c1ccdbb84fc6e38b888d48e362703ad6a426c849cc83ad0ff4990b0f3004b46331550fcefa399d27754c219a5ccbc859906526f64b83084d7ef497be9d53
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -28,10 +28,21 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
28
28
|
|
|
29
29
|
### Fixed
|
|
30
30
|
|
|
31
|
+
### Security
|
|
32
|
+
|
|
33
|
+
## [1.0.1] - 2026-05-28
|
|
34
|
+
|
|
35
|
+
- TAG: [v1.0.1][1.0.1t]
|
|
36
|
+
- COVERAGE: 84.12% -- 429/510 lines in 13 files
|
|
37
|
+
- BRANCH COVERAGE: 65.84% -- 133/202 branches in 13 files
|
|
38
|
+
- 32.35% documented
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
31
42
|
- Prevented the Rakefile template hook from adding a second trailing newline
|
|
32
43
|
when refreshing the kettle-drift task block.
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
- Inserted the kettle-drift Rakefile task block after the complete guarded
|
|
45
|
+
`kettle-dev` block so templating does not corrupt destination Rakefiles.
|
|
35
46
|
|
|
36
47
|
## [1.0.0] - 2026-05-24
|
|
37
48
|
|
|
@@ -44,6 +55,8 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
44
55
|
|
|
45
56
|
- Initial release
|
|
46
57
|
|
|
47
|
-
[Unreleased]: https://github.com/kettle-rb/kettle-drift/compare/v1.0.
|
|
58
|
+
[Unreleased]: https://github.com/kettle-rb/kettle-drift/compare/v1.0.1...HEAD
|
|
59
|
+
[1.0.1]: https://github.com/kettle-rb/kettle-drift/compare/v1.0.0...v1.0.1
|
|
60
|
+
[1.0.1t]: https://github.com/kettle-rb/kettle-drift/releases/tag/v1.0.1
|
|
48
61
|
[1.0.0]: https://github.com/kettle-rb/kettle-drift/compare/bd038cd14dc083203b58f8fee359e63d6feeaaca...v1.0.0
|
|
49
62
|
[1.0.0t]: https://github.com/kettle-rb/kettle-drift/releases/tag/v1.0.0
|
data/CONTRIBUTING.md
CHANGED
|
@@ -107,6 +107,11 @@ For a quick starting point, this repository’s `mise.toml` defines the shared d
|
|
|
107
107
|
## Appraisals
|
|
108
108
|
|
|
109
109
|
From time to time the [appraisal2][🚎appraisal2] gemfiles in `gemfiles/` will need to be updated.
|
|
110
|
+
Generated appraisal and CI workflow floors are controlled by `ruby.test_minimum`
|
|
111
|
+
in `.kettle-jem.yml`; this project was templated with `ruby.test_minimum: 3.2.0`.
|
|
112
|
+
That value describes the lowest Ruby version expected to run the test/development
|
|
113
|
+
toolchain, and it may be higher than the gemspec runtime floor.
|
|
114
|
+
|
|
110
115
|
They are created and updated with the commands:
|
|
111
116
|
|
|
112
117
|
```console
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[🖼️kettle-rb-kettle-drift-i]: https://logos.galtzo.com/assets/images/kettle-rb/kettle-drift/avatar-128px.svg
|
|
10
10
|
[🖼️kettle-rb-kettle-drift]: https://github.com/kettle-rb/kettle-drift
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# 🍲 Kettle::Drift
|
|
13
13
|
|
|
14
14
|
[![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: AGPL-3.0-only][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL]
|
|
15
15
|
|
|
@@ -55,6 +55,10 @@ the whole repository.
|
|
|
55
55
|
### Compatibility
|
|
56
56
|
|
|
57
57
|
Compatible with MRI Ruby 3.2.0+, and concordant releases of JRuby, and TruffleRuby.
|
|
58
|
+
CI workflows and Appraisals are generated for MRI Ruby 3.2.0+.
|
|
59
|
+
This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
|
|
60
|
+
may be higher than the gem's runtime compatibility floor when legacy Rubies are
|
|
61
|
+
not practical for the current toolchain.
|
|
58
62
|
|
|
59
63
|
| 🚚 _Amazing_ test matrix was brought to you by | 🔎 appraisal2 🔎 and the color 💚 green 💚 |
|
|
60
64
|
|------------------------------------------------|--------------------------------------------------------|
|
|
@@ -444,7 +448,7 @@ Thanks for RTFM. ☺️
|
|
|
444
448
|
[📌gitmoji]: https://gitmoji.dev
|
|
445
449
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
446
450
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
447
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
451
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.510-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
448
452
|
[🔐security]: https://github.com/kettle-rb/kettle-drift/blob/main/SECURITY.md
|
|
449
453
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
450
454
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
|
@@ -453,6 +457,7 @@ Thanks for RTFM. ☺️
|
|
|
453
457
|
[📄license-img]: https://img.shields.io/badge/License-AGPL--3.0--only-259D6C.svg
|
|
454
458
|
[📄license-compat]: https://www.apache.org/legal/resolved.html#category-x
|
|
455
459
|
[📄license-compat-img]: https://img.shields.io/badge/Apache_Incompatible:_Category_X-✗-C0392B.svg?style=flat&logo=Apache
|
|
460
|
+
|
|
456
461
|
[📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
|
|
457
462
|
[📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-259D6C.svg?style=flat
|
|
458
463
|
[🚎yard-current]: http://rubydoc.info/gems/kettle-drift
|
data/lib/kettle/drift/plugin.rb
CHANGED
|
@@ -67,14 +67,60 @@ module Kettle
|
|
|
67
67
|
|
|
68
68
|
def insert_snippet(content)
|
|
69
69
|
lines = content.lines
|
|
70
|
-
|
|
71
|
-
if
|
|
72
|
-
lines.insert(
|
|
70
|
+
insert_after_line = kettle_dev_anchor_end_line(content)
|
|
71
|
+
if insert_after_line
|
|
72
|
+
lines.insert(insert_after_line, "\n", RAKEFILE_SNIPPET, "\n")
|
|
73
73
|
lines.join
|
|
74
74
|
else
|
|
75
75
|
[content.rstrip, "", RAKEFILE_SNIPPET.rstrip, ""].join("\n")
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
|
+
|
|
79
|
+
def kettle_dev_anchor_end_line(content)
|
|
80
|
+
prism_kettle_dev_anchor_end_line(content) || require_kettle_dev_line(content)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def prism_kettle_dev_anchor_end_line(content)
|
|
84
|
+
require "prism"
|
|
85
|
+
result = Prism.parse(content.to_s)
|
|
86
|
+
return unless result.success?
|
|
87
|
+
|
|
88
|
+
top_level_nodes = result.value.statements&.body.to_a
|
|
89
|
+
anchor_node = top_level_nodes.reverse.find { |node| contains_kettle_dev_require?(node) }
|
|
90
|
+
anchor_node&.location&.end_line
|
|
91
|
+
rescue LoadError
|
|
92
|
+
nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def contains_kettle_dev_require?(node)
|
|
96
|
+
return false unless node.respond_to?(:child_nodes)
|
|
97
|
+
return true if kettle_dev_require_call?(node)
|
|
98
|
+
|
|
99
|
+
node.child_nodes.compact.any? { |child| contains_kettle_dev_require?(child) }
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def kettle_dev_require_call?(node)
|
|
103
|
+
return false unless node.is_a?(Prism::CallNode)
|
|
104
|
+
return false unless node.name == :require
|
|
105
|
+
|
|
106
|
+
node.arguments&.arguments.to_a.any? do |argument|
|
|
107
|
+
argument.is_a?(Prism::StringNode) && argument.unescaped == "kettle/dev"
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# This fallback is intentionally line-based because it is only used when
|
|
112
|
+
# Prism is unavailable in the templating runtime.
|
|
113
|
+
def require_kettle_dev_line(content)
|
|
114
|
+
lines = content.lines
|
|
115
|
+
require_index = lines.rindex { |line| line.strip == 'require "kettle/dev"' || line.strip == "require 'kettle/dev'" }
|
|
116
|
+
return unless require_index
|
|
117
|
+
|
|
118
|
+
block_start = lines[0..require_index].rindex { |line| line.strip == "begin" }
|
|
119
|
+
return require_index + 1 unless block_start
|
|
120
|
+
|
|
121
|
+
block_end = lines[block_start..].to_a.index { |line| line.strip == "end" }
|
|
122
|
+
block_end ? block_start + block_end + 1 : require_index + 1
|
|
123
|
+
end
|
|
78
124
|
end
|
|
79
125
|
end
|
|
80
126
|
end
|
data/lib/kettle/drift/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kettle-drift
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -64,6 +64,9 @@ dependencies:
|
|
|
64
64
|
- - "~>"
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
66
|
version: '2.0'
|
|
67
|
+
- - ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: 2.0.4
|
|
67
70
|
type: :development
|
|
68
71
|
prerelease: false
|
|
69
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -71,6 +74,9 @@ dependencies:
|
|
|
71
74
|
- - "~>"
|
|
72
75
|
- !ruby/object:Gem::Version
|
|
73
76
|
version: '2.0'
|
|
77
|
+
- - ">="
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: 2.0.4
|
|
74
80
|
- !ruby/object:Gem::Dependency
|
|
75
81
|
name: bundler-audit
|
|
76
82
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -148,7 +154,7 @@ dependencies:
|
|
|
148
154
|
version: '2.0'
|
|
149
155
|
- - ">="
|
|
150
156
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: 2.0.
|
|
157
|
+
version: 2.0.1
|
|
152
158
|
type: :development
|
|
153
159
|
prerelease: false
|
|
154
160
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -158,7 +164,7 @@ dependencies:
|
|
|
158
164
|
version: '2.0'
|
|
159
165
|
- - ">="
|
|
160
166
|
- !ruby/object:Gem::Version
|
|
161
|
-
version: 2.0.
|
|
167
|
+
version: 2.0.1
|
|
162
168
|
- !ruby/object:Gem::Dependency
|
|
163
169
|
name: ruby-progressbar
|
|
164
170
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -199,21 +205,21 @@ dependencies:
|
|
|
199
205
|
requirements:
|
|
200
206
|
- - "~>"
|
|
201
207
|
- !ruby/object:Gem::Version
|
|
202
|
-
version: '
|
|
208
|
+
version: '2.0'
|
|
203
209
|
- - ">="
|
|
204
210
|
- !ruby/object:Gem::Version
|
|
205
|
-
version:
|
|
211
|
+
version: 2.0.0
|
|
206
212
|
type: :development
|
|
207
213
|
prerelease: false
|
|
208
214
|
version_requirements: !ruby/object:Gem::Requirement
|
|
209
215
|
requirements:
|
|
210
216
|
- - "~>"
|
|
211
217
|
- !ruby/object:Gem::Version
|
|
212
|
-
version: '
|
|
218
|
+
version: '2.0'
|
|
213
219
|
- - ">="
|
|
214
220
|
- !ruby/object:Gem::Version
|
|
215
|
-
version:
|
|
216
|
-
description: "\
|
|
221
|
+
version: 2.0.0
|
|
222
|
+
description: "\U0001F372 Kettle::Drift tracks repeated adjacent-line chunks that usually
|
|
217
223
|
signal template drift or copy/paste corruption."
|
|
218
224
|
email:
|
|
219
225
|
- peter.boling@gmail.com
|
|
@@ -263,10 +269,10 @@ licenses:
|
|
|
263
269
|
- AGPL-3.0-only
|
|
264
270
|
metadata:
|
|
265
271
|
homepage_uri: https://structuredmerge.org
|
|
266
|
-
source_code_uri: https://github.com/kettle-rb/kettle-drift/tree/v1.0.
|
|
267
|
-
changelog_uri: https://github.com/kettle-rb/kettle-drift/blob/v1.0.
|
|
272
|
+
source_code_uri: https://github.com/kettle-rb/kettle-drift/tree/v1.0.1
|
|
273
|
+
changelog_uri: https://github.com/kettle-rb/kettle-drift/blob/v1.0.1/CHANGELOG.md
|
|
268
274
|
bug_tracker_uri: https://github.com/kettle-rb/kettle-drift/issues
|
|
269
|
-
documentation_uri: https://www.rubydoc.info/gems/kettle-drift/1.0.
|
|
275
|
+
documentation_uri: https://www.rubydoc.info/gems/kettle-drift/1.0.1
|
|
270
276
|
funding_uri: https://github.com/sponsors/pboling
|
|
271
277
|
wiki_uri: https://github.com/kettle-rb/kettle-drift/wiki
|
|
272
278
|
news_uri: https://www.railsbling.com/tags/kettle-drift
|
|
@@ -274,7 +280,7 @@ metadata:
|
|
|
274
280
|
rubygems_mfa_required: 'true'
|
|
275
281
|
rdoc_options:
|
|
276
282
|
- "--title"
|
|
277
|
-
- "kettle-drift - \
|
|
283
|
+
- "kettle-drift - \U0001F372 Detect duplicated adjacent lines introduced by template
|
|
278
284
|
drift."
|
|
279
285
|
- "--main"
|
|
280
286
|
- README.md
|
|
@@ -298,5 +304,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
304
|
requirements: []
|
|
299
305
|
rubygems_version: 4.0.10
|
|
300
306
|
specification_version: 4
|
|
301
|
-
summary: "\
|
|
307
|
+
summary: "\U0001F372 Detect duplicated adjacent lines introduced by template drift."
|
|
302
308
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|