Project

hirlite

0.01
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for hirlite
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.5.1
= 10.0
~> 3.2.0
 Project Readme

rlite-rb

Build Status

Ruby bindings for rlite. For more information about rlite, go to rlite repository

Installation

$ gem install hirlite

In Ubuntu, you will need to have installed ruby-dev

Usage

Using redis-rb

require('redis')
require('hirlite/connection')
redis = Redis.new(:host => ":memory:", :driver => Rlite::Connection::Hirlite)
redis.set 'key', 'value'
p redis.get 'key' # value

Without redis-rb

require('hirlite')
r = Hirlite::Rlite.new()
r.connect(':memory:', 0)
r.write(['set', 'key', 'value'])
p r.read  # OK
r.write(['get', 'key'])
p r.read  # value

Persistence

1.9.3-p551 :001 > require('hirlite')
=> true
1.9.3-p551 :002 > r = Hirlite::Rlite.new()
=> #<Hirlite::Rlite:0x007f92508c4d50>
1.9.3-p551 :003 > r.connect('mydb.rld', 0)
=> nil
1.9.3-p551 :004 > r.write(['set', 'key', 'value'])
=> nil
1.9.3-p551 :005 > r.connect('mydb.rld', 0)
=> nil
1.9.3-p551 :006 > r.write(['get', 'key'])
=> nil
1.9.3-p551 :007 > r.read
=> "value"