lib/terraforming/util.rb in terraforming-0.1.4 vs lib/terraforming/util.rb in terraforming-0.1.5
- old
+ new
@@ -15,11 +15,11 @@
def template_path(template_name)
File.join(File.expand_path(File.dirname(__FILE__)), "template", template_name) << ".erb"
end
- def prettify_policy(policy_document, breakline = false)
- json = JSON.pretty_generate(JSON.parse(CGI.unescape(policy_document)))
+ def prettify_policy(document, breakline: false, unescape: false)
+ json = JSON.pretty_generate(JSON.parse(unescape ? CGI.unescape(document) : document))
if breakline
json[-1] != "\n" ? json << "\n" : json
else
json.strip