{"id":16766447,"url":"https://github.com/yugui/ruby-jsonnet","last_synced_at":"2025-03-17T02:31:22.343Z","repository":{"id":22284708,"uuid":"41868005","full_name":"yugui/ruby-jsonnet","owner":"yugui","description":"Jsonnet library for Ruby","archived":false,"fork":false,"pushed_at":"2024-09-07T09:43:10.000Z","size":106,"stargazers_count":40,"open_issues_count":0,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-15T05:43:42.546Z","etag":null,"topics":["jsonnet","ruby"],"latest_commit_sha":null,"homepage":null,"language":"C","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/yugui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-09-03T15:35:12.000Z","updated_at":"2024-11-25T05:36:47.000Z","dependencies_parsed_at":"2024-09-07T10:40:42.308Z","dependency_job_id":"95e1478b-8e0c-4196-b337-a6d09f6f57df","html_url":"https://github.com/yugui/ruby-jsonnet","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yugui%2Fruby-jsonnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yugui%2Fruby-jsonnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yugui%2Fruby-jsonnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yugui%2Fruby-jsonnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yugui","download_url":"https://codeload.github.com/yugui/ruby-jsonnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243837010,"owners_count":20355813,"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":["jsonnet","ruby"],"created_at":"2024-10-13T06:06:32.105Z","updated_at":"2025-03-17T02:31:22.025Z","avatar_url":"https://github.com/yugui.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/yugui/ruby-jsonnet.svg?branch=master)](https://travis-ci.org/yugui/ruby-jsonnet)\n\n# Jsonnet\n\n[Jsonnet][] processor library.  Wraps the official C++ implementation with a Ruby extension library.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'jsonnet'\n```\n\nAnd then execute:\n\n```shell\n$ bundle install\n```\n\nOr install it yourself as:\n\n```shell\n$ gem install jsonnet\n```\n\nBy default this gem will compile and install Jsonnet (v0.18.0) as part of\ninstallation. However you can use the system version of Jsonnet if you prefer.\nThis would be the recommended route if you want to use a different version\nof Jsonnet or are having problems installing this.\n\nTo install libjsonnet:\n\n```shell\n$ git clone https://github.com/google/jsonnet.git\n$ cd jsonnet\n$ make libjsonnet.so\n$ sudo cp libjsonnet.so /usr/local/lib/libjsonnet.so\n$ sudo cp include/libjsonnet.h /usr/local/include/libjsonnet.h\n```\n\nNote: /usr/local/lib and /usr/local/include are used as they are library lookup\nlocations. You may need to adjust these for your system if you have errors\nrunning this gem saying it can't open libjsonnet.so - on Ubuntu for instance\nI found /lib worked when /usr/local/lib did not.\n\nTo install this gem without jsonnet:\n\nUse `JSONNET_USE_SYSTEM_LIBRARIES` ENV var:\n\n```shell\n$ JSONNET_USE_SYSTEM_LIBRARIES=1 bundle install\n```\n\nor, the `--use-system-libraries` option:\n\n\n```shell\ngem install jsonnet -- --use-system-libraries\n```\n\n## Usage\n\nLoad the library with `require \"jsonnet\"`\n\nYou can evaluate a string of Jsonnet using `Jsonnet.evaluate`\n\n```\nirb(main):002:0\u003e Jsonnet.evaluate('{ foo: \"bar\" }')\n=\u003e {\"foo\"=\u003e\"bar\"}\n```\nOr load a file using `Jsonnet.load`\n\n```\nirb(main):002:0\u003e Jsonnet.load('example.jsonnet')\n=\u003e {\"baz\"=\u003e1}\n```\n\nTo get closer to the C++ interface you can create an instance of `Jsonnet::VM`\n\n```\nirb(main):002:0\u003e vm = Jsonnet::VM.new\n=\u003e #\u003cJsonnet::VM:0x007fd29aa1e568\u003e\nirb(main):003:0\u003e vm.evaluate('{ foo: \"bar\" }')\n=\u003e \"{\\n   \\\"foo\\\": \\\"bar\\\"\\n}\\n\"\nirb(main):004:0\u003e vm.evaluate_file('example.jsonnet')\n=\u003e \"{\\n   \\\"baz\\\": 1\\n}\\n\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/yugui/ruby-jsonnet/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n[Jsonnet]: https://github.com/google/jsonnet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyugui%2Fruby-jsonnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyugui%2Fruby-jsonnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyugui%2Fruby-jsonnet/lists"}