From f2c29486e4ab9e426739e3a38e819637d108571a Mon Sep 17 00:00:00 2001 From: Rob Jones Date: Thu, 26 Sep 2013 09:17:56 -0700 Subject: [PATCH] Update README file to clarify the example code --- README | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README b/README index d98fc03..1023d30 100644 --- a/README +++ b/README @@ -13,10 +13,13 @@ SYNOPSIS require 'rubygems' # on for ruby 1.8 require 'leveldb' - ## make a new database + ## make a new database or open an existing one + ## this creates a directory with the specified path containing multiple files db = LevelDB::DB.new "/tmp/asdf" ## getting and setting + ## leveldb keys and values must be strings + ## arbitrary byte arrays can be stored by first encoding them as strings db.put "it", "works" # => "works" db.get "it" # => "works" @@ -44,10 +47,12 @@ SYNOPSIS map { |k, v| ... } # etc... - ## deleting + ## deleting key/value pairs db.delete "hello" # => "there" db.delete "hello" # => nil + ## to delete the database remove the directory and its contents + LICENSE Leveldb-ruby is available for your use under the terms of