Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby client for FleetDB

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 fleet.gemspec
README.md

fleet-rb

A Ruby client for FleetDB.

Setup

Download and start FleetDB as described in the FleetDB getting started guide, then install this client library with:

$ sudo gem install fleet

Usage

require "rubygems"
require "fleet"

client = Fleet.new

client.query(["ping"])
#=> "pong"

client.query(["select", "accounts", {"where" => ["=", "id", 2]}])
#=> [{"id" => 2, "owner" => "Alice", "credits" => 150}]

The client will raise an exception in the case of an error:

client.query(["bogus"])
RuntimeError: Malformed query: unrecognized query type '"bogus"'

You can optionally specify a host and port other than the default "127.0.0.1" and 3400:

client = Fleet.new(:host => "68.127.150.103", :port => 3401)

See the FleetDB getting started guide and the FleetDB query reference for documentation on the queries available to clients.

Something went wrong with that request. Please try again.