lmdb 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bead2398fe212913ca5c86034ebaf619212b20f0
4
- data.tar.gz: 46b8093e97073e46aa7e57054ee66e0138f48383
3
+ metadata.gz: 00ac2d717d44921d8a11dabbe516ba59203b37e2
4
+ data.tar.gz: 4cc13fff824970690d1f2e81c14d3be5c91e1df8
5
5
  SHA512:
6
- metadata.gz: 9a8bc109d1b095471a9711d85fe377e7cf981dc371b2090e40a48701c6eb457541ca1a494a240ba6d4178043ee547d302c34124a96d3d1a15a7b41a0bb410174
7
- data.tar.gz: 2a6afea7ab6d1a6811aed004026b7f3b0e6fb95634ff84125e8420cf369eba12a3339aaca8acc2704f054cad90cd8fea5642e3237a27df3ea92c7e796860ca60
6
+ metadata.gz: c96d8fad469d56c9f9b010952ce2b1e4b94eb0bb247a6abbdd25c9d10b6b016a74a9abaa30763784e5669666e71626c318a1b011fea3ebcca4f75b0100aa5ffd
7
+ data.tar.gz: eda8808e0a2844b8d80b9c27203108017e92bfe3dfe75872a336882cf8a7a6a3866b21c2e0ba330375b80d9a31928abf840abffa20a4229ac49fc6cd85c5815b
data/README.md CHANGED
@@ -45,7 +45,7 @@ env.close
45
45
 
46
46
  If you want to have a simpler interface to LMDB databases please consider using [Moneta](https://github.com/minad/moneta). The Moneta gem provides an LMDB adapter which uses this gem.
47
47
 
48
- ## Licence (MIT)
48
+ ## License (MIT)
49
49
 
50
50
  ```
51
51
  Copyright (c) 2013 Daniel Mendler
@@ -927,7 +927,7 @@ static VALUE database_delete(int argc, VALUE *argv, VALUE self) {
927
927
  if (NIL_P(vval)) {
928
928
  check(mdb_del(need_txn(database->env), database->dbi, &key, 0));
929
929
  } else {
930
- VALUE vval = StringValue(vval);
930
+ vval = StringValue(vval);
931
931
  MDB_val value;
932
932
  value.mv_size = RSTRING_LEN(vval);
933
933
  value.mv_data = RSTRING_PTR(vval);
@@ -1,3 +1,3 @@
1
1
  module LMDB
2
- VERSION = '0.4.7'
2
+ VERSION = '0.4.8'
3
3
  end
@@ -100,7 +100,7 @@ describe LMDB do
100
100
  end
101
101
 
102
102
  describe LMDB::Transaction do
103
- subject { env}
103
+ subject { env }
104
104
 
105
105
  it 'should create transactions' do
106
106
  subject.active_txn.should == nil
@@ -170,7 +170,7 @@ describe LMDB do
170
170
  subject.active_txn.should == nil
171
171
  end
172
172
 
173
- it 'should access from transaction to environment' do
173
+ it 'should get environment' do
174
174
  env2 = nil
175
175
  env.transaction do |txn|
176
176
  env2 = txn.env
@@ -203,6 +203,19 @@ describe LMDB do
203
203
  subject.get('cat').should == 'garfield'
204
204
  end
205
205
 
206
+ it 'should delete by key' do
207
+ proc { subject.delete('cat') }.should raise_error(LMDB::Error::NOTFOUND)
208
+ proc { subject.delete('cat', 'garfield') }.should raise_error(LMDB::Error::NOTFOUND)
209
+
210
+ subject.put('cat', 'garfield')
211
+ subject.delete('cat').should be_nil
212
+ proc { subject.delete('cat') }.should raise_error(LMDB::Error::NOTFOUND)
213
+
214
+ subject.put('cat', 'garfield')
215
+ subject.delete('cat', 'garfield').should be_nil
216
+ proc { subject.delete('cat', 'garfield') }.should raise_error(LMDB::Error::NOTFOUND)
217
+ end
218
+
206
219
  it 'stores key/values in same transaction' do
207
220
  db.put('key', 'value').should be_nil
208
221
  db.get('key').should == 'value'
@@ -258,7 +271,7 @@ describe LMDB do
258
271
  db['key'].should == bin2
259
272
  end
260
273
 
261
- it 'should access environment' do
274
+ it 'should get environment' do
262
275
  main = env.database
263
276
  db1 = env.database('db1', :create => true)
264
277
  main.env.should == env
@@ -328,7 +341,7 @@ describe LMDB do
328
341
  proc { c.next }.should raise_error(LMDB::Error)
329
342
  end
330
343
 
331
- it 'should access database' do
344
+ it 'should get database' do
332
345
  db2 = nil
333
346
  env.transaction { c = db.cursor; db2 = c.database }
334
347
  db2.should == db
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lmdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mendler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-28 00:00:00.000000000 Z
11
+ date: 2014-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.4.1
114
+ rubygems_version: 2.4.2
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Ruby bindings to Lightning MDB