rom-neighbor 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: aa8b2e417e3b8d4e2410343c54355055aabf849459972311584c5bc00261f73f
4
+ data.tar.gz: b9bf317ab54361059a81fd008bc7f94fb9ce896a9b283fa9c60a9c8e352bfaf4
5
+ SHA512:
6
+ metadata.gz: f987ee26037f7f6739f7df6db079b2c44933de04d2cfaee9889a00f3059fc319e50b0452e4d629764aca393ef460d0d2b58cf658b0207866bf84a3769a1e8b40
7
+ data.tar.gz: 70212cfc2b1c19938c1bd7f25e497c51d93dada4224d1efc5de14b89789a2c0ce7ebca130f710a21601f185cf29068ea385eb13684d8c548614eda05657ee2f4
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-04-09
4
+
5
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in rom-neighbor.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
14
+ gem 'brakeman'
15
+ gem 'bundler-audit'
16
+ gem 'byebug'
17
+ gem 'dotenv'
18
+
19
+ gem 'rubocop-performance'
20
+ gem 'rubocop-sequel'
21
+ gem 'rubocop-shopify'
data/Gemfile.lock ADDED
@@ -0,0 +1,78 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rom-neighbor (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ brakeman (5.4.1)
11
+ bundler-audit (0.9.1)
12
+ bundler (>= 1.2.0, < 3)
13
+ thor (~> 1.0)
14
+ byebug (11.1.3)
15
+ diff-lcs (1.5.0)
16
+ dotenv (2.8.1)
17
+ json (2.6.3)
18
+ parallel (1.22.1)
19
+ parser (3.2.2.0)
20
+ ast (~> 2.4.1)
21
+ rainbow (3.1.1)
22
+ rake (13.0.6)
23
+ regexp_parser (2.7.0)
24
+ rexml (3.2.5)
25
+ rspec (3.12.0)
26
+ rspec-core (~> 3.12.0)
27
+ rspec-expectations (~> 3.12.0)
28
+ rspec-mocks (~> 3.12.0)
29
+ rspec-core (3.12.1)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-expectations (3.12.2)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.12.0)
34
+ rspec-mocks (3.12.5)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.12.0)
37
+ rspec-support (3.12.0)
38
+ rubocop (1.49.0)
39
+ json (~> 2.3)
40
+ parallel (~> 1.10)
41
+ parser (>= 3.2.0.0)
42
+ rainbow (>= 2.2.2, < 4.0)
43
+ regexp_parser (>= 1.8, < 3.0)
44
+ rexml (>= 3.2.5, < 4.0)
45
+ rubocop-ast (>= 1.28.0, < 2.0)
46
+ ruby-progressbar (~> 1.7)
47
+ unicode-display_width (>= 2.4.0, < 3.0)
48
+ rubocop-ast (1.28.0)
49
+ parser (>= 3.2.1.0)
50
+ rubocop-performance (1.16.0)
51
+ rubocop (>= 1.7.0, < 2.0)
52
+ rubocop-ast (>= 0.4.0)
53
+ rubocop-sequel (0.3.4)
54
+ rubocop (~> 1.0)
55
+ rubocop-shopify (2.12.0)
56
+ rubocop (~> 1.44)
57
+ ruby-progressbar (1.13.0)
58
+ thor (1.2.1)
59
+ unicode-display_width (2.4.2)
60
+
61
+ PLATFORMS
62
+ arm64-darwin-22
63
+
64
+ DEPENDENCIES
65
+ brakeman
66
+ bundler-audit
67
+ byebug
68
+ dotenv
69
+ rake (~> 13.0)
70
+ rom-neighbor!
71
+ rspec (~> 3.0)
72
+ rubocop (~> 1.21)
73
+ rubocop-performance
74
+ rubocop-sequel
75
+ rubocop-shopify
76
+
77
+ BUNDLED WITH
78
+ 2.4.10
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Jaigouk Kim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Rom::Neighbor
2
+
3
+ [![Ruby](https://github.com/jaigouk/rom-neighbor/actions/workflows/main.yml/badge.svg)](https://github.com/jaigouk/rom-neighbor/actions/workflows/main.yml)
4
+
5
+ THIS GEM IS UNDER DEVELOPMENT. DO NOT USE IT IN PRODUCTION.
6
+
7
+ this gem is a port of [neighbor gem](https://github.com/ankane/neighbor) for rom-rb.
8
+
9
+ Neighbor supports two extensions: [cube](https://www.postgresql.org/docs/current/cube.html) and [vector](https://github.com/pgvector/pgvector). cube ships with Postgres, while vector supports approximate nearest neighbor search.
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application’s Gemfile:
14
+
15
+ ```ruby
16
+ gem "rom-neighbor"
17
+ ```
18
+
19
+ ## Choose An Extension
20
+
21
+ Neighbor supports two extensions: [cube](https://www.postgresql.org/docs/current/cube.html) and [vector](https://github.com/pgvector/pgvector). cube ships with Postgres, while vector supports approximate nearest neighbor search.
22
+
23
+ ```sh
24
+ bundle exec rake 'db:create_migration[create_cube_extension]'
25
+ # add the following to the migration
26
+ CREATE EXTENSION cube;
27
+ ```
28
+
29
+ For vector, [install pgvector](https://github.com/pgvector/pgvector#installation) and run:
30
+
31
+ ```sh
32
+ cd /tmp
33
+ git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git
34
+ cd pgvector
35
+ make
36
+ make install # may need sudo
37
+
38
+ bundle exec rake 'db:create_migration[create_vector_extension]'
39
+ # add the following to the migration
40
+ CREATE EXTENSION vector;
41
+ ```
42
+
43
+ ## Usage
44
+
45
+ TBD
46
+
47
+ ## Development
48
+
49
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
50
+
51
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
52
+
53
+ ## Contributing
54
+
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jaigouk/rom-neighbor.
56
+
57
+ ## License
58
+
59
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rom
4
+ module Neighbor
5
+ VERSION = "0.0.1"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rom/neighbor/version"
4
+
5
+ module Rom
6
+ module Neighbor
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
10
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rom/neighbor/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rom-neighbor"
7
+ spec.version = Rom::Neighbor::VERSION
8
+ spec.authors = ["Jaigouk Kim"]
9
+
10
+
11
+ spec.summary = "neighbor gem for rom-rb"
12
+ spec.description = "neighbor gem for rom-rb"
13
+ spec.homepage = "https://github.com/jaigouk/rom-neighbor"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.7.0"
16
+
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
+
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/jaigouk/rom-neighbor'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/jaigouk/rom-neighbor/blob/main/CHANGELOG.md'
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
28
+ end
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ # Uncomment to register a new dependency of your gem
35
+ # spec.add_dependency "example-gem", "~> 1.0"
36
+
37
+ # For more information and examples about making a new gem, check out our
38
+ # guide at: https://bundler.io/guides/creating_gem.html
39
+ end
@@ -0,0 +1,6 @@
1
+ module Rom
2
+ module Neighbor
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rom-neighbor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jaigouk Kim
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-04-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: neighbor gem for rom-rb
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - ".rspec"
20
+ - ".rubocop.yml"
21
+ - CHANGELOG.md
22
+ - Gemfile
23
+ - Gemfile.lock
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/rom-neighbor.rb
28
+ - lib/rom/neighbor/version.rb
29
+ - rom-neighbor.gemspec
30
+ - sig/rom/neighbor.rbs
31
+ homepage: https://github.com/jaigouk/rom-neighbor
32
+ licenses:
33
+ - MIT
34
+ metadata:
35
+ allowed_push_host: https://rubygems.org
36
+ homepage_uri: https://github.com/jaigouk/rom-neighbor
37
+ source_code_uri: https://github.com/jaigouk/rom-neighbor
38
+ changelog_uri: https://github.com/jaigouk/rom-neighbor/blob/main/CHANGELOG.md
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.7.0
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubygems_version: 3.4.10
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: neighbor gem for rom-rb
58
+ test_files: []