{"id":15176535,"url":"https://github.com/hashicorp/nomad-ruby","last_synced_at":"2025-10-01T14:32:25.464Z","repository":{"id":56885699,"uuid":"92883531","full_name":"hashicorp/nomad-ruby","owner":"hashicorp","description":"The official Ruby client for Nomad","archived":true,"fork":false,"pushed_at":"2020-04-21T17:24:11.000Z","size":92,"stargazers_count":29,"open_issues_count":11,"forks_count":17,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-09-07T21:37:20.985Z","etag":null,"topics":["gem","nomad","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.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}},"created_at":"2017-05-30T23:03:23.000Z","updated_at":"2023-02-28T07:35:49.000Z","dependencies_parsed_at":"2022-08-20T13:50:52.609Z","dependency_job_id":null,"html_url":"https://github.com/hashicorp/nomad-ruby","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hashicorp/nomad-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fnomad-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fnomad-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fnomad-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fnomad-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/nomad-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fnomad-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277854439,"owners_count":25889076,"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","status":"online","status_checked_at":"2025-10-01T02:00:09.286Z","response_time":88,"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":["gem","nomad","ruby"],"created_at":"2024-09-27T13:21:14.068Z","updated_at":"2025-10-01T14:32:25.149Z","avatar_url":"https://github.com/hashicorp.png","language":"Ruby","readme":"# Nomad Ruby Client\n\nNomad Ruby is the official Ruby client for interacting with [Nomad](https://www.nomadproject.io) by HashiCorp.\n\n**The documentation in this README corresponds to the master branch of the Nomad Ruby client. It may contain unreleased features or different APIs than the most recently released version. Please see the Git tag that corresponds to your version of the Nomad Ruby client for the proper documentation.**\n\n## Quick Start\n\nInstall Ruby 2.4+: [Guide](https://www.ruby-lang.org/en/documentation/installation/).\n\nInstall via Rubygems:\n\n```\n$ gem install nomad\n```\n\nor add it to your Gemfile if you're using Bundler:\n\n```ruby\ngem \"nomad\", \"~\u003e 0.1\"\n```\n\nand then run the `bundle` command to install.\n\nConnect to a Nomad API. For most API calls, it does not matter if you are\nconnecting to a client or server node. In general, try to connect to the node\nwith the lowest latency.\n\nList all jobs in the system\n\n```ruby\nNomad.job.list\n#=\u003e []\n```\n\nJoin the agent being queried to another agent\n\n```ruby\nNomad.agent.join(\"1.2.3.4\")\n#=\u003e #\u003cNomad::AgentJoin:0x007fc40f9f60c0 @error=nil, @num_joined=1\u003e\n```\n\nCreate (run) a job (this must be a JSON job definition, not HCL)\n\n```ruby\nNomad.job.create(File.read(\"my-job.nomad\"))\n#=\u003e #\u003cNomad::JobCreate:0x007fc40f9ac8a8\n @eval_create_index=11,\n @eval_id=\"7bd1a289-06b4-fc4a-5574-940ca4af6a8e\",\n @index=11,\n @job_modify_index=10,\n @known_leader=true,\n @last_contact=0,\n @warnings=nil\u003e\n```\n\nFor more examples, return types, and possible errors, please see the\n[YardDoc][yarddoc].\n\n## Internals \u0026 Normalization\n\nBecause Nomad's API is in active development, there are some inconsistencies in\nAPI responses. This client attempts to normalize those responses as best as\npossible. This includes providing utility classes for sizes, speed, and time\nthat does conversion automatically.\n\n#### `Nomad::Duration`\n\nThe `Nomad::Duration` class provides convenience functions for converting\ntimestamps to different orders of magnitude.\n\n```ruby\nevals = Nomad.evaluation.list\ndur = evals[0].wait\n\ndur\n#=\u003e #\u003cNomad::Duration:0x7fc4109d07e8 @duration=\"12s\"\u003e\n\ndur.seconds #=\u003e 12.0\ndur.milliseconds #=\u003e 12_000.0\ndur.days #=\u003e 0.0001388888888888889\n```\n\nFor more information and examples, see the [YardDoc][yarddoc].\n\n### `Nomad::Size`\n\nThe `Nomad::Size` is used to covert metric sizes based on prefix, such as\nconverting 1GB to MB.\n\n```ruby\njob = Nomad.job.read(\"my-job\")\ndisk = job.groups[0].ephemeral_disk\n\ndisk.size #=\u003e #\u003cNomad::Size:0x7fc41213d340 @size=\"10MB\"\u003e\ndisk.size.gigabytes #=\u003e 0.01\n```\n\nFor more information and examples, see the [YardDoc][yarddoc].\n\n## Development\n\n1. Clone the project on GitHub\n2. Create a feature branch\n3. Submit a Pull Request\n\nImportant Notes:\n\n- **All new features must include test coverage.** At a bare minimum, Unit tests are required. It is preferred if you include acceptance tests as well.\n- **The tests must be be idempotent.** The HTTP calls made during a test should be able to be run over and over.\n- **Tests are order independent.** The default RSpec configuration randomizes the test order, so this should not be a problem.\n- **Integration tests require Nomad**  Nomad must be available in the path for the integration tests to pass.\n\n[yarddoc]: http://www.rubydoc.info/github/hashicorp/nomad-ruby\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fnomad-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fnomad-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fnomad-ruby/lists"}