rambling-trie 2.2.1 → 2.3.0
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/Gemfile +1 -1
- data/README.md +12 -10
- data/lib/rambling/trie/configuration/provider_collection.rb +2 -2
- data/lib/rambling/trie/container.rb +1 -1
- data/lib/rambling/trie/enumerable.rb +1 -1
- data/lib/rambling/trie/nodes/node.rb +4 -4
- data/lib/rambling/trie/serializers/marshal.rb +3 -3
- data/lib/rambling/trie/serializers/yaml.rb +4 -5
- data/lib/rambling/trie/version.rb +1 -1
- data/lib/rambling/trie.rb +1 -1
- data/rambling-trie.gemspec +3 -3
- data/spec/spec_helper.rb +1 -3
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7acf86172aa12a848c9590aa0ec0aee132b70f30bf15b720d95e7bc675a8d13
|
4
|
+
data.tar.gz: 8c08f7abfee53e44d9599160397a21b3e8a9e597125ce52feedbc98f4ad65e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c697d039484c41aa733eae791f16b4f82e3b7c6048b006ba64281794834ec54cf5b00f555b3bac196df5589d8dbf779f06fa887a659bb9ee61f822bee7fbdee5
|
7
|
+
data.tar.gz: fcd664c6802aaf8565820a43f52db146b97e010be2c3a2c64c477a4f6643da02fdbe8238678780d9630f9e6877a8772200af7e4c6e0fb0f16bb9028b382d6099
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ The Rambling Trie is a Ruby implementation of the [trie data structure][trie_wik
|
|
10
10
|
|
11
11
|
You will need:
|
12
12
|
|
13
|
-
* Ruby 2.
|
13
|
+
* Ruby 2.7.0 or up
|
14
14
|
* RubyGems
|
15
15
|
|
16
16
|
See [RVM][rvm], [rbenv][rbenv] or [chruby][chruby] for more information on how to manage Ruby versions.
|
@@ -242,20 +242,22 @@ You can find further API documentation on the autogenerated [rambling-trie gem R
|
|
242
242
|
|
243
243
|
The Rambling Trie has been tested with the following Ruby versions:
|
244
244
|
|
245
|
+
* 3.2.x
|
246
|
+
* 3.1.x
|
245
247
|
* 3.0.x
|
246
248
|
* 2.7.x
|
247
|
-
* 2.6.x
|
248
|
-
* 2.5.x
|
249
249
|
|
250
250
|
**No longer supported**:
|
251
251
|
|
252
|
+
* 2.6.x (EOL'ed)
|
253
|
+
* 2.5.x (EOL'ed)
|
252
254
|
* 2.4.x (EOL'ed)
|
253
255
|
* 2.3.x (EOL'ed)
|
254
|
-
* 2.2.x
|
255
|
-
* 2.1.x
|
256
|
-
* 2.0.x
|
257
|
-
* 1.9.x
|
258
|
-
* 1.8.x
|
256
|
+
* 2.2.x (EOL'ed)
|
257
|
+
* 2.1.x (EOL'ed)
|
258
|
+
* 2.0.x (EOL'ed)
|
259
|
+
* 1.9.x (EOL'ed)
|
260
|
+
* 1.8.x (EOL'ed)
|
259
261
|
|
260
262
|
## Contributing to Rambling Trie
|
261
263
|
|
@@ -287,7 +289,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
287
289
|
[inch_ci_link]: https://inch-ci.org/github/gonzedge/rambling-trie
|
288
290
|
[license_badge]: https://badges.frapsoft.com/os/mit/mit.svg?v=103
|
289
291
|
[license_link]: https://opensource.org/licenses/mit-license.php
|
290
|
-
[marshal]: https://ruby-doc.org/core-2.
|
292
|
+
[marshal]: https://ruby-doc.org/core-2.7.0/Marshal.html
|
291
293
|
[rambling_trie_configuration]: https://github.com/gonzedge/rambling-trie#configuration
|
292
294
|
[rambling_trie_contributing_guide]: https://github.com/gonzedge/rambling-trie/blob/master/CONTRIBUTING.md
|
293
295
|
[rambling_trie_plain_text_reader]: https://github.com/gonzedge/rambling-trie/blob/master/lib/rambling/trie/readers/plain_text.rb
|
@@ -299,4 +301,4 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
299
301
|
[travis_ci_badge]: https://travis-ci.com/gonzedge/rambling-trie.svg?branch=master
|
300
302
|
[travis_ci_link]: https://travis-ci.com/github/gonzedge/rambling-trie
|
301
303
|
[trie_wiki]: https://en.wikipedia.org/wiki/Trie
|
302
|
-
[yaml]: https://ruby-doc.org/stdlib-2.
|
304
|
+
[yaml]: https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html
|
@@ -77,7 +77,7 @@ module Rambling
|
|
77
77
|
|
78
78
|
# Get provider corresponding to a given format.
|
79
79
|
# @return [Array<Symbol>] the provider corresponding to that format.
|
80
|
-
# @see https://ruby-doc.org/core-2.
|
80
|
+
# @see https://ruby-doc.org/core-2.7.0/Hash.html#method-i-5B-5D
|
81
81
|
# Hash#keys
|
82
82
|
def formats
|
83
83
|
providers.keys
|
@@ -86,7 +86,7 @@ module Rambling
|
|
86
86
|
# Get provider corresponding to a given format.
|
87
87
|
# @param [Symbol] format the format to search for in the collection.
|
88
88
|
# @return [Object] the provider corresponding to that format.
|
89
|
-
# @see https://ruby-doc.org/core-2.
|
89
|
+
# @see https://ruby-doc.org/core-2.7.0/Hash.html#method-i-5B-5D
|
90
90
|
# Hash#[]
|
91
91
|
def [] format
|
92
92
|
providers[format]
|
@@ -168,7 +168,7 @@ module Rambling
|
|
168
168
|
|
169
169
|
# Array of words contained in the root {Nodes::Node Node}.
|
170
170
|
# @return [Array<String>] all words contained in this trie.
|
171
|
-
# @see https://ruby-doc.org/core-2.
|
171
|
+
# @see https://ruby-doc.org/core-2.7.0/Enumerable.html#method-i-to_a
|
172
172
|
# Enumerable#to_a
|
173
173
|
def to_a
|
174
174
|
root.to_a
|
@@ -7,7 +7,7 @@ module Rambling
|
|
7
7
|
include ::Enumerable
|
8
8
|
|
9
9
|
# Returns number of words contained in the trie
|
10
|
-
# @see https://ruby-doc.org/core-2.
|
10
|
+
# @see https://ruby-doc.org/core-2.7.0/Enumerable.html#method-i-count
|
11
11
|
# Enumerable#count
|
12
12
|
alias_method :size, :count
|
13
13
|
|
@@ -128,7 +128,7 @@ module Rambling
|
|
128
128
|
# Get {Node Node} corresponding to a given letter.
|
129
129
|
# @param [Symbol] letter the letter to search for in the node.
|
130
130
|
# @return [Node] the node corresponding to that letter.
|
131
|
-
# @see https://ruby-doc.org/core-2.
|
131
|
+
# @see https://ruby-doc.org/core-2.7.0/Hash.html#method-i-5B-5D
|
132
132
|
# Hash#[]
|
133
133
|
def [] letter
|
134
134
|
children_tree[letter]
|
@@ -139,7 +139,7 @@ module Rambling
|
|
139
139
|
# @param [Node] node the {Node Node} to assign to that letter.
|
140
140
|
# @return [Node] the node corresponding to the inserted or
|
141
141
|
# updated letter.
|
142
|
-
# @see https://ruby-doc.org/core-2.
|
142
|
+
# @see https://ruby-doc.org/core-2.7.0/Hash.html#method-i-5B-5D
|
143
143
|
# Hash#[]
|
144
144
|
def []= letter, node
|
145
145
|
children_tree[letter] = node
|
@@ -149,7 +149,7 @@ module Rambling
|
|
149
149
|
# letter.
|
150
150
|
# @param [Symbol] letter the letter to search for in the node.
|
151
151
|
# @return [Boolean] `true` if the letter is present, `false` otherwise
|
152
|
-
# @see https://ruby-doc.org/core-2.
|
152
|
+
# @see https://ruby-doc.org/core-2.7.0/Hash.html#method-i-has_key-3F
|
153
153
|
# Hash#key?
|
154
154
|
def key? letter
|
155
155
|
children_tree.key? letter
|
@@ -160,7 +160,7 @@ module Rambling
|
|
160
160
|
# @param [Symbol] letter the letter to delete from the node's children
|
161
161
|
# tree.
|
162
162
|
# @return [Node] the node corresponding to the deleted letter.
|
163
|
-
# @see https://ruby-doc.org/core-2.
|
163
|
+
# @see https://ruby-doc.org/core-2.7.0/Hash.html#method-i-delete
|
164
164
|
# Hash#delete
|
165
165
|
def delete letter
|
166
166
|
children_tree.delete letter
|
@@ -17,10 +17,10 @@ module Rambling
|
|
17
17
|
# @param [String] filepath the full path of the file to load the
|
18
18
|
# marshaled object from.
|
19
19
|
# @return [Nodes::Node] The deserialized {Nodes::Node Node}.
|
20
|
-
# @see https://ruby-doc.org/core-2.
|
20
|
+
# @see https://ruby-doc.org/core-2.7.0/Marshal.html#method-c-load
|
21
21
|
# Marshal.load
|
22
22
|
# @note Use of
|
23
|
-
# {https://ruby-doc.org/core-2.
|
23
|
+
# {https://ruby-doc.org/core-2.7.0/Marshal.html#method-c-load
|
24
24
|
# Marshal.load} is generally discouraged. Only use this with trusted
|
25
25
|
# input.
|
26
26
|
def load filepath
|
@@ -33,7 +33,7 @@ module Rambling
|
|
33
33
|
# @param [String] filepath the full path of the file to dump the
|
34
34
|
# marshaled object into.
|
35
35
|
# @return [Numeric] number of bytes written to disk.
|
36
|
-
# @see https://ruby-doc.org/core-2.
|
36
|
+
# @see https://ruby-doc.org/core-2.7.0/Marshal.html#method-c-dump
|
37
37
|
# Marshal.dump
|
38
38
|
def dump node, filepath
|
39
39
|
serializer.dump ::Marshal.dump(node), filepath
|
@@ -17,19 +17,18 @@ module Rambling
|
|
17
17
|
# @param [String] filepath the full path of the file to load the
|
18
18
|
# serialized YAML object from.
|
19
19
|
# @return [Nodes::Node] The deserialized {Nodes::Node Node}.
|
20
|
-
# @see https://ruby-doc.org/stdlib-2.
|
20
|
+
# @see https://ruby-doc.org/stdlib-2.7.0/libdoc/psych/rdoc/Psych.html#method-c-safe_load
|
21
21
|
# Psych.safe_load
|
22
22
|
def load filepath
|
23
23
|
require 'yaml'
|
24
24
|
::YAML.safe_load(
|
25
25
|
serializer.load(filepath),
|
26
|
-
[
|
26
|
+
permitted_classes: [
|
27
27
|
Symbol,
|
28
28
|
Rambling::Trie::Nodes::Raw,
|
29
29
|
Rambling::Trie::Nodes::Compressed,
|
30
30
|
],
|
31
|
-
|
32
|
-
true,
|
31
|
+
aliases: true,
|
33
32
|
)
|
34
33
|
end
|
35
34
|
|
@@ -39,7 +38,7 @@ module Rambling
|
|
39
38
|
# @param [String] filepath the full path of the file to dump the YAML
|
40
39
|
# object into.
|
41
40
|
# @return [Numeric] number of bytes written to disk.
|
42
|
-
# @see https://ruby-doc.org/stdlib-2.
|
41
|
+
# @see https://ruby-doc.org/stdlib-2.7.0/libdoc/psych/rdoc/Psych.html#method-c-dump
|
43
42
|
# Psych.dump
|
44
43
|
def dump node, filepath
|
45
44
|
require 'yaml'
|
data/lib/rambling/trie.rb
CHANGED
@@ -45,7 +45,7 @@ module Rambling
|
|
45
45
|
# @yield [Container] the trie just loaded.
|
46
46
|
# @see Rambling::Trie::Serializers Serializers.
|
47
47
|
# @note Use of
|
48
|
-
# {https://ruby-doc.org/core-2.
|
48
|
+
# {https://ruby-doc.org/core-2.7.0/Marshal.html#method-c-load
|
49
49
|
# Marshal.load} is generally discouraged. Only use the `.marshal`
|
50
50
|
# format with trusted input.
|
51
51
|
def load filepath, serializer = nil
|
data/rambling-trie.gemspec
CHANGED
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.license = 'MIT'
|
30
30
|
gem.version = Rambling::Trie::VERSION
|
31
31
|
gem.platform = Gem::Platform::RUBY
|
32
|
-
gem.required_ruby_version = '>= 2.
|
32
|
+
gem.required_ruby_version = '>= 2.7', '< 4'
|
33
33
|
|
34
34
|
gem.add_development_dependency 'rake', '~> 13.0'
|
35
|
-
gem.add_development_dependency 'rspec', '~> 3.
|
36
|
-
gem.add_development_dependency 'yard', '~> 0.9.
|
35
|
+
gem.add_development_dependency 'rspec', '~> 3.12'
|
36
|
+
gem.add_development_dependency 'yard', '~> 0.9.28'
|
37
37
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
require 'simplecov'
|
4
4
|
require 'coveralls'
|
5
5
|
|
6
|
-
Coveralls.wear!
|
7
|
-
|
8
6
|
SimpleCov.formatters = [
|
9
7
|
SimpleCov::Formatter::HTMLFormatter,
|
10
8
|
Coveralls::SimpleCov::Formatter,
|
11
9
|
]
|
12
10
|
|
13
|
-
|
11
|
+
Coveralls.wear! do
|
14
12
|
add_filter '/spec/'
|
15
13
|
end
|
16
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rambling-trie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgar Gonzalez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -31,28 +31,28 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '3.
|
34
|
+
version: '3.12'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '3.
|
41
|
+
version: '3.12'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: yard
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.9.
|
48
|
+
version: 0.9.28
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.9.
|
55
|
+
version: 0.9.28
|
56
56
|
description: 'The Rambling Trie is a Ruby implementation of the trie data structure,
|
57
57
|
which includes compression abilities and is designed to be very fast to traverse. '
|
58
58
|
email:
|
@@ -137,17 +137,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
137
|
requirements:
|
138
138
|
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: '2.
|
140
|
+
version: '2.7'
|
141
141
|
- - "<"
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
143
|
+
version: '4'
|
144
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
145
|
requirements:
|
146
146
|
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.4.10
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: A Ruby implementation of the trie data structure.
|