{"id":20657736,"url":"https://github.com/boltops-tools/hcl_parser","last_synced_at":"2025-04-19T13:17:14.882Z","repository":{"id":45914806,"uuid":"267069975","full_name":"boltops-tools/hcl_parser","owner":"boltops-tools","description":"HCL Parser","archived":false,"fork":false,"pushed_at":"2022-08-26T16:53:30.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-31T12:56:28.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boltops-tools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-26T14:44:47.000Z","updated_at":"2024-10-01T20:05:28.000Z","dependencies_parsed_at":"2022-08-30T04:01:32.023Z","dependency_job_id":null,"html_url":"https://github.com/boltops-tools/hcl_parser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fhcl_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fhcl_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fhcl_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fhcl_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boltops-tools","download_url":"https://codeload.github.com/boltops-tools/hcl_parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224954281,"owners_count":17397841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T18:22:42.097Z","updated_at":"2024-11-16T18:22:42.791Z","avatar_url":"https://github.com/boltops-tools.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HclParser\n\nParse HCL files. The scope of this library is to only handle `variables.tf` and `backend.tf` files, as that's what's needed for Terraspace currently.\n\n## Usage\n\n```ruby\nrequire \"hcl_parser\"\ncode =\u003c\u003cEOL\nvariable \"project\" {\n  description = \"The name of the GCP Project\"\n  default     = \"test\"\n  type        = \"string\"\n}\nvariable \"name_prefix\" {\n  type        = \"string\"\n}\nEOL\n\nparser = HclParser::Loader.new(code)\nparser.load\n# Returns =\u003e\n#\n# {\"variable\"=\u003e\n#   {\"project\"=\u003e\n#     {\"description\"=\u003e\"The name of project\",\n#      \"default\"=\u003e\"test\",\n#      \"type\"=\u003e\"string\"},\n#    \"name_prefix\"=\u003e{\"type\"=\u003e\"string\"}}}\n```\n\n## Installation\n\n```ruby\ngem 'hcl_parser'\n```\n\n## Notes\n\n* Tried a few different Ruby HCL parsers: [hcl-checker](https://github.com/mfcastellani/hcl-checker), [hcl-rb](https://github.com/Ruin0x11/hcl-rb), [rhcl](https://github.com/winebarrel/rhcl), [ruby-hcl](https://github.com/sikula/ruby-hcl). They all seem to have one issue or another.\n* This library preprocesses the text fed to the parser to workaround the parser issues. It's a workaround.\n* Able to handle simple variable types and most complex types.\n* Not able to handle multi-line complex variable types. There's a spec to document this.\n* Will have to fix one of these parsers or write a new one.\n* Open to PRs to help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltops-tools%2Fhcl_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboltops-tools%2Fhcl_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltops-tools%2Fhcl_parser/lists"}