{"id":18513341,"url":"https://github.com/jbox-web/ucl","last_synced_at":"2026-02-12T07:36:03.305Z","repository":{"id":146101488,"uuid":"255524135","full_name":"jbox-web/ucl","owner":"jbox-web","description":"LibUCL FFI bindings for Ruby, easy ;)","archived":false,"fork":false,"pushed_at":"2025-12-29T23:04:30.000Z","size":74,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T06:16:31.895Z","etag":null,"topics":["ffi","jruby","libucl","ruby","ruby-ffi"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbox-web.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-14T06:03:39.000Z","updated_at":"2025-12-29T23:04:34.000Z","dependencies_parsed_at":"2024-11-06T15:45:04.967Z","dependency_job_id":"73a6c92e-f7f2-4864-a73c-ef333c899312","html_url":"https://github.com/jbox-web/ucl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jbox-web/ucl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fucl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fucl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fucl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fucl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbox-web","download_url":"https://codeload.github.com/jbox-web/ucl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbox-web%2Fucl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ffi","jruby","libucl","ruby","ruby-ffi"],"created_at":"2024-11-06T15:37:45.119Z","updated_at":"2026-02-12T07:36:03.297Z","avatar_url":"https://github.com/jbox-web.png","language":"Ruby","readme":"# LibUCL FFI bindings for Ruby\n\n[![GitHub license](https://img.shields.io/github/license/jbox-web/ucl.svg)](https://github.com/jbox-web/ucl/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/jbox-web/ucl.svg)](https://github.com/jbox-web/ucl/releases/latest)\n[![CI](https://github.com/jbox-web/ucl/workflows/CI/badge.svg)](https://github.com/jbox-web/ucl/actions)\n[![Maintainability](https://qlty.sh/gh/jbox-web/projects/ucl/maintainability.svg)](https://qlty.sh/gh/jbox-web/projects/ucl)\n[![Code Coverage](https://qlty.sh/gh/jbox-web/projects/ucl/coverage.svg)](https://qlty.sh/gh/jbox-web/projects/ucl)\n\n[LibUCL](https://github.com/vstakhov/libucl) is a universal configuration language.\n\nThis gem is a Ruby wrapper around LibUCL implemented with [FFI](https://github.com/ffi/ffi).\n\nIt was heavily inspired by [pyucl](https://github.com/jaimeMF/pyucl).\n\n\n## Installation\n\nPut this in your `Gemfile` :\n\n```ruby\ngem 'ucl'\n```\n\nthen run `bundle install`.\n\n[LibUCL](https://github.com/vstakhov/libucl) is vendored with the gem and is automatically compiled when you install the gem.\n\nYou can disable this behavior by setting `USE_GLOBAL_LIBUCL` environment variable to `true` before running `bundle install`.\n\nBy default the gem looks for `libucl.so` in the system path and fallbacks to the bundled version if not found.\n\n\n## Usage\n\n* `UCL.load(string)`\n\n```ruby\nucl_conf =\n  '''\n  string: \"bar\",\n  \"string2\": baz,\n  true = true\n  false = false\n  nil: null\n  integer 1864\n  double 23.42\n  time: 10s\n  array: [\n    \"foo\",\n    true,\n    false,\n    null,\n    1864,\n    23.42,\n    10s,\n  ]\n  hash: {\n    foo  \"bar\"\n    bar = baz\n    baz: \"foo\"\n  }\n  array_of_array: [\n    [\"foo\", \"bar\"]\n    [\"bar\", \"baz\"]\n  ]\n  auto_array = {\n    key: \"foo\"\n    key: \"bar\"\n    key: \"baz\"\n  }\n  section \"foo\" {\n    key = value;\n  }\n  section bar {\n    key = value;\n  }\n  section \"baz\" \"foo\" {\n    key = value;\n  }\n  '''\n\nobject = UCL.load(ucl_conf)\n\nputs object # =\u003e\n{\n  'string'  =\u003e 'bar',\n  'string2' =\u003e 'baz',\n  'true'    =\u003e true,\n  'false'   =\u003e false,\n  'nil'     =\u003e nil,\n  'integer' =\u003e 1864,\n  'double'  =\u003e 23.42,\n  'time'    =\u003e 10.0,\n  'array'   =\u003e [\n    'foo',\n    true,\n    false,\n    nil,\n    1864,\n    23.42,\n    10.0\n  ],\n  'hash' =\u003e {\n    'foo' =\u003e 'bar',\n    'bar' =\u003e 'baz',\n    'baz' =\u003e 'foo'\n  },\n  'array_of_array' =\u003e [\n    [\"foo\", \"bar\"],\n    [\"bar\", \"baz\"]\n  ],\n  'auto_array' =\u003e {\n    'key' =\u003e ['foo', 'bar', 'baz']\n  },\n  'section' =\u003e {\n    'foo' =\u003e {\n      'key' =\u003e 'value'\n    },\n    'bar' =\u003e {\n      'key' =\u003e 'value',\n    },\n    'baz' =\u003e {\n      'foo' =\u003e {\n        'key' =\u003e 'value'\n      }\n    },\n  },\n}\n```\n\n* `UCL.dump(object)`\n\n```ruby\nobject =\n  {\n    'string'  =\u003e 'bar',\n    'true'    =\u003e true,\n    'false'   =\u003e false,\n    'nil'     =\u003e nil,\n    'integer' =\u003e 1864,\n    'double'  =\u003e 23.42,\n    'time'    =\u003e 10.seconds,\n    'array'   =\u003e [\n      'foo',\n      true,\n      false,\n      nil,\n      1864,\n      23.42,\n      10.seconds\n    ],\n    'hash' =\u003e {\n      'foo' =\u003e 'bar',\n      'bar' =\u003e 'baz',\n      'baz' =\u003e 'foo'\n    },\n    'array_of_array' =\u003e [\n      [\"foo\", \"bar\"],\n      [\"bar\", \"baz\"]\n    ],\n    'section' =\u003e {\n      'foo' =\u003e {\n        'key' =\u003e 'value'\n      },\n      'bar' =\u003e {\n        'key' =\u003e 'value',\n      },\n      'baz' =\u003e {\n        'foo' =\u003e {\n          'key' =\u003e 'value'\n        }\n      },\n    },\n  }\n\nucl_conf = UCL.dump(object)\n\nputs ucl_conf # =\u003e\n'''\nstring = \"bar\";\ntrue = true;\nfalse = false;\nnil = null;\ninteger = 1864;\ndouble = 23.420000;\ntime = 10.0;\narray [\n    \"foo\",\n    true,\n    false,\n    null,\n    1864,\n    23.420000,\n    10.0,\n]\nhash {\n    foo = \"bar\";\n    bar = \"baz\";\n    baz = \"foo\";\n}\narray_of_array [\n    [\n        \"foo\",\n        \"bar\",\n    ]\n    [\n        \"bar\",\n        \"baz\",\n    ]\n]\nsection {\n    foo {\n        key = \"value\";\n    }\n    bar {\n        key = \"value\";\n    }\n    baz {\n        foo {\n            key = \"value\";\n        }\n    }\n}\n'''\n```\n\n* `UCL.validate(schema, string)`\n\n```ruby\nschema =\n  '''\n  {\n    \"type\": \"object\",\n    \"properties\": {\n      \"key\": {\n        \"type\": \"string\"\n      }\n    }\n  }\n  '''\n\nucl_conf =\n  '''\n  {\n    \"key\": \"some string\"\n  }\n  '''\n\nputs UCL.validate(schema, string) # =\u003e\ntrue\n```\n\nIt raises an exception (`UCL::Error::SchemaError`) if the schema is not valid.\n\n\n## Development\n\nTo compile LibUCL in dev environment use `bin/rake compile`.\n\nTo run specs use `bin/rspec`.\n\n\n## Other bindings\n\n* [Go](https://github.com/mitchellh/go-libucl)\n* [Rust](https://github.com/draft6/libucl-rs)\n* [Python](https://github.com/vstakhov/libucl/tree/master/python)\n* [Crystal](https://github.com/jbox-web/ucl.cr)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbox-web%2Fucl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbox-web%2Fucl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbox-web%2Fucl/lists"}