ffi-radix_tree 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +0 -3
- data/lib/ffi/radix_tree.rb +1 -10
- data/lib/ffi/radix_tree/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 273613cad863a6795457a41a30cac700b0f1a1a0be3e53359ab6dff4c405cc00
|
4
|
+
data.tar.gz: 3533ae343c7fbf6d4a5cee15ad33f69bd7c63f0df3a1e239d684a9605215268d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b1cfcf6c1121b84d4b0f51f76dff086e76e854ca2de8eb9d4c3d70446566c4524572194f5490d7c8625e60e61701ce02383d168d47462732f4aee423685789d
|
7
|
+
data.tar.gz: f1c75e06b8af34d66d463c3b2702854ce711a08ae33eb4e6d69d58d72954e01d2e7777b80bcdd1f95d6bdf40fedafb4f11f7fbea1d39df1af0ee25354f7fc2a2
|
data/README.md
CHANGED
@@ -56,9 +56,6 @@ rtree.greedy_match("managerial") # returns ["noun", "plural nou
|
|
56
56
|
|
57
57
|
# Find all values whose keys are included _anywhere_ in the search term
|
58
58
|
rtree.greedy_substring_match("I managed to jump") # returns ["base verb", "past tense"]
|
59
|
-
|
60
|
-
# cleanup
|
61
|
-
rtree.destroy!
|
62
59
|
```
|
63
60
|
|
64
61
|
## Development
|
data/lib/ffi/radix_tree.rb
CHANGED
@@ -88,20 +88,11 @@ module FFI
|
|
88
88
|
attach_function :has_key, [:pointer, :string], :bool
|
89
89
|
|
90
90
|
class Tree
|
91
|
-
def self.destroy!(tree)
|
92
|
-
tree.destroy! unless tree.nil?
|
93
|
-
end
|
94
|
-
|
95
91
|
def initialize
|
96
|
-
@ptr = ::FFI::RadixTree.create
|
92
|
+
@ptr = ::FFI::AutoPointer.new(::FFI::RadixTree.create, ::FFI::RadixTree.method(:destroy))
|
97
93
|
@first_character_present = {}
|
98
94
|
end
|
99
95
|
|
100
|
-
def destroy!
|
101
|
-
::FFI::RadixTree.destroy(@ptr) unless @ptr.nil?
|
102
|
-
@ptr = nil
|
103
|
-
end
|
104
|
-
|
105
96
|
def has_key?(key)
|
106
97
|
::FFI::RadixTree.has_key(@ptr, key)
|
107
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-radix_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -167,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
|
171
|
-
rubygems_version: 2.6.13
|
170
|
+
rubygems_version: 3.0.3
|
172
171
|
signing_key:
|
173
172
|
specification_version: 4
|
174
173
|
summary: radix tree implementation in c++ with FFI bindings
|