Ruby Parser for the Hashicorp Configuration Language
rexical
library (https://github.com/tenderlove/rexical)racc
library (https://github.com/tenderlove/racc) some_value "other_value" {
key = "value"
}
will create a hash which looks like:
{"some_value" => {"other_value" => {"key" => "value"}}}
require 'hcl'
require 'json'
contents = HCLParser.new.parse(File.read("file_to_parse.hcl"))
puts JSON.dump(contents)
HCL
class as an to load/dump/parse HCL
files