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 +4 -4
- data/README.md +1 -1
- data/example/iterator.rb +24 -0
- data/ext/leveldb-native/extconf.rb +1 -1
- data/lib/leveldb-native/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef4964a2f9b139fffad14a5ac66e608d102987a7
|
4
|
+
data.tar.gz: ef06c2d3dc13d4053aa56e348693e773c201b276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2888ec29fd21d98b9ccce964c63f3e8d76bc489546cbe790a9187b2041ce1d021578159776fb182f69838ed3c15db25917da0385a5561e2158fb12d50ad7da81
|
7
|
+
data.tar.gz: d1dda8e6d7a414d4684e70da5481cfd3beae7fd2a3161f8e35499c78ef16bdd57bf17dc8fa443a8e05b6f012e296ee4b05ab89b575518eced15f1f8be99b36f3
|
data/README.md
CHANGED
data/example/iterator.rb
ADDED
@@ -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
|
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
|
+
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
|
+
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
|