to_simple_yaml 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/to_simple_yaml/core.rb +2 -2
- data/lib/to_simple_yaml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ca65651f069d3d7c1818b5ca31c1d40536465f41cc1bebaaee9a5da968160aa
|
4
|
+
data.tar.gz: 732c0b2ddabe7594bc72c748b91b74476de533690d3e69095a432b3fe8bc0c3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31290e9b62b0490749a4816ce1f9bc0a8da7fd2bad34570140b451c5a01466d57a142ff9a7833a7aab2edc04034559a6cd923ecc4dd516e5531a90961414278a
|
7
|
+
data.tar.gz: 2bea9806043385131a6b584bf011112dc180afd0e3d2c32a8ed8b99bb9c73b009a934df7c5066322e4b4e39f00b1fc7fa9afc57a5cb0fe0a142cdacf1b0c3ef8
|
data/Gemfile.lock
CHANGED
data/lib/to_simple_yaml/core.rb
CHANGED
@@ -25,7 +25,7 @@ class Object
|
|
25
25
|
obj.compact.keys.each_with_index do |key, index|
|
26
26
|
array_first = array && index == 0
|
27
27
|
array_inline = array && index != 0
|
28
|
-
if obj[key].is_a?(String) && obj[key].start_with?('#')
|
28
|
+
if obj[key].is_a?(String) && obj[key].start_with?('#', '*')
|
29
29
|
yaml << template("#{array_first ? '- ' : ''}#{key}: '#{obj[key]}'", array_inline ? indent + 1 : indent)
|
30
30
|
elsif obj[key].is_a?(String) || obj[key].is_a?(Numeric) || obj[key].is_a?(TrueClass) || obj[key].is_a?(FalseClass)
|
31
31
|
yaml << template("#{array_first ? '- ' : ''}#{key}: #{obj[key]}", array_inline ? indent + 1 : indent)
|
@@ -43,7 +43,7 @@ class Object
|
|
43
43
|
elsif obj.is_a?(Array)
|
44
44
|
yaml = ''
|
45
45
|
obj.compact.each do |value|
|
46
|
-
if value.is_a?(String) && value.start_with?('#')
|
46
|
+
if value.is_a?(String) && value.start_with?('#', '*')
|
47
47
|
yaml << template("- '#{value}'", indent)
|
48
48
|
elsif value.is_a?(String) || value.is_a?(Numeric) || value.is_a?(TrueClass) || value.is_a?(FalseClass)
|
49
49
|
yaml << template("- #{value}", indent)
|