psych-merge 7.1.12 → 7.1.14
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/lib/psych/merge/file_analysis.rb +80 -0
- data/lib/psych/merge/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +18 -18
- 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: 4642c4e503825c032268df2314fb25cf2650ef67ac4e6c2a4fc9175e1b31e372
|
|
4
|
+
data.tar.gz: 98483469c41565702800219156d6ed8bfc32c336018400050681033d62cff718
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6932a6ef894537412aa95969ad4f5320d187f117300cc1e39608211c51209a057fd331eb885ee69d84b349747002749b29f785a91494d787da2082a6451afff2
|
|
7
|
+
data.tar.gz: 5099740dd5424b3f5d009cf1e6d183fcbc866aa2695174ed1b1a40cf579e0ad24774c1266f97acdee7a2116c9c4e8c92da6cf81ac4fa7ed5faf6b866f47488f1
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -194,6 +194,42 @@ module Psych
|
|
|
194
194
|
wrap_root_node(root)
|
|
195
195
|
end
|
|
196
196
|
|
|
197
|
+
# Return each nested YAML mapping/sequence's direct structural owners as
|
|
198
|
+
# its own sibling group. Keeping groups separate is essential: layout
|
|
199
|
+
# gaps are meaningful only relative to siblings with the same parent.
|
|
200
|
+
#
|
|
201
|
+
# @return [Array<Array<NodeWrapper>>]
|
|
202
|
+
def structural_owner_groups
|
|
203
|
+
@structural_owner_groups ||= begin
|
|
204
|
+
root = root_node
|
|
205
|
+
groups = []
|
|
206
|
+
@structural_owner_metadata = {}
|
|
207
|
+
collect_structural_owner_groups(root, [], groups) if root
|
|
208
|
+
groups
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Metadata describing a wrapper's parent-level structural ownership.
|
|
213
|
+
#
|
|
214
|
+
# @param owner [NodeWrapper]
|
|
215
|
+
# @return [Hash, nil]
|
|
216
|
+
def structural_owner_metadata_for(owner)
|
|
217
|
+
structural_owner_groups
|
|
218
|
+
@structural_owner_metadata[owner.object_id]
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Return a layout attachment calculated against the owner's actual YAML
|
|
222
|
+
# siblings, including nested mapping values and sequence items.
|
|
223
|
+
#
|
|
224
|
+
# @param owner [NodeWrapper] structural YAML owner
|
|
225
|
+
# @return [Ast::Merge::Layout::Attachment]
|
|
226
|
+
def layout_attachment_for(owner, **options)
|
|
227
|
+
siblings = structural_owner_groups.find { |group| group.any? { |candidate| candidate.equal?(owner) } }
|
|
228
|
+
return super unless siblings
|
|
229
|
+
|
|
230
|
+
structural_layout_attachment_for(owner, siblings, **options)
|
|
231
|
+
end
|
|
232
|
+
|
|
197
233
|
# Build a passive shared comment attachment for an owner.
|
|
198
234
|
#
|
|
199
235
|
# @param owner [Object] Structural owner for the attachment
|
|
@@ -234,6 +270,50 @@ module Psych
|
|
|
234
270
|
|
|
235
271
|
private
|
|
236
272
|
|
|
273
|
+
def structural_layout_attachment_for(owner, siblings, **options)
|
|
274
|
+
custom_end_line_for = options.key?(:end_line_for)
|
|
275
|
+
end_line_for = options.delete(:end_line_for) { method(:structural_layout_end_line_for) }
|
|
276
|
+
return layout_augmenter(owners: siblings, end_line_for: end_line_for, **options).attachment_for(owner) if
|
|
277
|
+
custom_end_line_for || !options.empty?
|
|
278
|
+
|
|
279
|
+
@structural_layout_augmenters ||= {}.compare_by_identity
|
|
280
|
+
augmenter = @structural_layout_augmenters[siblings] ||=
|
|
281
|
+
layout_augmenter(owners: siblings, end_line_for: end_line_for)
|
|
282
|
+
augmenter.attachment_for(owner)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def structural_layout_end_line_for(candidate)
|
|
286
|
+
end_line = candidate.node.end_line
|
|
287
|
+
end_line -= 1 while end_line > candidate.start_line && lines[end_line - 1].to_s.strip.empty?
|
|
288
|
+
end_line
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
def collect_structural_owner_groups(wrapper, parent_path, groups)
|
|
292
|
+
return unless wrapper
|
|
293
|
+
|
|
294
|
+
group_kind, children = if wrapper.mapping?
|
|
295
|
+
[:mapping_entry,
|
|
296
|
+
wrapper.mapping_entries(comment_tracker: @comment_tracker).map(&:last)]
|
|
297
|
+
elsif wrapper.sequence?
|
|
298
|
+
[:sequence_item, wrapper.sequence_items(comment_tracker: @comment_tracker)]
|
|
299
|
+
else
|
|
300
|
+
[nil, []]
|
|
301
|
+
end
|
|
302
|
+
return if children.empty?
|
|
303
|
+
|
|
304
|
+
groups << children
|
|
305
|
+
children.each_with_index do |child, index|
|
|
306
|
+
path = if group_kind == :mapping_entry
|
|
307
|
+
parent_path + [child.key.to_s]
|
|
308
|
+
else
|
|
309
|
+
parent_path + [index]
|
|
310
|
+
end
|
|
311
|
+
@structural_owner_metadata[child.object_id] =
|
|
312
|
+
{ kind: group_kind, index: (index if group_kind == :sequence_item), path: path.freeze }
|
|
313
|
+
collect_structural_owner_groups(child, path, groups)
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
|
|
237
317
|
def mapping_entry_attachment(owner)
|
|
238
318
|
augmenter_attachment = comment_augmenter(owners: [owner]).attachment_for(owner)
|
|
239
319
|
comment_blocks = full_line_comment_blocks_before(owner.key.start_line || 1)
|
data/lib/psych/merge/version.rb
CHANGED
|
@@ -5,7 +5,7 @@ module Psych
|
|
|
5
5
|
# Version namespace for this gem.
|
|
6
6
|
module Version
|
|
7
7
|
# Current gem version.
|
|
8
|
-
VERSION = '7.1.
|
|
8
|
+
VERSION = '7.1.14'
|
|
9
9
|
end
|
|
10
10
|
# Current gem version exposed at the traditional constant location.
|
|
11
11
|
VERSION = Version::VERSION # Traditional Constant Location
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: psych-merge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.1.
|
|
4
|
+
version: 7.1.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -43,28 +43,28 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - '='
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 7.1.
|
|
46
|
+
version: 7.1.14
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - '='
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 7.1.
|
|
53
|
+
version: 7.1.14
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: tree_haver
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
58
|
- - '='
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 7.1.
|
|
60
|
+
version: 7.1.14
|
|
61
61
|
type: :runtime
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - '='
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 7.1.
|
|
67
|
+
version: 7.1.14
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: version_gem
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -91,14 +91,14 @@ dependencies:
|
|
|
91
91
|
requirements:
|
|
92
92
|
- - '='
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: 7.1.
|
|
94
|
+
version: 7.1.14
|
|
95
95
|
type: :runtime
|
|
96
96
|
prerelease: false
|
|
97
97
|
version_requirements: !ruby/object:Gem::Requirement
|
|
98
98
|
requirements:
|
|
99
99
|
- - '='
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: 7.1.
|
|
101
|
+
version: 7.1.14
|
|
102
102
|
- !ruby/object:Gem::Dependency
|
|
103
103
|
name: kettle-dev
|
|
104
104
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -108,7 +108,7 @@ dependencies:
|
|
|
108
108
|
version: '3.1'
|
|
109
109
|
- - ">="
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: 3.1.
|
|
111
|
+
version: 3.1.18
|
|
112
112
|
type: :development
|
|
113
113
|
prerelease: false
|
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -118,7 +118,7 @@ dependencies:
|
|
|
118
118
|
version: '3.1'
|
|
119
119
|
- - ">="
|
|
120
120
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: 3.1.
|
|
121
|
+
version: 3.1.18
|
|
122
122
|
- !ruby/object:Gem::Dependency
|
|
123
123
|
name: bundler-audit
|
|
124
124
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -216,7 +216,7 @@ dependencies:
|
|
|
216
216
|
version: '2.0'
|
|
217
217
|
- - ">="
|
|
218
218
|
- !ruby/object:Gem::Version
|
|
219
|
-
version: 2.0.
|
|
219
|
+
version: 2.0.27
|
|
220
220
|
type: :development
|
|
221
221
|
prerelease: false
|
|
222
222
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -226,27 +226,27 @@ dependencies:
|
|
|
226
226
|
version: '2.0'
|
|
227
227
|
- - ">="
|
|
228
228
|
- !ruby/object:Gem::Version
|
|
229
|
-
version: 2.0.
|
|
229
|
+
version: 2.0.27
|
|
230
230
|
- !ruby/object:Gem::Dependency
|
|
231
231
|
name: turbo_tests2
|
|
232
232
|
requirement: !ruby/object:Gem::Requirement
|
|
233
233
|
requirements:
|
|
234
234
|
- - "~>"
|
|
235
235
|
- !ruby/object:Gem::Version
|
|
236
|
-
version: '
|
|
236
|
+
version: '4.0'
|
|
237
237
|
- - ">="
|
|
238
238
|
- !ruby/object:Gem::Version
|
|
239
|
-
version:
|
|
239
|
+
version: 4.0.0
|
|
240
240
|
type: :development
|
|
241
241
|
prerelease: false
|
|
242
242
|
version_requirements: !ruby/object:Gem::Requirement
|
|
243
243
|
requirements:
|
|
244
244
|
- - "~>"
|
|
245
245
|
- !ruby/object:Gem::Version
|
|
246
|
-
version: '
|
|
246
|
+
version: '4.0'
|
|
247
247
|
- - ">="
|
|
248
248
|
- !ruby/object:Gem::Version
|
|
249
|
-
version:
|
|
249
|
+
version: 4.0.0
|
|
250
250
|
- !ruby/object:Gem::Dependency
|
|
251
251
|
name: ruby-progressbar
|
|
252
252
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -338,10 +338,10 @@ licenses:
|
|
|
338
338
|
- PolyForm-Small-Business-1.0.0
|
|
339
339
|
metadata:
|
|
340
340
|
homepage_uri: https://structuredmerge.org
|
|
341
|
-
source_code_uri: https://github.com/structuredmerge/structuredmerge-ruby/tree/v7.1.
|
|
342
|
-
changelog_uri: https://github.com/structuredmerge/structuredmerge-ruby/blob/v7.1.
|
|
341
|
+
source_code_uri: https://github.com/structuredmerge/structuredmerge-ruby/tree/v7.1.14
|
|
342
|
+
changelog_uri: https://github.com/structuredmerge/structuredmerge-ruby/blob/v7.1.14/CHANGELOG.md
|
|
343
343
|
bug_tracker_uri: https://github.com/structuredmerge/structuredmerge-ruby/issues
|
|
344
|
-
documentation_uri: https://www.rubydoc.info/gems/psych-merge/7.1.
|
|
344
|
+
documentation_uri: https://www.rubydoc.info/gems/psych-merge/7.1.14
|
|
345
345
|
funding_uri: https://github.com/sponsors/pboling
|
|
346
346
|
wiki_uri: https://github.com/structuredmerge/structuredmerge-ruby/wiki
|
|
347
347
|
news_uri: https://www.railsbling.com/tags/psych-merge
|
metadata.gz.sig
CHANGED
|
Binary file
|