yaml-sort 2.0.0 → 2.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
- data/CHANGELOG.md +10 -2
- data/lib/yaml/sort/parser.rb +18 -5
- 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: e8eee6a8ad9b5761ffc9e9ef08f6025c66e3c661acfef15f197b3d28f67e3253
|
4
|
+
data.tar.gz: 108d4ea68106e308eafbe6bce7cd372556ebde65010ade2b1b742e82f43f29d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 234b85bdf4dd61f2bfa5a8568c59979ad12c374af47daed35d0a7248b0e1b8f96aed17bc77ba17ca2d8a7233d55803c9d6c5a4fcfa962394d6183ff61a3e9e21
|
7
|
+
data.tar.gz: 525ca02351c0f79d86a6e367341b4c8750b294400ffd96a7d4ad00dfced59de0e16060b29a5ceb0b0dcb40d95db9f8d1f1b8fcaabbfb1dfb6c3a58fa470ad27d
|
data/CHANGELOG.md
CHANGED
@@ -3,9 +3,17 @@ 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
|
-
## [2.0.
|
6
|
+
## [2.0.1](https://github.com/smortex/yaml-sort/tree/2.0.1) (2022-06-01)
|
7
7
|
|
8
|
-
[Full Changelog](https://github.com/smortex/yaml-sort/compare/
|
8
|
+
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.0.0...2.0.1)
|
9
|
+
|
10
|
+
**Fixed bugs:**
|
11
|
+
|
12
|
+
- Fix parsing of keys with spaces [\#8](https://github.com/smortex/yaml-sort/pull/8) ([smortex](https://github.com/smortex))
|
13
|
+
|
14
|
+
## [v2.0.0](https://github.com/smortex/yaml-sort/tree/v2.0.0) (2022-04-25)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v1.0.1...v2.0.0)
|
9
17
|
|
10
18
|
**Merged pull requests:**
|
11
19
|
|
data/lib/yaml/sort/parser.rb
CHANGED
@@ -78,7 +78,7 @@ def scan(text)
|
|
78
78
|
when s.scan(/\n[[:blank:]]*#.*/) then emit(:COMMENT, s.matched)
|
79
79
|
when s.scan(/\n([[:blank:]]*-) */) then emit(:ITEM, s.matched, indent: s.captures[0])
|
80
80
|
when s.scan(/\n[[:blank:]]*\.\.\./) then emit(:END_OF_DOCUMENT, s.matched)
|
81
|
-
when s.scan(/\n?([[:blank:]]*)(
|
81
|
+
when s.scan(/\n?([[:blank:]]*)(.+:)(?=[ \n])/)
|
82
82
|
indent = s.captures[0]
|
83
83
|
indent = last_indent_value + indent + " " unless s.matched.start_with?("\n")
|
84
84
|
emit(:KEY, s.matched, indent: indent, value: s.captures[1])
|
@@ -88,10 +88,23 @@ def scan(text)
|
|
88
88
|
when s.match?(/./)
|
89
89
|
scan_value = true
|
90
90
|
else
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
message = if @lines[@lineno - 1][@position] == "\n"
|
92
|
+
<<~MESSAGE
|
93
|
+
#{@filename}:#{@lineno + 1}: unexpected content
|
94
|
+
#{@lines[@lineno].chomp}
|
95
|
+
^#{"~" * (@lines[@lineno].chomp.length - 1)}
|
96
|
+
MESSAGE
|
97
|
+
else
|
98
|
+
<<~MESSAGE
|
99
|
+
#{@filename}:#{@lineno}: unexpected content
|
100
|
+
#{@lines[@lineno - 1].chomp}
|
101
|
+
#{" " * @position}^
|
102
|
+
MESSAGE
|
103
|
+
end
|
104
|
+
raise(Racc::ParseError, message)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
95
108
|
|
96
109
|
unindent
|
97
110
|
|
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.0.
|
4
|
+
version: 2.0.1
|
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: 2022-
|
11
|
+
date: 2022-06-01 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:
|
@@ -104,7 +104,7 @@ metadata:
|
|
104
104
|
source_code_uri: https://github.com/smortex/yaml-sort
|
105
105
|
changelog_uri: https://github.com/smortex/yaml-sort/blob/master/CHANGELOG.md
|
106
106
|
rubygems_mfa_required: 'true'
|
107
|
-
post_install_message:
|
107
|
+
post_install_message:
|
108
108
|
rdoc_options: []
|
109
109
|
require_paths:
|
110
110
|
- lib
|
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
123
|
-
signing_key:
|
122
|
+
rubygems_version: 3.2.5
|
123
|
+
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Sort lines in YAML files in a predictable order
|
126
126
|
test_files: []
|