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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70a20a4985413f36348028410a914cb78fbf4795
4
- data.tar.gz: 52aef24051104d8a63c3c84839abb479964d1b08
3
+ metadata.gz: f225a36ad80052aa37d0afe96a946a12144f38a8
4
+ data.tar.gz: 948a27e4e5063aa205ff63017423494b6d5cec7e
5
5
  SHA512:
6
- metadata.gz: 7b45d1c76971f7450d105ac1a817f0bcc87d3dbbec0427de52921844b8ea485bda96c2eed28f3bcebb056e57165c3f66cdb6577ec8f9bd4d8e9944d0a6dd9100
7
- data.tar.gz: 60203a5f62caf8993bb33e58e4720efa941307b791d1ca6be05cf67a63913d2f27e27d7ff1a584e2d60b288565151b8c2568325636cef551a289d77501cdb47f
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.8
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-14 00:00:00.000000000 Z
11
+ date: 2015-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake