rbbt-util 5.19.8 → 5.19.9
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 +4 -4
- data/lib/rbbt/persist/tsv/tokyocabinet.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f225a36ad80052aa37d0afe96a946a12144f38a8
|
|
4
|
+
data.tar.gz: 948a27e4e5063aa205ff63017423494b6d5cec7e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc12ab569e13c6071af67eea02801d6af983739124bb98e8dbddeab605c43d8bea96741b40cb49c5a47504594599de79a67c6834c9b0f14eff5cb71f7e90a80e
|
|
7
|
+
data.tar.gz: 42cacda94789f436a2bd873df1da7f569feb8d7921e05db43207ec0e31322ab2ce0d5fe635dd4481d75d45bb042ee7be1aa7a41d7ee6932f31dd843335668887
|
|
@@ -8,11 +8,22 @@ module Persist
|
|
|
8
8
|
attr_accessor :tokyocabinet_class
|
|
9
9
|
|
|
10
10
|
def self.open(path, write, serializer, tokyocabinet_class = TokyoCabinet::HDB)
|
|
11
|
+
if String === tokyocabinet_class and tokyocabinet_class.include? ":big"
|
|
12
|
+
big = true
|
|
13
|
+
tokyocabinet_class = tokyocabinet_class.split(":").first
|
|
14
|
+
else
|
|
15
|
+
big = false
|
|
16
|
+
end
|
|
17
|
+
|
|
11
18
|
tokyocabinet_class = TokyoCabinet::HDB if tokyocabinet_class == "HDB" or tokyocabinet_class.nil?
|
|
12
19
|
tokyocabinet_class = TokyoCabinet::BDB if tokyocabinet_class == "BDB"
|
|
13
20
|
|
|
14
21
|
database = CONNECTIONS[path] ||= tokyocabinet_class.new
|
|
15
22
|
|
|
23
|
+
if big and not Open.exists? path
|
|
24
|
+
database.tune(nil,nil,nil,tokyocabinet_class::TLARGE | tokyocabinet_class::TDEFLATE)
|
|
25
|
+
end
|
|
26
|
+
|
|
16
27
|
flags = (write ? tokyocabinet_class::OWRITER | tokyocabinet_class::OCREAT : tokyocabinet_class::OREADER)
|
|
17
28
|
database.close
|
|
18
29
|
|
|
@@ -21,6 +32,7 @@ module Persist
|
|
|
21
32
|
raise "Open error: #{database.errmsg(ecode)}. Trying to open file #{path}"
|
|
22
33
|
end
|
|
23
34
|
|
|
35
|
+
|
|
24
36
|
database.extend Persist::TCAdapter unless Persist::TCAdapter === database
|
|
25
37
|
database.persistence_path ||= path
|
|
26
38
|
database.tokyocabinet_class = tokyocabinet_class
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rbbt-util
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.19.
|
|
4
|
+
version: 5.19.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-12-
|
|
11
|
+
date: 2015-12-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|