prism-merge 1.0.0 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9b8b8c576a7a4a0d26192b08d55617c26b6ab21cd411f5f2f083750c09bf9c8
4
- data.tar.gz: bd229507398b4437f9039759e8d5b7b688268816b1fc65bb54d6b1740ea7ea10
3
+ metadata.gz: 2f29347e38d3c179a4bd23bff7fa7dcb28c1fbf9fc580daf4e7c9dc24b6dd270
4
+ data.tar.gz: ff84457a8c3a1ec383f04f643c6b9096c4c0c5231799e65d2f1265437675e119
5
5
  SHA512:
6
- metadata.gz: febeb559c0f42a3d7f1d4f7059b2cb88ac959708fa1b18ac6fb5f7f4d194df3f10cd0b56e0ad3b64f60ae46a71645a4195bc3aea63216208a6220acc4c48d254
7
- data.tar.gz: 7ff60f6e075f358b8d3b0a7cbbfffb2444a43bb17061a03c9ccc3f7f2dad03f5fb40b3409aa843eb3e32900eae058fafe92eef2201dc4e227d3359840cf8e05c
6
+ metadata.gz: d27caa5e2e42f281da2195c662d355bb94318db374d2c4257213f7784021df7da1aa36932102c9b0ecdf85ceb2b5ad05e75f8677b66ee94f651029235734468e
7
+ data.tar.gz: ad6f2aa2511ae55be9dd80435319a064b4b8a96f25de63c97d839162bc1b2b7a8b70103010b42afcd7d8b4a829c4e740cc1e05abe64194f1123a345da3e96107
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,35 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [1.0.2] - 2025-12-03
34
+
35
+ - TAG: [v1.0.2][1.0.2t]
36
+ - COVERAGE: 95.48% -- 613/642 lines in 7 files
37
+ - BRANCH COVERAGE: 81.39% -- 188/231 branches in 7 files
38
+ - 100.00% documented
39
+
40
+ ### Added
41
+
42
+ - specs covering existing support for end-of-line comments
43
+
44
+ ### Fixed
45
+
46
+ - Ruby compatibility documentation
47
+
48
+ ## [1.0.1] - 2025-12-03
49
+
50
+ - TAG: [v1.0.1][1.0.1t]
51
+ - COVERAGE: 95.48% -- 613/642 lines in 7 files
52
+ - BRANCH COVERAGE: 81.39% -- 188/231 branches in 7 files
53
+ - 100.00% documented
54
+
55
+ ### Fixed
56
+
57
+ - `SmartMerger` now correctly handles merge conflicts that involve `kettle-dev:freeze` blocks
58
+ - Entire freeze block from destination is preserved
59
+ - Still allows template-only nodes to be added
60
+ - Resolves an issue where template-only nodes were dropped if destination contained a freeze block
61
+
33
62
  ## [1.0.0] - 2025-12-03
34
63
 
35
64
  - TAG: [v1.0.0][1.0.0t]
@@ -41,6 +70,10 @@ Please file a bug if you notice a violation of semantic versioning.
41
70
 
42
71
  - Initial release
43
72
 
44
- [Unreleased]: https://github.com/kettle-rb/prism-merge/compare/v1.0.0...HEAD
73
+ [Unreleased]: https://github.com/kettle-rb/prism-merge/compare/v1.0.2...HEAD
74
+ [1.0.2]: https://github.com/kettle-rb/prism-merge/compare/v1.0.1...v1.0.2
75
+ [1.0.2t]: https://github.com/kettle-rb/prism-merge/releases/tag/v1.0.2
76
+ [1.0.1]: https://github.com/kettle-rb/prism-merge/compare/v1.0.0...v1.0.1
77
+ [1.0.1t]: https://github.com/kettle-rb/prism-merge/releases/tag/v1.0.1
45
78
  [1.0.0]: https://github.com/kettle-rb/prism-merge/compare/71fcddaa659cd6e9e94053e67524e5a400423ced...v1.0.0
46
79
  [1.0.0t]: https://github.com/kettle-rb/prism-merge/tags/v1.0.0
data/README.md CHANGED
@@ -84,9 +84,10 @@ File.write("merged.rb", result)
84
84
 
85
85
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
86
86
  |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
87
- | Works with JRuby | ![JRuby 9.1 Compat][💎jruby-9.1i] ![JRuby 9.2 Compat][💎jruby-9.2i] ![JRuby 9.3 Compat][💎jruby-9.3i] <br/> [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎10-j-wf] [![JRuby 10.0 Compat][💎jruby-c-i]][🚎11-c-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf] |
88
- | Works with Truffle Ruby | ![Truffle Ruby 22.3 Compat][💎truby-22.3i] ![Truffle Ruby 23.0 Compat][💎truby-23.0i] <br/> [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] |
87
+ | Works with JRuby | [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎10-j-wf] [![JRuby 10.0 Compat][💎jruby-c-i]][🚎11-c-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf] |
88
+ | Works with Truffle Ruby | [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] |
89
89
  | Works with MRI Ruby 3 | [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf] [![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf] |
90
+ | Works with MRI Ruby 2 | [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
90
91
  | Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] |
91
92
  | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
92
93
  | Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitLab Wiki][📜gl-wiki-img]][📜gl-wiki] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
@@ -97,7 +98,7 @@ File.write("merged.rb", result)
97
98
 
98
99
  ### Compatibility
99
100
 
100
- Compatible with MRI Ruby 3.2.0+, and concordant releases of JRuby, and TruffleRuby.
101
+ Compatible with MRI Ruby 2.7.0+, and concordant releases of JRuby, and TruffleRuby.
101
102
 
102
103
  | 🚚 _Amazing_ test matrix was brought to you by | 🔎 appraisal2 🔎 and the color 💚 green 💚 |
103
104
  |------------------------------------------------|--------------------------------------------------------|
@@ -965,7 +966,7 @@ Thanks for RTFM. ☺️
965
966
  [📌gitmoji]: https://gitmoji.dev
966
967
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
967
968
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
968
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.636-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
969
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.642-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
969
970
  [🔐security]: SECURITY.md
970
971
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
971
972
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -71,7 +71,9 @@ module Prism
71
71
  @add_template_only_nodes = add_template_only_nodes
72
72
  end
73
73
 
74
- # Resolve a boundary by deciding which content to keep
74
+ # Resolve a boundary by deciding which content to keep.
75
+ # If the boundary contains a `kettle-dev:freeze` block, the entire
76
+ # block from the destination is preserved.
75
77
  # @param boundary [FileAligner::Boundary] Boundary to resolve
76
78
  # @param result [MergeResult] Result object to populate
77
79
  def resolve(boundary, result)
@@ -79,12 +81,6 @@ module Prism
79
81
  template_content = extract_boundary_content(@template_analysis, boundary.template_range)
80
82
  dest_content = extract_boundary_content(@dest_analysis, boundary.dest_range)
81
83
 
82
- # If destination is in freeze block, always keep destination
83
- if boundary.dest_range && dest_content[:has_freeze_block]
84
- add_content_to_result(dest_content, result, :destination, MergeResult::DECISION_FREEZE_BLOCK)
85
- return
86
- end
87
-
88
84
  # If both sides are empty, nothing to do
89
85
  return if template_content[:lines].empty? && dest_content[:lines].empty?
90
86
 
@@ -153,12 +149,29 @@ module Prism
153
149
  template_nodes = template_content[:nodes]
154
150
  dest_nodes = dest_content[:nodes]
155
151
 
156
- # Build signature map for destination nodes
157
- dest_sig_map = build_signature_map(dest_nodes)
158
-
159
152
  # Track which dest nodes have been matched
160
153
  matched_dest_indices = Set.new
161
154
 
155
+ # Handle freeze blocks first
156
+ if dest_content[:has_freeze_block]
157
+ line_in_freeze = dest_content[:line_range].find { |ln| @dest_analysis.in_freeze_block?(ln) }
158
+ if line_in_freeze
159
+ freeze_block = @dest_analysis.freeze_block_at(line_in_freeze)
160
+ freeze_content = extract_boundary_content(@dest_analysis, freeze_block[:line_range])
161
+ add_content_to_result(freeze_content, result, :destination, MergeResult::DECISION_FREEZE_BLOCK)
162
+
163
+ # Mark all nodes within the freeze block as matched
164
+ dest_nodes.each do |d_node_info|
165
+ if freeze_block[:line_range].cover?(d_node_info[:line_range].begin)
166
+ matched_dest_indices << d_node_info[:index]
167
+ end
168
+ end
169
+ end
170
+ end
171
+
172
+ # Build signature map for destination nodes
173
+ dest_sig_map = build_signature_map(dest_nodes)
174
+
162
175
  # Build a set of line numbers that are covered by leading comments of nodes
163
176
  # so we don't duplicate them when processing non-node lines
164
177
  leading_comment_lines = Set.new
@@ -5,7 +5,7 @@ module Prism
5
5
  # Version information for Prism::Merge
6
6
  module Version
7
7
  # Current version of the prism-merge gem
8
- VERSION = "1.0.0"
8
+ VERSION = "1.0.2"
9
9
  end
10
10
  VERSION = Version::VERSION # traditional location
11
11
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prism-merge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -263,10 +263,10 @@ licenses:
263
263
  - MIT
264
264
  metadata:
265
265
  homepage_uri: https://prism-merge.galtzo.com/
266
- source_code_uri: https://github.com/kettle-rb/prism-merge/tree/v1.0.0
267
- changelog_uri: https://github.com/kettle-rb/prism-merge/blob/v1.0.0/CHANGELOG.md
266
+ source_code_uri: https://github.com/kettle-rb/prism-merge/tree/v1.0.2
267
+ changelog_uri: https://github.com/kettle-rb/prism-merge/blob/v1.0.2/CHANGELOG.md
268
268
  bug_tracker_uri: https://github.com/kettle-rb/prism-merge/issues
269
- documentation_uri: https://www.rubydoc.info/gems/prism-merge/1.0.0
269
+ documentation_uri: https://www.rubydoc.info/gems/prism-merge/1.0.2
270
270
  funding_uri: https://github.com/sponsors/pboling
271
271
  wiki_uri: https://github.com/kettle-rb/prism-merge/wiki
272
272
  news_uri: https://www.railsbling.com/tags/prism-merge
metadata.gz.sig CHANGED
Binary file