lib/terraforming/util.rb in terraforming-0.1.3 vs lib/terraforming/util.rb in terraforming-0.1.4
- old
+ new
@@ -15,39 +15,16 @@
def template_path(template_name)
File.join(File.expand_path(File.dirname(__FILE__)), "template", template_name) << ".erb"
end
- def generate_tfstate(resources, tfstate_base = nil)
- tfstate = tfstate_base || tfstate_skeleton
- tfstate["serial"] = tfstate["serial"] + 1
- tfstate["modules"][0]["resources"] = tfstate["modules"][0]["resources"].merge(resources)
- JSON.pretty_generate(tfstate)
- end
-
def prettify_policy(policy_document, breakline = false)
json = JSON.pretty_generate(JSON.parse(CGI.unescape(policy_document)))
if breakline
json[-1] != "\n" ? json << "\n" : json
else
json.strip
end
- end
-
- def tfstate_skeleton
- {
- "version" => 1,
- "serial" => 0,
- "modules" => [
- {
- "path" => [
- "root"
- ],
- "outputs" => {},
- "resources" => {},
- }
- ]
- }
end
end
end