yaml-sort 2.2.2 → 2.2.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 +16 -0
- data/lib/yaml/sort/parser.rb +37 -36
- data/lib/yaml/sort/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aad6c908f5ec9b2e7f77a4cda39a1df1fa5f1410b7936588bcaad088245beb74
|
4
|
+
data.tar.gz: d83defb489b3f9bbe9843dbe7b922ca8f1b22200048a29d0e693e8861515e7d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24118848842df1eb6a683209a81f11f2c708307677db5f724657742b42bd9d98f0c2ee47c6a870e7a13b88b6e9f073392dad11c595420d3fbe4a981915bd5ba7
|
7
|
+
data.tar.gz: f905f585a39e7526553f4e3a0d59560a3ed0330c7fb9354f3882406317a75c52771af6e5ee083fb323238047da2954b87a902b2ce7e611141993748a9db245d4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
|
+
## [v2.2.4](https://github.com/smortex/yaml-sort/tree/v2.2.4) (2023-01-11)
|
7
|
+
|
8
|
+
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.2.3...v2.2.4)
|
9
|
+
|
10
|
+
**Fixed bugs:**
|
11
|
+
|
12
|
+
- Fix parsing of lists with empty values [\#30](https://github.com/smortex/yaml-sort/pull/30) ([smortex](https://github.com/smortex))
|
13
|
+
|
14
|
+
## [v2.2.3](https://github.com/smortex/yaml-sort/tree/v2.2.3) (2023-01-09)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.2.2...v2.2.3)
|
17
|
+
|
18
|
+
**Fixed bugs:**
|
19
|
+
|
20
|
+
- Fix parsing of blank lines in multi-line VALUE [\#27](https://github.com/smortex/yaml-sort/pull/27) ([smortex](https://github.com/smortex))
|
21
|
+
|
6
22
|
## [v2.2.2](https://github.com/smortex/yaml-sort/tree/v2.2.2) (2023-01-06)
|
7
23
|
|
8
24
|
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.2.1...v2.2.2)
|
data/lib/yaml/sort/parser.rb
CHANGED
@@ -13,7 +13,7 @@ module Yaml
|
|
13
13
|
module Sort
|
14
14
|
class Parser < Racc::Parser
|
15
15
|
|
16
|
-
module_eval(<<'...end parser.ra/module_eval...', 'parser.ra',
|
16
|
+
module_eval(<<'...end parser.ra/module_eval...', 'parser.ra', 40)
|
17
17
|
|
18
18
|
def scan(text)
|
19
19
|
text = "---\n#{text}" unless text.start_with?("---\n")
|
@@ -37,13 +37,6 @@ def scan(text)
|
|
37
37
|
emit(:ANCHOR, s.matched[1..-1])
|
38
38
|
when s.scan(/\*[[:alnum:]]+/)
|
39
39
|
emit(:ALIAS, s.matched[1..-1])
|
40
|
-
when s.scan(/[|>][-+]?(?=\n)/)
|
41
|
-
match = s.matched
|
42
|
-
|
43
|
-
while s.match?("\n" + last_indent_value + " ")
|
44
|
-
match += s.scan(/\n[^\n]+(?=\n)/)
|
45
|
-
end
|
46
|
-
emit(:VALUE, match)
|
47
40
|
when s.scan(/"/)
|
48
41
|
match = s.matched
|
49
42
|
loop do
|
@@ -66,8 +59,8 @@ def scan(text)
|
|
66
59
|
when s.match?(/\S+/)
|
67
60
|
match = s.scan_until(/$/)
|
68
61
|
|
69
|
-
while s.match?("\n" + last_indent_value + " ")
|
70
|
-
match += s.scan(/\n[^\n]
|
62
|
+
while s.match?("\n" + last_indent_value + " ") || s.match?(/\n[[:blank:]]*(?=\n)/)
|
63
|
+
match += s.scan(/\n[^\n]*(?=\n)/)
|
71
64
|
end
|
72
65
|
emit(:VALUE, match)
|
73
66
|
end
|
@@ -212,25 +205,25 @@ end
|
|
212
205
|
|
213
206
|
racc_action_table = [
|
214
207
|
5, 10, 2, 12, 3, 8, 5, 10, 13, 12,
|
215
|
-
19, 8, 5, 10,
|
216
|
-
|
217
|
-
|
208
|
+
19, 8, 5, 10, 10, 15, 21, 8, 5, 10,
|
209
|
+
14, 12, nil, 8, 5, 10, nil, 12, nil, 8,
|
210
|
+
17, 12 ]
|
218
211
|
|
219
212
|
racc_action_check = [
|
220
213
|
2, 2, 0, 2, 1, 2, 10, 10, 3, 10,
|
221
|
-
10, 10, 12, 12,
|
222
|
-
|
223
|
-
|
214
|
+
10, 10, 12, 12, 6, 6, 12, 12, 19, 19,
|
215
|
+
4, 19, nil, 19, 21, 21, nil, 21, nil, 21,
|
216
|
+
7, 7 ]
|
224
217
|
|
225
218
|
racc_action_pointer = [
|
226
|
-
0, 4, -4, 8,
|
219
|
+
0, 4, -4, 8, 17, nil, 9, 24, nil, nil,
|
227
220
|
2, nil, 8, nil, nil, nil, nil, nil, nil, 14,
|
228
221
|
nil, 20, nil, nil, nil ]
|
229
222
|
|
230
223
|
racc_action_default = [
|
231
|
-
-
|
232
|
-
-
|
233
|
-
-10, -
|
224
|
+
-16, -16, -16, -16, -2, -3, -16, -16, -6, -8,
|
225
|
+
-16, -12, -15, 25, -1, -4, -7, -5, -11, -16,
|
226
|
+
-10, -16, -14, -9, -13 ]
|
234
227
|
|
235
228
|
racc_goto_table = [
|
236
229
|
4, 1, 16, 18, nil, nil, nil, nil, 20, nil,
|
@@ -261,9 +254,10 @@ racc_reduce_table = [
|
|
261
254
|
2, 14, :_reduce_11,
|
262
255
|
1, 14, :_reduce_12,
|
263
256
|
3, 16, :_reduce_13,
|
264
|
-
2, 16, :_reduce_14
|
257
|
+
2, 16, :_reduce_14,
|
258
|
+
1, 16, :_reduce_15 ]
|
265
259
|
|
266
|
-
racc_reduce_n =
|
260
|
+
racc_reduce_n = 16
|
267
261
|
|
268
262
|
racc_shift_n = 25
|
269
263
|
|
@@ -324,104 +318,111 @@ Racc_debug_parser = false
|
|
324
318
|
|
325
319
|
# reduce 0 omitted
|
326
320
|
|
327
|
-
module_eval(<<'.,.,', 'parser.ra',
|
321
|
+
module_eval(<<'.,.,', 'parser.ra', 12)
|
328
322
|
def _reduce_1(val, _values, result)
|
329
323
|
result = val[1]
|
330
324
|
result
|
331
325
|
end
|
332
326
|
.,.,
|
333
327
|
|
334
|
-
module_eval(<<'.,.,', 'parser.ra',
|
328
|
+
module_eval(<<'.,.,', 'parser.ra', 13)
|
335
329
|
def _reduce_2(val, _values, result)
|
336
330
|
result = val[1]
|
337
331
|
result
|
338
332
|
end
|
339
333
|
.,.,
|
340
334
|
|
341
|
-
module_eval(<<'.,.,', 'parser.ra',
|
335
|
+
module_eval(<<'.,.,', 'parser.ra', 15)
|
342
336
|
def _reduce_3(val, _values, result)
|
343
337
|
result = Scalar.new(val[0])
|
344
338
|
result
|
345
339
|
end
|
346
340
|
.,.,
|
347
341
|
|
348
|
-
module_eval(<<'.,.,', 'parser.ra',
|
342
|
+
module_eval(<<'.,.,', 'parser.ra', 16)
|
349
343
|
def _reduce_4(val, _values, result)
|
350
344
|
result = val[0]
|
351
345
|
result
|
352
346
|
end
|
353
347
|
.,.,
|
354
348
|
|
355
|
-
module_eval(<<'.,.,', 'parser.ra',
|
349
|
+
module_eval(<<'.,.,', 'parser.ra', 17)
|
356
350
|
def _reduce_5(val, _values, result)
|
357
351
|
result = val[0]
|
358
352
|
result
|
359
353
|
end
|
360
354
|
.,.,
|
361
355
|
|
362
|
-
module_eval(<<'.,.,', 'parser.ra',
|
356
|
+
module_eval(<<'.,.,', 'parser.ra', 18)
|
363
357
|
def _reduce_6(val, _values, result)
|
364
358
|
result = Alias.new(@anchors, val[0])
|
365
359
|
result
|
366
360
|
end
|
367
361
|
.,.,
|
368
362
|
|
369
|
-
module_eval(<<'.,.,', 'parser.ra',
|
363
|
+
module_eval(<<'.,.,', 'parser.ra', 20)
|
370
364
|
def _reduce_7(val, _values, result)
|
371
365
|
val[0].add_item(*val[1]); result = val[0]
|
372
366
|
result
|
373
367
|
end
|
374
368
|
.,.,
|
375
369
|
|
376
|
-
module_eval(<<'.,.,', 'parser.ra',
|
370
|
+
module_eval(<<'.,.,', 'parser.ra', 21)
|
377
371
|
def _reduce_8(val, _values, result)
|
378
372
|
result = Dictionary.create(*val[0])
|
379
373
|
result
|
380
374
|
end
|
381
375
|
.,.,
|
382
376
|
|
383
|
-
module_eval(<<'.,.,', 'parser.ra',
|
377
|
+
module_eval(<<'.,.,', 'parser.ra', 23)
|
384
378
|
def _reduce_9(val, _values, result)
|
385
379
|
@anchors[val[1][:value]] = val[2]; result = [Scalar.new(val[0]), Alias.new(@anchors, val[1])]
|
386
380
|
result
|
387
381
|
end
|
388
382
|
.,.,
|
389
383
|
|
390
|
-
module_eval(<<'.,.,', 'parser.ra',
|
384
|
+
module_eval(<<'.,.,', 'parser.ra', 24)
|
391
385
|
def _reduce_10(val, _values, result)
|
392
386
|
result = [Scalar.new(val[0]), val[1]]
|
393
387
|
result
|
394
388
|
end
|
395
389
|
.,.,
|
396
390
|
|
397
|
-
module_eval(<<'.,.,', 'parser.ra',
|
391
|
+
module_eval(<<'.,.,', 'parser.ra', 26)
|
398
392
|
def _reduce_11(val, _values, result)
|
399
393
|
val[0].add_item(*val[1]); result = val[0]
|
400
394
|
result
|
401
395
|
end
|
402
396
|
.,.,
|
403
397
|
|
404
|
-
module_eval(<<'.,.,', 'parser.ra',
|
398
|
+
module_eval(<<'.,.,', 'parser.ra', 27)
|
405
399
|
def _reduce_12(val, _values, result)
|
406
400
|
result = List.create(*val[0])
|
407
401
|
result
|
408
402
|
end
|
409
403
|
.,.,
|
410
404
|
|
411
|
-
module_eval(<<'.,.,', 'parser.ra',
|
405
|
+
module_eval(<<'.,.,', 'parser.ra', 29)
|
412
406
|
def _reduce_13(val, _values, result)
|
413
407
|
@anchors[val[1][:value]] = val[2]; result = [Item.new(val[0]), Alias.new(@anchors, val[1])]
|
414
408
|
result
|
415
409
|
end
|
416
410
|
.,.,
|
417
411
|
|
418
|
-
module_eval(<<'.,.,', 'parser.ra',
|
412
|
+
module_eval(<<'.,.,', 'parser.ra', 30)
|
419
413
|
def _reduce_14(val, _values, result)
|
420
414
|
result = [Item.new(val[0]), val[1]]
|
421
415
|
result
|
422
416
|
end
|
423
417
|
.,.,
|
424
418
|
|
419
|
+
module_eval(<<'.,.,', 'parser.ra', 31)
|
420
|
+
def _reduce_15(val, _values, result)
|
421
|
+
result = [Item.new(val[0]), Scalar.new({value: ''})]
|
422
|
+
result
|
423
|
+
end
|
424
|
+
.,.,
|
425
|
+
|
425
426
|
def _reduce_none(val, _values, result)
|
426
427
|
val[0]
|
427
428
|
end
|
data/lib/yaml/sort/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml-sort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Romain Tartière
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email:
|
71
71
|
- romain@blogreen.org
|
72
72
|
executables:
|
@@ -106,7 +106,7 @@ metadata:
|
|
106
106
|
source_code_uri: https://github.com/smortex/yaml-sort
|
107
107
|
changelog_uri: https://github.com/smortex/yaml-sort/blob/master/CHANGELOG.md
|
108
108
|
rubygems_mfa_required: 'true'
|
109
|
-
post_install_message:
|
109
|
+
post_install_message:
|
110
110
|
rdoc_options: []
|
111
111
|
require_paths:
|
112
112
|
- lib
|
@@ -121,8 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
125
|
-
signing_key:
|
124
|
+
rubygems_version: 3.2.5
|
125
|
+
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Sort lines in YAML files in a predictable order
|
128
128
|
test_files: []
|