leveldb-native 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07126608e96b0b1773e42ff4a14a890576d2870c
4
- data.tar.gz: 831edbc4756bcac0dba3aa990f73d11911dcdbe6
3
+ metadata.gz: ef4964a2f9b139fffad14a5ac66e608d102987a7
4
+ data.tar.gz: ef06c2d3dc13d4053aa56e348693e773c201b276
5
5
  SHA512:
6
- metadata.gz: dad3324248d546a781174976a517de07022033d39126a3fbcf665c95a4eb5e8bcde1d901b7fff8f19ad40f6f82c64a6b52f7d03e8a088ad35a1c732735394cb4
7
- data.tar.gz: 88b15b17a4c645ccab734378995ff16004f5255d2ae2966b6565fd500f5c71c51fc8b38555ac7c9e89e62a0c08302bbaf1d04c8f1bbc9517fdefe64706c56d97
6
+ metadata.gz: 2888ec29fd21d98b9ccce964c63f3e8d76bc489546cbe790a9187b2041ce1d021578159776fb182f69838ed3c15db25917da0385a5561e2158fb12d50ad7da81
7
+ data.tar.gz: d1dda8e6d7a414d4684e70da5481cfd3beae7fd2a3161f8e35499c78ef16bdd57bf17dc8fa443a8e05b6f012e296ee4b05ab89b575518eced15f1f8be99b36f3
data/README.md CHANGED
@@ -28,7 +28,7 @@ Synopsis
28
28
  p db["key"] # "new value"
29
29
  p sn["key"] # "value"
30
30
 
31
- See also the [example] (example/snapshot.rb).
31
+ See also the [examples] (example/).
32
32
 
33
33
  Installation
34
34
  ------------
@@ -0,0 +1,24 @@
1
+ require 'leveldb-native'
2
+
3
+ db = LevelDBNative::DB.new '/tmp/leveldb-example-iterator'
4
+
5
+ (1..10).each do |i|
6
+ db[i.to_s] = (i*100).to_s
7
+ end
8
+
9
+ p db.to_a # db is enumerable, so #to_a, #map, etc. work
10
+ # note, not numerical order, but lexicographic order.
11
+
12
+ db.reverse_each :from => "3", :to => "6" do |k,v|
13
+ puts "#{k} : #{v}"
14
+ end
15
+
16
+ iter = db.iterator # same as calling #each without block
17
+
18
+ p iter.peek
19
+ iter.scan
20
+ p iter.peek
21
+
22
+ iter = db.iterator :from => "5"
23
+ iter.scan
24
+ p iter.peek
@@ -2,4 +2,4 @@ require 'mkmf'
2
2
 
3
3
  have_library "leveldb" or abort "Can't find leveldb library."
4
4
 
5
- create_makefile "leveldb_native"
5
+ create_makefile "leveldb-native/leveldb_native"
@@ -1,3 +1,3 @@
1
1
  module LevelDBNative
2
- VERSION = "0.4"
2
+ VERSION = "0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leveldb-native
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel VanderWerf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-11 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby binding to LevelDB.
14
14
  email: vjoel@users.sourceforge.net
@@ -28,6 +28,7 @@ files:
28
28
  - ext/leveldb-native/extconf.rb
29
29
  - ext/leveldb-native/leveldb-native.cc
30
30
  - example/snapshot.rb
31
+ - example/iterator.rb
31
32
  - test/test-db.rb
32
33
  - test/test-db-options.rb
33
34
  - test/test-snapshot.rb