File: 0300-disable-kyotocabinet-support.patch

package info (click to toggle)
ruby-moneta 0.7.20-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,768 kB
  • ctags: 1,390
  • sloc: ruby: 7,405; sh: 116; makefile: 5
file content (64 lines) | stat: -rw-r--r-- 2,132 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Description: Disable KyotoCabinet support
Author: HIGUCHI Daisuke (VDR dai) <dai@debian.org>

Index: ruby-moneta/lib/moneta.rb
===================================================================
--- ruby-moneta.orig/lib/moneta.rb
+++ ruby-moneta/lib/moneta.rb
@@ -38,7 +38,6 @@ module Moneta
     autoload :GDBM,            'moneta/adapters/gdbm'
     autoload :HBase,           'moneta/adapters/hbase'
     autoload :LRUHash,         'moneta/adapters/lruhash'
-    autoload :KyotoCabinet,    'moneta/adapters/kyotocabinet'
     autoload :LevelDB,         'moneta/adapters/leveldb'
     autoload :LMDB,            'moneta/adapters/lmdb'
     autoload :LocalMemCache,   'moneta/adapters/localmemcache'
Index: ruby-moneta/lib/moneta/adapters/kyotocabinet.rb
===================================================================
--- ruby-moneta.orig/lib/moneta/adapters/kyotocabinet.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'kyotocabinet'
-
-module Moneta
-  module Adapters
-    # KyotoCabinet backend
-    # @api public
-    class KyotoCabinet < Memory
-      # @param [Hash] options
-      # @option options [String] :file Database file
-      # @option options [::KyotoCabinet::DB] :backend Use existing backend instance
-      def initialize(options = {})
-        if options[:backend]
-          @backend = options[:backend]
-        else
-          raise ArgumentError, 'Option :file is required' unless options[:file]
-          @backend = ::KyotoCabinet::DB.new
-          raise @backend.error.to_s unless @backend.open(options[:file],
-                                                         ::KyotoCabinet::DB::OWRITER | ::KyotoCabinet::DB::OCREATE)
-        end
-      end
-
-      # (see Proxy#key?)
-      def key?(key, options = {})
-        @backend.check(key) >= 0
-      end
-
-      # (see Proxy#delete)
-      def delete(key, options = {})
-        @backend.seize(key)
-      end
-
-      # (see Proxy#create)
-      def create(key, value, options = {})
-        @backend.add(key, value)
-      end
-
-      # (see Proxy#close)
-      def close
-        @backend.close
-        nil
-      end
-    end
-  end
-end