Skip to content

sikula/ruby-hcl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby-hcl

Ruby Parser for the Hashicorp Configuration Language

Lexer

Parser


Hashicorp Configuration Language

Examples

  some_value "other_value" {
    key = "value"
  }

will create a hash which looks like:

{"some_value" => {"other_value" => {"key" => "value"}}}

Ruby-HCL Usage

require 'hcl'
require 'json'

contents = HCLParser.new.parse(File.read("file_to_parse.hcl"))
puts JSON.dump(contents)

TODO

  • Properly handle nested multi-line comments
  • Properly handle floating point values
  • Create a HCL class as an to load/dump/parse HCL files
  • Write tests for the lexer
  • Write tests for the parser

About

Ruby Parser for the Hashicorp Configuration Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published