markus 4.0.18 → 4.0.19
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/markus.rb +5 -3
- data/markus.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d3b9d8f0f128ae19a1c22c62593e6fa92e47d42
|
4
|
+
data.tar.gz: 631f74819c013ba5f978bba90f0fda0a206d7b4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 116c74df7f63b04362af86be3c01bcb45bbf2aba9039c2e0760be4d3d90de9bc307b28adea33fa8f2c7ee35d74ba9d50690efddac419a0e9f9786b8baec6f9a9
|
7
|
+
data.tar.gz: 4e992673dd97747d3149ad8c38b0d9730bc237ca9b6b71ab1d061cd7db3dfbdf826375a045639d70debe94e03079b9432e38d057561cea1f480a7ca414395a75
|
data/lib/markus.rb
CHANGED
@@ -29,6 +29,8 @@ class MarkUS
|
|
29
29
|
attr_accessor :__markus_includes
|
30
30
|
end
|
31
31
|
|
32
|
+
class MarkUSString < String; end
|
33
|
+
|
32
34
|
attr_reader :__markus_indent, :__markus_reload
|
33
35
|
def __markus_indent=(value) #{{{
|
34
36
|
self.class.__markus_indent = value == true ? true : false
|
@@ -172,7 +174,7 @@ class MarkUS
|
|
172
174
|
}.compact.join(", ").strip + " }"
|
173
175
|
attrs = '{}' if attrs == "{ }"
|
174
176
|
when String
|
175
|
-
content = "\"#{a.gsub(/"/,'\\\"')}\""
|
177
|
+
content = a.class == ::MarkUS::MarkUSString ? a : "\"#{a.gsub(/"/,'\\\"')}\""
|
176
178
|
when Integer, Float
|
177
179
|
content = a
|
178
180
|
else
|
@@ -192,8 +194,8 @@ class MarkUS
|
|
192
194
|
@__markus_parent = nil
|
193
195
|
|
194
196
|
@__markus_buffer << __markus_indent + "\"#{tname}\": {"
|
195
|
-
__markus_json "attributes", attrs if attrs
|
196
|
-
__markus_json "value", content if content
|
197
|
+
__markus_json "attributes", ::MarkUS::MarkUSString.new(attrs) if attrs
|
198
|
+
__markus_json "value", ::MarkUS::MarkUSString.new(content) if content
|
197
199
|
__markus_json "content", &blk if blk
|
198
200
|
@__markus_buffer.last.chomp!(',')
|
199
201
|
@__markus_buffer << __markus_indent + "},"
|
data/markus.gemspec
CHANGED