Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magynhard/ruby-game_dig
Ruby wrapper gem for node-gamedig
https://github.com/magynhard/ruby-game_dig
gamedig gamedig-ruby ruby ruby-gamedig
Last synced: 3 days ago
JSON representation
Ruby wrapper gem for node-gamedig
- Host: GitHub
- URL: https://github.com/magynhard/ruby-game_dig
- Owner: magynhard
- License: mit
- Created: 2022-12-07T18:17:03.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T18:53:36.000Z (over 1 year ago)
- Last Synced: 2024-04-21T02:19:29.837Z (7 months ago)
- Topics: gamedig, gamedig-ruby, ruby, ruby-gamedig
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# GameDig for Ruby
[![Gem](https://img.shields.io/gem/v/game_dig?color=default&style=plastic&logo=ruby&logoColor=red)](https://rubygems.org/gems/game_dig)
![downloads](https://img.shields.io/gem/dt/game_dig?color=blue&style=plastic)
[![License: MIT](https://img.shields.io/badge/License-MIT-gold.svg?style=plastic&logo=mit)](LICENSE)> Ruby wrapper gem for [node-gamedig](https://github.com/gamedig/node-gamedig).
Providing support to use the node cli or running a tiny webservice for faster responses.
# Contents
* [Installation](#installation)
* [Usage examples](#usage)
* [Documentation](#documentation)
* [Contributing](#contributing)
## Installation
### Prerequisites
NodeJS or a compatible alternative is installed.Then install the gamedig package with your favourite package manager globally, e.g. here with npm or yarn:
#### yarn
```
yarn global add gamedig
```#### npm
```
npm install -g gamedig
```### Gem
Add this line to your application's Gemfile:
```ruby
gem 'game_dig'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install game_dig
You can use the basic cli wrapper or the tiny webservice instance.
### CLI wrapper
This will just run the gamedig cli and return its result.
```ruby
require 'game_dig'
data = GameDig.query(type: 'minecraft', host: 'my-server.example.com')
p data
```### Service wrapper (experimental, only did some testing on linux)
Only the following parameters are implemented for the service wrapper: `type, host, protocol` (version 0.1.0)
Behaves the same to the user, but runs a tiny node webservice in the background to avoid startup times when called more than one time.
```
your-ruby-app
--------> ruby-game_dig
--------> tiny node instance in a separate thread using gamedig node module
<----------------
```It needs only about half of the query time, but might be not as stable as it involves much more complexity. (about 10ms vs 20ms)
```ruby
require 'game_dig/service'
data = GameDig.query(type: 'minecraft', host: 'my-server.example.com')
p data
```
## Documentation
Check out the doc at RubyDoc:
https://www.rubydoc.info/gems/game_digAs this library is only a wrapper, checkout the original node-gamedig documentation:
https://github.com/gamedig/node-gamedigBug reports and pull requests are welcome on GitHub at https://github.com/magynhard/ruby-game_dig.
This 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.
## SEO keywords
ruby gamedig game-dig game_dig