immosquare-yaml 1.0.4 → 1.0.5
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/lib/immosquare-yaml/flatten.rb +3 -3
- data/lib/immosquare-yaml/shared_methods.rb +0 -1
- data/lib/immosquare-yaml/version.rb +1 -1
- data/lib/immosquare-yaml.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '089aa9af3b0755cde4f7f0c20af8590e5bb3229f95384f89da5871c1370842b6'
|
|
4
|
+
data.tar.gz: 2c2c82b7cf2d6ee1a3019f230fc7f9985fb730ea4830c3830191ed92eb423c65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0552b22304b12ef1ab7b782beab77aee3574a9866158896bbe828d170549c17b33e2070aec99d9b4067d043adc64f74da80182b64c4bc1f8430c67185bbb24e
|
|
7
|
+
data.tar.gz: ee58bca18dae3197b6e8a749c47a627ae8c965906d90625925b42737351532d0c3eda2f74d9b77c985377f1e541eb46e8da86cecf91729702a36a270cb72029e
|
|
@@ -138,11 +138,11 @@ module ImmosquareYaml
|
|
|
138
138
|
entries.sort_by {|path, _value, file| [path, file.to_s] }
|
|
139
139
|
elsif options[:with_values]
|
|
140
140
|
entries.sort_by {|path, _value, file| [path, file.to_s] }
|
|
141
|
-
|
|
141
|
+
.map {|path, value, _file| [path, value] }
|
|
142
142
|
elsif options[:with_file]
|
|
143
143
|
entries.map {|path, _value, file| [path, file] }
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
.uniq
|
|
145
|
+
.sort_by {|path, file| [path, file.to_s] }
|
|
146
146
|
else
|
|
147
147
|
entries.map(&:first).uniq.sort
|
|
148
148
|
end
|
|
@@ -8,7 +8,6 @@ module ImmosquareYaml
|
|
|
8
8
|
DOUBLE_QUOTE = '"'.freeze
|
|
9
9
|
DOUBLE_SIMPLE_QUOTE = "''".freeze
|
|
10
10
|
CUSTOM_SEPARATOR = "_#_#_".freeze
|
|
11
|
-
WEIRD_QUOTES_REGEX = /‘|’|“|”|‛|‚|„|‟|#{Regexp.quote(DOUBLE_SIMPLE_QUOTE)}/
|
|
12
11
|
YML_SPECIAL_CHARS = ["-", "`", "{", "}", "|", "[", "]", ">", ":", "\"", "'", "*", "=", "%", ",", "!", "?", "&", "#", "@"].freeze
|
|
13
12
|
RESERVED_KEYS = [
|
|
14
13
|
"yes", "no", "on", "off", "true", "false",
|
data/lib/immosquare-yaml.rb
CHANGED
|
@@ -278,7 +278,6 @@ module ImmosquareYaml
|
|
|
278
278
|
def format_scalar_value(value)
|
|
279
279
|
value = value.to_s
|
|
280
280
|
value = decode_unicode_escapes(value)
|
|
281
|
-
value = value.gsub(WEIRD_QUOTES_REGEX, SIMPLE_QUOTE)
|
|
282
281
|
|
|
283
282
|
##============================================================##
|
|
284
283
|
## On enlève les guillemets parasites éventuels (cas de fichiers
|
|
@@ -355,7 +354,7 @@ module ImmosquareYaml
|
|
|
355
354
|
## qui pouvaient contenir des valeurs avec quotes incluses.
|
|
356
355
|
##============================================================##
|
|
357
356
|
def strip_wrapping_quotes(value)
|
|
358
|
-
value = value[1..-2] while (value.start_with?(DOUBLE_QUOTE) && value.end_with?(DOUBLE_QUOTE)) || (value.start_with?(SIMPLE_QUOTE) && value.end_with?(SIMPLE_QUOTE))
|
|
357
|
+
value = value[1..-2] while value.length > 2 && ((value.start_with?(DOUBLE_QUOTE) && value.end_with?(DOUBLE_QUOTE)) || (value.start_with?(SIMPLE_QUOTE) && value.end_with?(SIMPLE_QUOTE)))
|
|
359
358
|
value
|
|
360
359
|
end
|
|
361
360
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: immosquare-yaml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- immosquare
|
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
62
|
version: '0'
|
|
63
63
|
requirements: []
|
|
64
|
-
rubygems_version: 4.0.
|
|
64
|
+
rubygems_version: 4.0.23
|
|
65
65
|
specification_version: 4
|
|
66
66
|
summary: A YAML parser optimized for translation files.
|
|
67
67
|
test_files: []
|