contentstack_utils 1.1.3.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/check-branch.yml +20 -0
- data/.github/workflows/codeql-analysis.yml +68 -68
- data/.github/workflows/jira.yml +28 -28
- data/.github/workflows/release-gem.yml +30 -30
- data/.github/workflows/sast-scan.yml +10 -10
- data/.github/workflows/sca-scan.yml +15 -15
- data/.github/workflows/secrets-scan.yml +10 -10
- data/.gitignore +10 -10
- data/.yardopts +3 -3
- data/CHANGELOG.md +23 -21
- data/CODEOWNERS +1 -1
- data/Gemfile +4 -4
- data/Gemfile.lock +10 -16
- data/LICENSE +20 -20
- data/README.md +96 -96
- data/Rakefile +32 -32
- data/SECURITY.md +27 -27
- data/contentstack_utils.gemspec +31 -31
- data/lib/contentstack_utils/interface/renderable.rb +8 -8
- data/lib/contentstack_utils/model/metadata.rb +68 -68
- data/lib/contentstack_utils/model/options.rb +122 -115
- data/lib/contentstack_utils/support/helper.rb +2 -2
- data/lib/contentstack_utils/utils.rb +171 -163
- data/lib/contentstack_utils/version.rb +2 -2
- data/lib/contentstack_utils.rb +3 -3
- data/spec/lib/model/metadata_spec.rb +94 -94
- data/spec/lib/model/option_spec.rb +318 -316
- data/spec/lib/utils_spec.rb +650 -642
- data/spec/mock/constant_render_options.rb +15 -15
- data/spec/mock/custom_render_option.rb +23 -23
- data/spec/mock/json_to_html_mock.rb +146 -146
- data/spec/spec_helper.rb +9 -9
- data/spec/support/constant.rb +616 -616
- data/spec/support/xml_parse.rb +30 -30
- metadata +4 -3
@@ -1,115 +1,122 @@
|
|
1
|
-
require_relative '../interface/renderable.rb'
|
2
|
-
require_relative './metadata.rb'
|
3
|
-
|
4
|
-
module ContentstackUtils
|
5
|
-
module Model
|
6
|
-
class Options < Interface::Rendarable
|
7
|
-
|
8
|
-
def initialize(entry = nil)
|
9
|
-
@entry = entry
|
10
|
-
end
|
11
|
-
|
12
|
-
def entry
|
13
|
-
@entry
|
14
|
-
end
|
15
|
-
|
16
|
-
def render_option(embeddedObject, metadata)
|
17
|
-
renderString = ''
|
18
|
-
case metadata.style_type
|
19
|
-
when 'block'
|
20
|
-
renderString = "<div><p>#{embeddedObject['title'] || embeddedObject['uid']}</p><p>Content type: <span>#{embeddedObject['_content_type_uid'] || embeddedObject['system']['content_type_uid']}</span></p></div>"
|
21
|
-
when 'inline'
|
22
|
-
renderString = "<span>#{embeddedObject["title"] || embeddedObject["uid"]}</span>";
|
23
|
-
when 'link'
|
24
|
-
metadata.get_attribute_value("href")
|
25
|
-
renderString = "<a href='#{metadata.get_attribute_value("href") || embeddedObject["url"] || embeddedObject["title"] || embeddedObject["uid"]}'>#{(metadata.text && metadata.text != '' ? metadata.text : (embeddedObject["title"] || embeddedObject["uid"]))}</a>";
|
26
|
-
when 'display'
|
27
|
-
renderString = "<img src='#{metadata.get_attribute_value("src")|| embeddedObject["url"]}' alt='#{(metadata.attributes["alt"] ? metadata.attributes["alt"].value : (embeddedObject["title"] || embeddedObject["filename"] || embeddedObject["uid"]))}' />";
|
28
|
-
when 'download'
|
29
|
-
renderString = "<a href='#{metadata.get_attribute_value("href") || embeddedObject["url"]}'>#{(metadata.text && metadata.text != '' ? metadata.text : (embeddedObject["filename"] || embeddedObject["title"] || embeddedObject["uid"]))}</a>";
|
30
|
-
end
|
31
|
-
renderString
|
32
|
-
end
|
33
|
-
|
34
|
-
def render_mark(mark_type, text)
|
35
|
-
renderString = text
|
36
|
-
case mark_type
|
37
|
-
when 'bold'
|
38
|
-
renderString = "<strong>#{text}</strong>"
|
39
|
-
when 'italic'
|
40
|
-
renderString = "<em>#{text}</em>"
|
41
|
-
when 'underline'
|
42
|
-
renderString = "<u>#{text}</u>"
|
43
|
-
when 'strikethrough'
|
44
|
-
renderString = "<strike>#{text}</strike>"
|
45
|
-
when 'inlineCode'
|
46
|
-
renderString = "<span>#{text}</span>"
|
47
|
-
when 'subscript'
|
48
|
-
renderString = "<sub>#{text}</sub>"
|
49
|
-
when 'superscript'
|
50
|
-
renderString = "<sup>#{text}</sup>"
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
when '
|
61
|
-
renderString = "
|
62
|
-
when '
|
63
|
-
renderString = "<
|
64
|
-
when '
|
65
|
-
renderString = "<
|
66
|
-
when '
|
67
|
-
renderString = "<
|
68
|
-
when '
|
69
|
-
renderString = "<
|
70
|
-
when '
|
71
|
-
renderString = "<
|
72
|
-
when '
|
73
|
-
renderString = "<
|
74
|
-
when '
|
75
|
-
renderString = "<
|
76
|
-
when '
|
77
|
-
renderString = "<
|
78
|
-
when '
|
79
|
-
renderString = "<
|
80
|
-
when '
|
81
|
-
renderString = "<
|
82
|
-
when '
|
83
|
-
renderString = "<
|
84
|
-
when '
|
85
|
-
renderString = "<
|
86
|
-
when '
|
87
|
-
renderString = "<
|
88
|
-
when '
|
89
|
-
renderString = "<
|
90
|
-
when '
|
91
|
-
renderString = "<
|
92
|
-
when '
|
93
|
-
renderString = "<
|
94
|
-
when '
|
95
|
-
renderString = "<
|
96
|
-
when '
|
97
|
-
renderString = "<
|
98
|
-
when '
|
99
|
-
renderString = "<
|
100
|
-
when '
|
101
|
-
renderString = "<
|
102
|
-
when '
|
103
|
-
renderString = "<
|
104
|
-
when '
|
105
|
-
renderString = "<
|
106
|
-
when '
|
107
|
-
renderString = ""
|
108
|
-
when '
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
1
|
+
require_relative '../interface/renderable.rb'
|
2
|
+
require_relative './metadata.rb'
|
3
|
+
|
4
|
+
module ContentstackUtils
|
5
|
+
module Model
|
6
|
+
class Options < Interface::Rendarable
|
7
|
+
|
8
|
+
def initialize(entry = nil)
|
9
|
+
@entry = entry
|
10
|
+
end
|
11
|
+
|
12
|
+
def entry
|
13
|
+
@entry
|
14
|
+
end
|
15
|
+
|
16
|
+
def render_option(embeddedObject, metadata)
|
17
|
+
renderString = ''
|
18
|
+
case metadata.style_type
|
19
|
+
when 'block'
|
20
|
+
renderString = "<div><p>#{embeddedObject['title'] || embeddedObject['uid']}</p><p>Content type: <span>#{embeddedObject['_content_type_uid'] || embeddedObject['system']['content_type_uid']}</span></p></div>"
|
21
|
+
when 'inline'
|
22
|
+
renderString = "<span>#{embeddedObject["title"] || embeddedObject["uid"]}</span>";
|
23
|
+
when 'link'
|
24
|
+
metadata.get_attribute_value("href")
|
25
|
+
renderString = "<a href='#{metadata.get_attribute_value("href") || embeddedObject["url"] || embeddedObject["title"] || embeddedObject["uid"]}'>#{(metadata.text && metadata.text != '' ? metadata.text : (embeddedObject["title"] || embeddedObject["uid"]))}</a>";
|
26
|
+
when 'display'
|
27
|
+
renderString = "<img src='#{metadata.get_attribute_value("src")|| embeddedObject["url"]}' alt='#{(metadata.attributes["alt"] ? metadata.attributes["alt"].value : (embeddedObject["title"] || embeddedObject["filename"] || embeddedObject["uid"]))}' />";
|
28
|
+
when 'download'
|
29
|
+
renderString = "<a href='#{metadata.get_attribute_value("href") || embeddedObject["url"]}'>#{(metadata.text && metadata.text != '' ? metadata.text : (embeddedObject["filename"] || embeddedObject["title"] || embeddedObject["uid"]))}</a>";
|
30
|
+
end
|
31
|
+
renderString
|
32
|
+
end
|
33
|
+
|
34
|
+
def render_mark(mark_type, text)
|
35
|
+
renderString = text
|
36
|
+
case mark_type
|
37
|
+
when 'bold'
|
38
|
+
renderString = "<strong>#{text}</strong>"
|
39
|
+
when 'italic'
|
40
|
+
renderString = "<em>#{text}</em>"
|
41
|
+
when 'underline'
|
42
|
+
renderString = "<u>#{text}</u>"
|
43
|
+
when 'strikethrough'
|
44
|
+
renderString = "<strike>#{text}</strike>"
|
45
|
+
when 'inlineCode'
|
46
|
+
renderString = "<span>#{text}</span>"
|
47
|
+
when 'subscript'
|
48
|
+
renderString = "<sub>#{text}</sub>"
|
49
|
+
when 'superscript'
|
50
|
+
renderString = "<sup>#{text}</sup>"
|
51
|
+
when 'break'
|
52
|
+
renderString = "<br />"
|
53
|
+
end
|
54
|
+
renderString
|
55
|
+
end
|
56
|
+
|
57
|
+
def render_node(node_type, node, inner_html)
|
58
|
+
renderString = ""
|
59
|
+
case node_type
|
60
|
+
when 'doc'
|
61
|
+
renderString = ""
|
62
|
+
when 'p'
|
63
|
+
renderString = "<p>#{inner_html}</p>"
|
64
|
+
when 'a'
|
65
|
+
renderString = "<a href='#{node["attrs"]["href"] || node["attrs"]["url"] || ""}'>#{inner_html}</a>"
|
66
|
+
when 'img'
|
67
|
+
renderString = "<img src='#{node["attrs"]["src"] || node["attrs"]["url"] || ""}' />#{inner_html}"
|
68
|
+
when 'embed'
|
69
|
+
renderString = "<iframe src='#{node["attrs"]["src"] || node["attrs"]["url"] || ""}'></iframe>"
|
70
|
+
when 'h1'
|
71
|
+
renderString = "<h1>#{inner_html}</h1>"
|
72
|
+
when 'h2'
|
73
|
+
renderString = "<h2>#{inner_html}</h2>"
|
74
|
+
when 'h3'
|
75
|
+
renderString = "<h3>#{inner_html}</h3>"
|
76
|
+
when 'h4'
|
77
|
+
renderString = "<h4>#{inner_html}</h4>"
|
78
|
+
when 'h5'
|
79
|
+
renderString = "<h5>#{inner_html}</h5>"
|
80
|
+
when 'h6'
|
81
|
+
renderString = "<h6>#{inner_html}</h6>"
|
82
|
+
when 'ol'
|
83
|
+
renderString = "<ol>#{inner_html}</ol>"
|
84
|
+
when 'ul'
|
85
|
+
renderString = "<ul>#{inner_html}</ul>"
|
86
|
+
when 'li'
|
87
|
+
renderString = "<li>#{inner_html}</li>"
|
88
|
+
when 'hr'
|
89
|
+
renderString = "<hr />"
|
90
|
+
when 'table'
|
91
|
+
renderString = "<table>#{inner_html}</table>"
|
92
|
+
when 'thead'
|
93
|
+
renderString = "<thead>#{inner_html}</thead>"
|
94
|
+
when 'tbody'
|
95
|
+
renderString = "<tbody>#{inner_html}</tbody>"
|
96
|
+
when 'tfoot'
|
97
|
+
renderString = "<tfoot>#{inner_html}</tfoot>"
|
98
|
+
when 'tr'
|
99
|
+
renderString = "<tr>#{inner_html}</tr>"
|
100
|
+
when 'th'
|
101
|
+
renderString = "<th>#{inner_html}</th>"
|
102
|
+
when 'td'
|
103
|
+
renderString = "<td>#{inner_html}</td>"
|
104
|
+
when 'blockquote'
|
105
|
+
renderString = "<blockquote>#{inner_html}</blockquote>"
|
106
|
+
when 'code'
|
107
|
+
renderString = "<code>#{inner_html}</code>"
|
108
|
+
when 'reference'
|
109
|
+
if (node["attrs"]['type'] === 'asset')
|
110
|
+
renderString = "<img src=#{node["attrs"]['asset-link']} alt=#{node["attrs"]['asset-name']} />"
|
111
|
+
else
|
112
|
+
renderString = ""
|
113
|
+
end
|
114
|
+
|
115
|
+
when 'span'
|
116
|
+
renderString = "<span>#{inner_html}</span>"
|
117
|
+
end
|
118
|
+
renderString
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
def appendFrame(string)
|
2
|
-
"<documentfragmentcontainer>#{string}</documentfragmentcontainer>"
|
1
|
+
def appendFrame(string)
|
2
|
+
"<documentfragmentcontainer>#{string}</documentfragmentcontainer>"
|
3
3
|
end
|
@@ -1,163 +1,171 @@
|
|
1
|
-
require_relative './model/options.rb'
|
2
|
-
require_relative './model/metadata.rb'
|
3
|
-
require_relative './support/helper.rb'
|
4
|
-
require 'nokogiri'
|
5
|
-
|
6
|
-
module ContentstackUtils
|
7
|
-
def self.render_content(content, options)
|
8
|
-
if (content.instance_of? Array)
|
9
|
-
result = []
|
10
|
-
content.each do |n|
|
11
|
-
result.push(render_string(n, options))
|
12
|
-
end
|
13
|
-
result
|
14
|
-
elsif content.instance_of? String
|
15
|
-
render_string(content, options)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.json_to_html(content, options)
|
20
|
-
reference = -> (metadata){
|
21
|
-
result = ""
|
22
|
-
if options.entry != nil
|
23
|
-
object = findObject(metadata, options.entry)
|
24
|
-
if object!= nil && object.length() > 0
|
25
|
-
result = options.render_option(object[0], metadata)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
private_class_method def self.
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
end
|
1
|
+
require_relative './model/options.rb'
|
2
|
+
require_relative './model/metadata.rb'
|
3
|
+
require_relative './support/helper.rb'
|
4
|
+
require 'nokogiri'
|
5
|
+
|
6
|
+
module ContentstackUtils
|
7
|
+
def self.render_content(content, options)
|
8
|
+
if (content.instance_of? Array)
|
9
|
+
result = []
|
10
|
+
content.each do |n|
|
11
|
+
result.push(render_string(n, options))
|
12
|
+
end
|
13
|
+
result
|
14
|
+
elsif content.instance_of? String
|
15
|
+
render_string(content, options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.json_to_html(content, options)
|
20
|
+
reference = -> (metadata){
|
21
|
+
result = ""
|
22
|
+
if options.entry != nil
|
23
|
+
object = findObject(metadata, options.entry)
|
24
|
+
if object!= nil && object.length() > 0
|
25
|
+
result = options.render_option(object[0], metadata)
|
26
|
+
else
|
27
|
+
content.each do |node|
|
28
|
+
inner_html = json_doc_to_html(node, options, reference)
|
29
|
+
result = options.render_node(node["type"], node, inner_html)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
result
|
34
|
+
}
|
35
|
+
if (content.instance_of? Array)
|
36
|
+
result = []
|
37
|
+
content.each do |n|
|
38
|
+
result.push(json_doc_to_html(n, options, reference) )
|
39
|
+
end
|
40
|
+
result
|
41
|
+
elsif content.instance_of? Hash
|
42
|
+
json_doc_to_html(content, options, reference)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.json_doc_to_html(node, options, callback)
|
47
|
+
result = ""
|
48
|
+
if node["children"] && node["children"].length() > 0
|
49
|
+
result = node_children_to_html(node["children"], options, callback)
|
50
|
+
end
|
51
|
+
result
|
52
|
+
end
|
53
|
+
|
54
|
+
private_class_method def self.node_children_to_html(nodes, options, callback)
|
55
|
+
nodes.map {|node| node_to_html(node, options, callback)}.join("")
|
56
|
+
end
|
57
|
+
|
58
|
+
private_class_method def self.node_to_html(node, options, callback)
|
59
|
+
html_result = ""
|
60
|
+
if node["type"] == nil && node["text"]
|
61
|
+
html_result = text_to_html(node, options)
|
62
|
+
elsif node["type"]
|
63
|
+
if node["type"] == "reference"
|
64
|
+
metadata = Model::Metadata.new(node)
|
65
|
+
html_result = callback.call(metadata)
|
66
|
+
else
|
67
|
+
inner_html = json_doc_to_html(node, options, callback)
|
68
|
+
html_result = options.render_node(node["type"], node, inner_html)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
html_result
|
72
|
+
end
|
73
|
+
|
74
|
+
private_class_method def self.text_to_html(node, options)
|
75
|
+
text = node["text"]
|
76
|
+
if node["superscript"]
|
77
|
+
text = options.render_mark("superscript", text)
|
78
|
+
end
|
79
|
+
if node["subscript"]
|
80
|
+
text = options.render_mark("subscript", text)
|
81
|
+
end
|
82
|
+
if node["inlineCode"]
|
83
|
+
text = options.render_mark("inlineCode", text)
|
84
|
+
end
|
85
|
+
if node["strikethrough"]
|
86
|
+
text = options.render_mark("strikethrough", text)
|
87
|
+
end
|
88
|
+
if node["underline"]
|
89
|
+
text = options.render_mark("underline", text)
|
90
|
+
end
|
91
|
+
if node["italic"]
|
92
|
+
text = options.render_mark("italic", text)
|
93
|
+
end
|
94
|
+
if node["bold"]
|
95
|
+
text = options.render_mark("bold", text)
|
96
|
+
end
|
97
|
+
if node["break"]
|
98
|
+
text = options.render_mark("break", text)
|
99
|
+
end
|
100
|
+
text
|
101
|
+
end
|
102
|
+
|
103
|
+
private_class_method def self.render_string(string, options)
|
104
|
+
xml_doc = Nokogiri::HTML(appendFrame(string))
|
105
|
+
result = xml_doc.xpath('//documentfragmentcontainer').inner_html
|
106
|
+
findEmbeddedObject(xml_doc).each do |metadata|
|
107
|
+
object = findObject(metadata, options.entry)
|
108
|
+
replaceString = ''
|
109
|
+
if object!= nil && object.length() > 0
|
110
|
+
replaceString = options.render_option(object[0], metadata)
|
111
|
+
end
|
112
|
+
result = result.sub(metadata.element.to_html, replaceString)
|
113
|
+
end
|
114
|
+
result
|
115
|
+
end
|
116
|
+
|
117
|
+
private_class_method def self.findEmbeddedObject(doc)
|
118
|
+
metadataArray = []
|
119
|
+
doc.xpath('//*[contains(@class, "embedded-asset") or contains(@class, "embedded-entry")]').each do |n|
|
120
|
+
metadataArray.push(Model::Metadata.new(n))
|
121
|
+
end
|
122
|
+
metadataArray
|
123
|
+
end
|
124
|
+
|
125
|
+
private_class_method def self.findObject(metadata, entry)
|
126
|
+
if entry.has_key? '_embedded_items'
|
127
|
+
embedItems = entry['_embedded_items']
|
128
|
+
keys = embedItems.keys
|
129
|
+
keys.each do |key|
|
130
|
+
object = embedItems[key].select { |embedObject| embedObject['uid'] == metadata.item_uid }
|
131
|
+
if object != nil && object.length() > 0
|
132
|
+
return object
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
return nil
|
137
|
+
end
|
138
|
+
|
139
|
+
module GQL
|
140
|
+
include ContentstackUtils
|
141
|
+
def self.json_to_html(content, options)
|
142
|
+
embeddedItems = []
|
143
|
+
if content.has_key? 'embedded_itemsConnection'
|
144
|
+
embeddedItems = content['embedded_itemsConnection']['edges'] || []
|
145
|
+
end
|
146
|
+
reference = -> (metadata){
|
147
|
+
result = ""
|
148
|
+
if embeddedItems != nil
|
149
|
+
object = embeddedItems.select { |embedObject| embedObject['node']["system"]["uid"] == metadata.item_uid }
|
150
|
+
if object != nil && object.length() > 0
|
151
|
+
result = options.render_option(object[0]["node"], metadata)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
result
|
155
|
+
}
|
156
|
+
|
157
|
+
if content.has_key? 'json'
|
158
|
+
json = content['json']
|
159
|
+
if (json.instance_of? Array)
|
160
|
+
result = []
|
161
|
+
json.each do |n|
|
162
|
+
result.push(ContentstackUtils.json_doc_to_html(n, options, reference))
|
163
|
+
end
|
164
|
+
result
|
165
|
+
elsif json.instance_of? Hash
|
166
|
+
ContentstackUtils.json_doc_to_html(json, options, reference)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module ContentstackUtils
|
2
|
-
VERSION = "1.
|
1
|
+
module ContentstackUtils
|
2
|
+
VERSION = "1.2.0"
|
3
3
|
end
|
data/lib/contentstack_utils.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
-
|
3
|
-
require 'contentstack_utils/version'
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
+
|
3
|
+
require 'contentstack_utils/version'
|
4
4
|
require 'contentstack_utils/utils'
|