{"id":20010434,"url":"https://github.com/magynhard/ruby-game_dig","last_synced_at":"2026-06-11T15:31:05.135Z","repository":{"id":64393786,"uuid":"575533897","full_name":"magynhard/ruby-game_dig","owner":"magynhard","description":"Query game servers from Ruby powered by node-gamedig.","archived":false,"fork":false,"pushed_at":"2025-10-25T15:39:14.000Z","size":1096,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-02T03:27:34.602Z","etag":null,"topics":["gamedig","gamedig-ruby","gameserver","gameserver-tool","gameserverinfo","players","ruby","ruby-gamedig","status","tool"],"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/magynhard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["magynhard"]}},"created_at":"2022-12-07T18:17:03.000Z","updated_at":"2025-10-25T15:37:55.000Z","dependencies_parsed_at":"2024-11-13T07:21:34.919Z","dependency_job_id":"8ed29ffe-5b3d-4a15-8359-ba741605cdcb","html_url":"https://github.com/magynhard/ruby-game_dig","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"6d73d8f6e56b76f5c096eaf115ae2110dc9e9f4f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/magynhard/ruby-game_dig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magynhard%2Fruby-game_dig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magynhard%2Fruby-game_dig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magynhard%2Fruby-game_dig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magynhard%2Fruby-game_dig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magynhard","download_url":"https://codeload.github.com/magynhard/ruby-game_dig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magynhard%2Fruby-game_dig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34206487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["gamedig","gamedig-ruby","gameserver","gameserver-tool","gameserverinfo","players","ruby","ruby-gamedig","status","tool"],"created_at":"2024-11-13T07:19:47.340Z","updated_at":"2026-06-11T15:31:05.118Z","avatar_url":"https://github.com/magynhard.png","language":"Ruby","funding_links":["https://github.com/sponsors/magynhard"],"categories":[],"sub_categories":[],"readme":"# GameDig for Ruby\n[![Gem](https://img.shields.io/gem/v/game_dig?color=default\u0026style=plastic\u0026logo=ruby\u0026logoColor=red)](https://rubygems.org/gems/game_dig)\n![downloads](https://img.shields.io/gem/dt/game_dig?color=blue\u0026style=plastic)\n[![License: MIT](https://img.shields.io/badge/License-MIT-gold.svg?style=plastic\u0026logo=mit)](LICENSE)\n\n\u003e Query game servers from Ruby powered by [node-gamedig](https://github.com/gamedig/node-gamedig). \n\nThis is a Ruby wrapper gem for [node-gamedig](https://github.com/gamedig/node-gamedig), providing support to use the node cli or running a node process with [nodo](https://github.com/mtgrosser/nodo) for faster responses.\n\n\n\n# Contents\n\n* [Installation](#installation)\n* [Usage examples](#usage)\n* [Documentation](#documentation)\n* [Contributing](#contributing)\n\n\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\n### Prerequisites\nFor using the CLI variant, install the gamedig package with your favourite package manager globally, e.g. here with npm or yarn:\n\n#### yarn\n```\n    yarn global add gamedig\n```\n\n#### npm\n```\n    npm install -g gamedig\n```\n\nFor the nodo variant, NodeJS \u003e= 22.x is installed and available via commandline (in PATH).\n\n\n### Gem\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'game_dig'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install game_dig\n    \n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage examples\n\nYou can use the basic cli wrapper or the nodo instance.\n\n### CLI wrapper\n\nThis will just run the gamedig cli and return its result.\n```ruby\n    require 'game_dig'\n    data = GameDig.query(type: 'minecraft', host: 'my-server.example.com')\n    p data\n```\n\n### Nodo wrapper\nThis will start a node process in the background and communicate with it using the nodo gem.\n\nAs this prevents starting a new node process for each query, this is much faster for multiple queries.\n```ruby\n    require 'game_dig/nodo'\n    data = GameDig.query(type: 'minecraft', host: 'my-server.example.com')\n    p data\n```\n\n### Query parameters\nYou can pass all parameters supported by node-gamedig, checkout the [rubydoc for more details](https://www.rubydoc.info/gems/game_dig/GameDig).\n\nHere an example with all parameters, the camelCase parameters are converted to snake_case in ruby:\n```ruby\n    require 'game_dig'\n    data = GameDig.query(\n      # mandatory parameters\n      type: 'minecraft',\n      host: 'my-server.example.com',\n      # optional parameters\n      address: '119.212.123.34', # overrides host and skips DNS lookup\n      port: 25565, # optional, default depends on game type\n      max_retries: 1, # number of retry attempts\n      socket_timeout: 2000, \n      attempt_timeout: 10000,\n      given_port_only: false,\n      ip_family: 0,\n      debug: false,\n      request_rules: false,\n      request_players: true,\n      request_rules_required: false,\n      request_players_required: false,\n      strip_colors: true,\n      port_cache: true,\n      no_breadth_order: false,\n      check_old_ids: false\n    )\n    # =\u003e GameDig::QueryResult\n    \n    # Accessing data\n    puts data.max_players\n    # =\u003e 16\n    \n    # Accessing data as hash\n    puts data.to_h[\"max_players\"]\n    # =\u003e 16\n```\n\n### Query response\nThe default response object is of type `GameDig::QueryResult`.\nIt contains the data returned by gamedig and provides accessors for all common keys.\nBut the method of `queryPort` is in snake_case `query_port` instead of camelCase. And the methods `numplayers` and `maxplayers` are `num_players` and `max_players` respectively.\n\nThe response can be converted to a ruby hash by `#to_h` with the same structure as the original node-gamedig response.\n\nThe objects of `raw` and `bots` are untouched, as they may depend on the game type and are not modified by gamedig itself.\n\nFor example:\n```ruby\ndata.to_h\n# =\u003e\n{\n  \"name\" =\u003e \"My Minecraft Server\",\n  \"map\" =\u003e \"world\",\n  \"password\" =\u003e false,\n  \"num_players\" =\u003e 5,\n  \"max_players\" =\u003e 20,\n  \"players\" =\u003e [\n    { \"name\" =\u003e \"Player1\", \"raw\" =\u003e {} },\n    { \"name\" =\u003e \"Player2\", \"raw\" =\u003e {} },\n  # ...\n  ],\n  \"bots\" =\u003e [\n    { \"name\" =\u003e \"Bot1\", \"raw\" =\u003e {} },\n    { \"name\" =\u003e \"Bot2\", \"raw\" =\u003e {} },\n  # ...\n  ],\n  \"connect\" =\u003e \"my-server.example.com:25565\",\n  \"ping\" =\u003e 45,\n  \"query_port\" =\u003e 25565,\n  \"version\" =\u003e \"1.16.4\",\n  \"raw\" =\u003e {\n    # ...\n  }\n}    \n```\n\n\u003ca name=\"documentation\"\u003e\u003c/a\u003e\n## Documentation\nCheck out the doc at RubyDoc:\u003cbr\u003e\nhttps://www.rubydoc.info/gems/game_dig\n\n\nAs this library is only a wrapper, checkout the original node-gamedig documentation:\u003cbr\u003e\nhttps://github.com/gamedig/node-gamedig\n\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/magynhard/ruby-game_dig. \n\nThis project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagynhard%2Fruby-game_dig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagynhard%2Fruby-game_dig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagynhard%2Fruby-game_dig/lists"}