kvj 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kvj.rb +9 -0
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1538b407a7ed4da590eba89c2da2a4260f820e2
4
- data.tar.gz: 48fb6f5171b37cce09831bc895cd2a8034c75725
3
+ metadata.gz: db683924cd739a41874d4a32113455412d463c18
4
+ data.tar.gz: ed0981e3425f16b407be7a168641919e91f5860e
5
5
  SHA512:
6
- metadata.gz: b2c35b6d234fd0e230f0c8c61cf7593fd472b717a8a54359d7526056f92574bd5ac316d9ab316dcd7f57fd1fd8375659c0b8c3de9ab38c8b9f1252d710ea267a
7
- data.tar.gz: 7daf213a82b0437b8ac45eb0168e6cc10f8c7f3c1f89452b8a948be026648f06945b436eaaa8b3e2232fe325b8cfc0a304c7aae31c30983c35a176f4d2641b71
6
+ metadata.gz: 131abac341b8dd544c57a55b1ae15941e60ab034395a1246e2f9927cf9cb93f29554e97c820120e9b13d08d05854defbce6adda786538441eefda458ee8e7b72
7
+ data.tar.gz: 62d59ad5a545224eabf3db3e6ac48ed1e3fe91da175d44850897f6d498c54ef756f3145152ad61ba8d3128365c4f91b7379dafdc16e7dbed178868a5479a799d
data/lib/kvj.rb CHANGED
@@ -36,6 +36,15 @@ class KVJ
36
36
  @file_connector.release_lock
37
37
  end
38
38
 
39
+ def delete(key)
40
+ @file_connector.grab_ex_lock
41
+ hash = @file_connector.read
42
+ hash.delete(key)
43
+ @file_connector.write(hash)
44
+ ensure
45
+ @file_connector.release_lock
46
+ end
47
+
39
48
  class << self
40
49
  alias connect new
41
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kvj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - RundongGao
@@ -24,8 +24,8 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: a supper light key value storage database in json file provides ACID
28
- transcation on disk for multiple programs.
27
+ description: A supper light connectionless key-value storage database provides ACID
28
+ transcations for multiple programs.
29
29
  email: asphinx423@gmail.com
30
30
  executables: []
31
31
  extensions: []
@@ -35,7 +35,7 @@ files:
35
35
  - lib/file_connector.rb
36
36
  - lib/kvj.rb
37
37
  - lib/lock_manager.rb
38
- homepage: http://rubygems.org/gems/hola
38
+ homepage: https://github.com/RundongGao/kvj
39
39
  licenses:
40
40
  - MIT
41
41
  metadata: {}
@@ -58,5 +58,5 @@ rubyforge_project:
58
58
  rubygems_version: 2.4.6
59
59
  signing_key:
60
60
  specification_version: 4
61
- summary: A supper light weight value data database.
61
+ summary: A supper light connectionless key-value storage database.
62
62
  test_files: []