meilisearch-rails 0.2.2 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,46 +1,36 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
1
  require File.join(File.dirname(__FILE__), 'lib', 'meilisearch', 'version')
4
2
 
5
3
  require 'date'
6
4
 
7
5
  Gem::Specification.new do |s|
8
- s.name = "meilisearch-rails"
6
+ s.name = 'meilisearch-rails'
9
7
  s.version = MeiliSearch::VERSION
10
8
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.authors = ["Meili"]
13
- s.date = Date.today
14
- s.description = "MeiliSearch integration for Ruby on Rails. See https://github.com/meilisearch/MeiliSearch"
15
- s.email = "bonjour@meilisearch.com"
9
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
10
+ s.authors = ['Meili']
11
+ s.description = 'MeiliSearch integration for Ruby on Rails. See https://github.com/meilisearch/MeiliSearch'
12
+ s.email = 'bonjour@meilisearch.com'
13
+ s.homepage = 'http://github.com/meilisearch/meilisearch-rails'
14
+ s.licenses = ['MIT']
15
+ s.require_paths = ['lib']
16
+ s.summary = 'MeiliSearch integration for Ruby on Rails.'
17
+
16
18
  s.extra_rdoc_files = [
17
- "LICENSE",
18
- "README.md"
19
+ 'LICENSE',
20
+ 'README.md'
19
21
  ]
20
- s.files = [
21
- ".rspec",
22
- "Gemfile",
23
- "LICENSE",
24
- "README.md",
25
- "Rakefile",
26
- "meilisearch-rails.gemspec",
27
- "lib/meilisearch-rails.rb",
28
- "lib/meilisearch/ms_job.rb",
29
- "lib/meilisearch/configuration.rb",
30
- "lib/meilisearch/pagination.rb",
31
- "lib/meilisearch/pagination/kaminari.rb",
32
- "lib/meilisearch/pagination/will_paginate.rb",
33
- "lib/meilisearch/railtie.rb",
34
- "lib/meilisearch/tasks/meilisearch.rake",
35
- "lib/meilisearch/utilities.rb",
36
- "lib/meilisearch/version.rb",
37
- "spec/spec_helper.rb",
38
- "spec/utilities_spec.rb"
22
+
23
+ s.files = Dir[
24
+ 'lib/**/*',
25
+ '.rspec',
26
+ 'meilisearch-rails.gemspec',
27
+ 'Gemfile',
28
+ 'LICENSE',
29
+ 'README.md',
30
+ 'Rakefile'
39
31
  ]
40
- s.homepage = "http://github.com/meilisearch/meilisearch-rails"
41
- s.licenses = ["MIT"]
42
- s.require_paths = ["lib"]
43
- s.summary = "MeiliSearch integration for Ruby on Rails."
44
- s.add_dependency("json", [">= 1.5.1"])
45
- s.add_dependency("meilisearch", [">= 0.15.4"])
32
+
33
+ s.required_ruby_version = '>= 2.6.0'
34
+ s.add_dependency('json', ['>= 1.5.1'])
35
+ s.add_dependency('meilisearch', ['>= 0.15.4'])
46
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meilisearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
11
+ date: 2022-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -53,6 +53,7 @@ files:
53
53
  - Rakefile
54
54
  - lib/meilisearch-rails.rb
55
55
  - lib/meilisearch/configuration.rb
56
+ - lib/meilisearch/errors.rb
56
57
  - lib/meilisearch/ms_job.rb
57
58
  - lib/meilisearch/pagination.rb
58
59
  - lib/meilisearch/pagination/kaminari.rb
@@ -62,8 +63,6 @@ files:
62
63
  - lib/meilisearch/utilities.rb
63
64
  - lib/meilisearch/version.rb
64
65
  - meilisearch-rails.gemspec
65
- - spec/spec_helper.rb
66
- - spec/utilities_spec.rb
67
66
  homepage: http://github.com/meilisearch/meilisearch-rails
68
67
  licenses:
69
68
  - MIT
@@ -76,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
75
  requirements:
77
76
  - - ">="
78
77
  - !ruby/object:Gem::Version
79
- version: '0'
78
+ version: 2.6.0
80
79
  required_rubygems_version: !ruby/object:Gem::Requirement
81
80
  requirements:
82
81
  - - ">="
data/spec/spec_helper.rb DELETED
@@ -1,52 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- require 'timeout'
4
- require 'dotenv/load'
5
- require 'faker'
6
- Bundler.setup :test
7
-
8
- $LOAD_PATH.unshift(File.dirname(__FILE__))
9
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
-
11
- require 'meilisearch-rails'
12
- require 'rspec'
13
- require 'rails/all'
14
-
15
- raise "missing MEILISEARCH_HOST or MEILISEARCH_API_KEY environment variables" if ENV['MEILISEARCH_HOST'].nil? || ENV['MEILISEARCH_API_KEY'].nil?
16
-
17
- Thread.current[:meilisearch_hosts] = nil
18
-
19
- RSpec.configure do |c|
20
- c.mock_with :rspec
21
- c.filter_run focus: true
22
- c.run_all_when_everything_filtered = true
23
- c.formatter = 'documentation'
24
-
25
- c.around(:each) do |example|
26
- Timeout::timeout(120) {
27
- example.run
28
- }
29
- end
30
-
31
- # Remove all indexes setup in this run in local or CI
32
- c.after(:suite) do
33
- safe_index_list.each do |index|
34
- MeiliSearch.client.delete_index(index['name'])
35
- end
36
- end
37
- end
38
-
39
- # A unique prefix for your test run in local or CI
40
- SAFE_INDEX_PREFIX = "rails_#{SecureRandom.hex(8)}".freeze
41
-
42
- # avoid concurrent access to the same index in local or CI
43
- def safe_index_uid(name)
44
- "#{SAFE_INDEX_PREFIX}_#{name}"
45
- end
46
-
47
- # get a list of safe indexes in local or CI
48
- def safe_index_list
49
- list = MeiliSearch.client.indexes()
50
- list = list.select { |index| index["name"].include?(SAFE_INDEX_PREFIX) }
51
- list.sort_by { |index| index["primary"] || "" }
52
- end
@@ -1,30 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
2
-
3
- MeiliSearch.configuration = { meilisearch_host: ENV['MEILISEARCH_HOST'], meilisearch_api_key: ENV['MEILISEARCH_API_KEY'] }
4
-
5
- describe MeiliSearch::Utilities do
6
-
7
- before(:each) do
8
- @included_in = MeiliSearch.instance_variable_get :@included_in
9
- MeiliSearch.instance_variable_set :@included_in, []
10
-
11
- class Dummy
12
- include MeiliSearch
13
-
14
- def self.model_name
15
- "Dummy"
16
- end
17
-
18
- meilisearch
19
- end
20
- end
21
-
22
- after(:each) do
23
- MeiliSearch.instance_variable_set :@included_in, @included_in
24
- end
25
-
26
- it "should get the models where MeiliSearch module was included" do
27
- (MeiliSearch::Utilities.get_model_classes - [Dummy]).should == []
28
- end
29
-
30
- end