wordmap 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +10 -10
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/README.md +3 -3
- data/lib/wordmap/version.rb +1 -1
- data/lib/wordmap.rb +1 -1
- data/wordmap.gemspec +4 -4
- 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: ced71b07912a404954c7bab9a29f604cf6acb976a95259c37b1de93a963ac7bc
|
4
|
+
data.tar.gz: 26b615b55c6ed54196ac9fb8967ac6d33aba54f7c1607e2e923c059c16fc3099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cf9d213226291a8b7c65cba9d253cfe289b03f47645088add2d2fd6d3048dd966c9f311e3357b1933dae3ba9691674ccef8d79bae77f2eb7869b16024979094
|
7
|
+
data.tar.gz: '0149b00b14fd57a13abe21e2edde18a9a6e577be977ed8e03568a0e40deccbd0211e7fffed35229a47ab45df1af307c5d8a4dddb5e4166920843345cce976f20'
|
data/.github/workflows/rspec.yml
CHANGED
@@ -9,16 +9,16 @@ on:
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
11
|
runs-on: ubuntu-latest
|
12
|
+
name: Ruby ${{ matrix.ruby }}
|
12
13
|
strategy:
|
13
14
|
matrix:
|
14
|
-
ruby: [ '2.5', '2.6', '2.7' ]
|
15
|
-
|
16
|
-
name: Ruby ${{ matrix.ruby }}
|
15
|
+
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2' ]
|
17
16
|
steps:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
- uses: actions/checkout@v3
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Run RSpec
|
24
|
+
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright 2023 Max Chernyak
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
![RSpec](https://github.com/
|
1
|
+
![RSpec](https://github.com/maxim/wordmap/workflows/RSpec/badge.svg)
|
2
2
|
|
3
3
|
# Wordmap
|
4
4
|
|
@@ -130,7 +130,7 @@ fruits.each(:genus).to_a # => ["citrus", "musa"]
|
|
130
130
|
|
131
131
|
### Multi-dimensional keys
|
132
132
|
|
133
|
-
In the above examples the keys are simply `'banana'` and `'lemon'` — strings. If you make your key an array of strings, that'd make a multi-dimensional key. This can come helpful for some data where 2 keys make sense
|
133
|
+
In the above examples the keys are simply `'banana'` and `'lemon'` — strings. If you make your key an array of strings, that'd make a multi-dimensional key. This can come helpful for some data where 2 keys make sense. Internally, each dimension is a different vector. However if you go that route, keep in mind that all the "unused" key combinations will create gaps in the data file, therefore inflating its size. For example, if you make a key out of genus + name of a fruit, like `%w[citrus lemon]` and `%w[musa banana]`, your file will become inflated with empty cells created for keys `%w[citrus banana]` and `%w[musa lemon]`. That space is taken (padded with null bytes) even though there are no values for these keys.
|
134
134
|
|
135
135
|
## Anatomy
|
136
136
|
|
@@ -191,7 +191,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
191
191
|
|
192
192
|
## Contributing
|
193
193
|
|
194
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
194
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/maxim/wordmap. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/wordmap/blob/main/CODE_OF_CONDUCT.md).
|
195
195
|
|
196
196
|
|
197
197
|
## Code of Conduct
|
data/lib/wordmap/version.rb
CHANGED
data/lib/wordmap.rb
CHANGED
@@ -14,7 +14,7 @@ class Wordmap
|
|
14
14
|
|
15
15
|
class << self
|
16
16
|
def create(path, hash, index_names = [])
|
17
|
-
raise ArgumentError, "Path already exists: #{path}" if Dir.
|
17
|
+
raise ArgumentError, "Path already exists: #{path}" if Dir.exist?(path)
|
18
18
|
|
19
19
|
index_data = index_names.map { |name| [name, {}] }.to_h
|
20
20
|
vecs = Builder.build_vectors(hash)
|
data/wordmap.gemspec
CHANGED
@@ -3,17 +3,17 @@ require_relative 'lib/wordmap/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'wordmap'
|
5
5
|
spec.version = Wordmap::VERSION
|
6
|
-
spec.authors = ['
|
7
|
-
spec.email = ['
|
6
|
+
spec.authors = ['Max Chernyak']
|
7
|
+
spec.email = ['hello@max.engineer']
|
8
8
|
|
9
9
|
spec.summary = 'Look up data from disk without using your RAM.'
|
10
10
|
spec.description = 'Wordmap is a simple way to lookup data directly from disk, bypassing RAM. It uses pread (no buffering), and takes advantage of SSD\'s constant seek time. The data is stored in equal size "cells" making it easy to calculate where things are located based on vectors.'
|
11
|
-
spec.homepage = 'https://github.com/
|
11
|
+
spec.homepage = 'https://github.com/maxim/wordmap'
|
12
12
|
spec.license = 'Apache-2.0'
|
13
13
|
|
14
14
|
spec.metadata['homepage_uri'] = spec.homepage
|
15
15
|
spec.metadata['source_code_uri'] = spec.homepage
|
16
|
-
spec.metadata['changelog_uri'] = 'https://github.com/
|
16
|
+
spec.metadata['changelog_uri'] = 'https://github.com/maxim/wordmap/blob/master/CHANGELOG.md'
|
17
17
|
|
18
18
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
|
19
19
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Max Chernyak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,7 +71,7 @@ description: Wordmap is a simple way to lookup data directly from disk, bypassin
|
|
71
71
|
The data is stored in equal size "cells" making it easy to calculate where things
|
72
72
|
are located based on vectors.
|
73
73
|
email:
|
74
|
-
-
|
74
|
+
- hello@max.engineer
|
75
75
|
executables: []
|
76
76
|
extensions: []
|
77
77
|
extra_rdoc_files: []
|
@@ -94,13 +94,13 @@ files:
|
|
94
94
|
- lib/wordmap/index_value.rb
|
95
95
|
- lib/wordmap/version.rb
|
96
96
|
- wordmap.gemspec
|
97
|
-
homepage: https://github.com/
|
97
|
+
homepage: https://github.com/maxim/wordmap
|
98
98
|
licenses:
|
99
99
|
- Apache-2.0
|
100
100
|
metadata:
|
101
|
-
homepage_uri: https://github.com/
|
102
|
-
source_code_uri: https://github.com/
|
103
|
-
changelog_uri: https://github.com/
|
101
|
+
homepage_uri: https://github.com/maxim/wordmap
|
102
|
+
source_code_uri: https://github.com/maxim/wordmap
|
103
|
+
changelog_uri: https://github.com/maxim/wordmap/blob/master/CHANGELOG.md
|
104
104
|
post_install_message:
|
105
105
|
rdoc_options: []
|
106
106
|
require_paths:
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
119
|
+
rubygems_version: 3.4.10
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Look up data from disk without using your RAM.
|