algoliasearch-rails 3.0.1 → 3.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14ef8f9ecc85826893e288b3fc0ec82a908b407893edb067f0fe2acc05f89240
4
- data.tar.gz: acd4e020ef97b41b6900e0c379abe1cb6f02e503980d0da7186e85250ba4eb75
3
+ metadata.gz: 4ec49453fc134f428440bbebbc76bc0058a8d67b80cd0343733676e9d4243fa2
4
+ data.tar.gz: 886f503f47f260fde99c8cebedd13b277da2a0f22b3f988562b9278cc432c509
5
5
  SHA512:
6
- metadata.gz: 594ce23363e9706940a948f27b29db9be1a030859714672a3fba8aa2b3818173188cd64b294699f086966bc5b446ba51612a30fb9ae83ec80fbd2ea839ac7ade
7
- data.tar.gz: 0ba91ece82a88fffadaeff270b1a1de90a7409bc09c370848b31cfeb732712df92c33382031d4d6c956f02d915a19655569e4eac3d9545086e591279aeb2f16e
6
+ metadata.gz: e085d5baf59dafa663801f7269bab45b05aabedf13b8307a2d34853c024636dc4a5d95fc9cfbd3a7af951a50fd32035e41489e3d5ace5233f6fc8a9c780cc92c
7
+ data.tar.gz: 572cf6152d707c7d0bcf365e04b9761188f3bdc2656687270293079466de5f31dfdcd0daea3dd0a334be7e437ded208da8777c29731864e2a547b2fa3baeb7ab
data/CHANGELOG.MD CHANGED
@@ -1,6 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
- ## [Unreleased](https://github.com/algolia/algoliasearch-rails/compare/3.0.0...master)
3
+ ## [Unreleased](https://github.com/algolia/algoliasearch-rails/compare/3.0.4...master)
4
+
5
+ ## [3.0.4](https://github.com/algolia/algoliasearch-rails/compare/3.0.3...3.0.4)
6
+ ### Fixed
7
+ * Make the gemspec buildable with modern RubyGems by removing `Gemfile.lock` and bare directory entries from `s.files` and dropping the stale hardcoded `s.rubygems_version` [`#464`](https://github.com/algolia/algoliasearch-rails/pull/464)
8
+
9
+ ## [3.0.3](https://github.com/algolia/algoliasearch-rails/compare/3.0.2...3.0.3)
10
+ ### Fixed
11
+ * Add the documented `AlgoliaSearch.client=` writer and forward timeout configuration to the client [`#462`](https://github.com/algolia/algoliasearch-rails/pull/462)
12
+
13
+ ## [3.0.2](https://github.com/algolia/algoliasearch-rails/compare/3.0.1...3.0.2)
14
+ ### Fixed
15
+ * Avoid re-initializing index [`#457`](https://github.com/algolia/algoliasearch-rails/pull/457)
4
16
 
5
17
  ## [3.0.1](https://github.com/algolia/algoliasearch-rails/compare/3.0.0...3.0.1)
6
18
  ### Fixed
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'json', '>= 1.5.1'
4
- gem 'algolia', '>= 3.5.2'
4
+ gem 'algolia', '>= 3.12.0'
5
5
 
6
6
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
7
7
  gem 'rubysl', '~> 2.0', :platform => :rbx
@@ -10,6 +10,8 @@ end
10
10
  group :test do
11
11
  rails_version = ENV["RAILS_VERSION"] || '6.1'
12
12
  gem 'rails', "~> #{rails_version}"
13
+ # strscan 3.1.6+ references rb_deprecate_constant, which the CI ruby 2.5 build does not export
14
+ gem 'strscan', '< 3.1.6' if RUBY_VERSION < '2.6'
13
15
  gem 'active_model_serializers'
14
16
  if Gem::Version.new(rails_version) >= Gem::Version.new('6.0')
15
17
  gem 'sqlite3', '~> 1.4.0', :platform => [:rbx, :ruby]
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  ".rspec",
24
24
  "CHANGELOG.MD",
25
25
  "Gemfile",
26
- "Gemfile.lock",
27
26
  "LICENSE",
28
27
  "README.md",
29
28
  "Rakefile",
@@ -53,14 +52,12 @@ Gem::Specification.new do |s|
53
52
  "vendor/assets/javascripts/algolia/typeahead.bundle.min.js",
54
53
  "vendor/assets/javascripts/algolia/typeahead.jquery.js",
55
54
  "vendor/assets/javascripts/algolia/typeahead.jquery.min.js",
56
- "vendor/assets/javascripts/algolia/v2",
57
55
  "vendor/assets/javascripts/algolia/v2/algoliasearch.angular.js",
58
56
  "vendor/assets/javascripts/algolia/v2/algoliasearch.angular.min.js",
59
57
  "vendor/assets/javascripts/algolia/v2/algoliasearch.jquery.js",
60
58
  "vendor/assets/javascripts/algolia/v2/algoliasearch.jquery.min.js",
61
59
  "vendor/assets/javascripts/algolia/v2/algoliasearch.js",
62
60
  "vendor/assets/javascripts/algolia/v2/algoliasearch.min.js",
63
- "vendor/assets/javascripts/algolia/v3",
64
61
  "vendor/assets/javascripts/algolia/v3/algoliasearch.angular.js",
65
62
  "vendor/assets/javascripts/algolia/v3/algoliasearch.angular.min.js",
66
63
  "vendor/assets/javascripts/algolia/v3/algoliasearch.jquery.js",
@@ -71,7 +68,6 @@ Gem::Specification.new do |s|
71
68
  s.homepage = "http://github.com/algolia/algoliasearch-rails"
72
69
  s.licenses = ["MIT"]
73
70
  s.require_paths = ["lib"]
74
- s.rubygems_version = "2.1.11"
75
71
  s.summary = "AlgoliaSearch integration to your favorite ORM"
76
72
 
77
73
  if s.respond_to? :specification_version then
@@ -21,6 +21,10 @@ module AlgoliaSearch
21
21
  @client
22
22
  end
23
23
 
24
+ def client=(client)
25
+ @client = client
26
+ end
27
+
24
28
  def setup_client
25
29
  @client = Algolia::SearchClient.create(
26
30
  @@configuration[:application_id],
@@ -31,7 +35,7 @@ module AlgoliaSearch
31
35
  "Rails (#{defined?(::Rails::VERSION::STRING) ? ::Rails::VERSION::STRING : 'unknown'})",
32
36
  @@configuration[:append_to_user_agent]
33
37
  ].compact
34
- })
38
+ }.merge(@@configuration.slice(:connect_timeout, :read_timeout, :write_timeout)))
35
39
  end
36
40
 
37
41
  def default_configuration
@@ -1,3 +1,3 @@
1
1
  module AlgoliaSearch
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.4'
3
3
  end
@@ -540,7 +540,7 @@ module AlgoliaSearch
540
540
 
541
541
  synonyms = s.delete("synonyms") || s.delete(:synonyms)
542
542
  unless synonyms.nil? || synonyms.empty?
543
- resp = AlgoliaSearch.client.save_synonyms(index_name,synonyms.map {|s| Algolia::Search::SynonymHit.new({object_id: s.join("-"), synonyms: s, type: "synonym"}) } )
543
+ resp = AlgoliaSearch.client.save_synonyms(index_name,synonyms.map {|s| Algolia::Search::SynonymHit.new({algolia_object_id: s.join("-"), synonyms: s, type: "synonym"}) } )
544
544
  AlgoliaSearch.client.wait_for_task(index_name, resp.task_id) if synchronous || options[:synchronous]
545
545
  end
546
546
 
@@ -769,10 +769,11 @@ module AlgoliaSearch
769
769
  options ||= algoliasearch_options
770
770
  settings ||= algoliasearch_settings
771
771
 
772
- return if @algolia_indexes_init[settings]
773
-
774
772
  index_name = algolia_index_name(options)
775
773
 
774
+ return if @algolia_indexes_init[index_name]
775
+
776
+ @algolia_indexes_init[index_name] = settings
776
777
 
777
778
  index_settings_hash ||= settings.to_settings.to_hash
778
779
  index_settings_hash = options[:primary_settings].to_settings.to_hash.merge(index_settings_hash) if options[:inherit]
@@ -792,7 +793,7 @@ module AlgoliaSearch
792
793
 
793
794
  synonyms = s.delete("synonyms") || s.delete(:synonyms)
794
795
  unless synonyms.nil? || synonyms.empty?
795
- resp = AlgoliaSearch.client.save_synonyms(index_name,synonyms.map {|s| Algolia::Search::SynonymHit.new({object_id: s.join("-"), synonyms: s, type: "synonym"}) } )
796
+ resp = AlgoliaSearch.client.save_synonyms(index_name,synonyms.map {|s| Algolia::Search::SynonymHit.new({algolia_object_id: s.join("-"), synonyms: s, type: "synonym"}) } )
796
797
  AlgoliaSearch.client.wait_for_task(index_name, resp.task_id) if options[:synchronous]
797
798
  end
798
799
 
data/spec/spec_helper.rb CHANGED
@@ -31,7 +31,14 @@ RSpec.configure do |c|
31
31
 
32
32
  # Remove all indexes setup in this run in local or CI
33
33
  c.after(:suite) do
34
- safe_index_list.each do |i|
34
+ begin
35
+ indexes = safe_index_list
36
+ rescue => e
37
+ # no reachable app (e.g. running unit specs without real credentials), nothing to clean up
38
+ warn "skipping index cleanup: #{e.message}"
39
+ next
40
+ end
41
+ indexes.each do |i|
35
42
  begin
36
43
  res = AlgoliaSearch.client.delete_index(i.name)
37
44
  AlgoliaSearch.client.wait_for_task(i.name, res.task_id)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-03 00:00:00.000000000 Z
10
+ date: 2026-09-01 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: json
@@ -121,7 +120,6 @@ files:
121
120
  - ".rspec"
122
121
  - CHANGELOG.MD
123
122
  - Gemfile
124
- - Gemfile.lock
125
123
  - LICENSE
126
124
  - README.md
127
125
  - Rakefile
@@ -167,7 +165,6 @@ homepage: http://github.com/algolia/algoliasearch-rails
167
165
  licenses:
168
166
  - MIT
169
167
  metadata: {}
170
- post_install_message:
171
168
  rdoc_options: []
172
169
  require_paths:
173
170
  - lib
@@ -182,8 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
179
  - !ruby/object:Gem::Version
183
180
  version: '0'
184
181
  requirements: []
185
- rubygems_version: 3.1.6
186
- signing_key:
182
+ rubygems_version: 4.0.3
187
183
  specification_version: 4
188
184
  summary: AlgoliaSearch integration to your favorite ORM
189
185
  test_files: []
data/Gemfile.lock DELETED
@@ -1,218 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- actioncable (6.1.4.7)
5
- actionpack (= 6.1.4.7)
6
- activesupport (= 6.1.4.7)
7
- nio4r (~> 2.0)
8
- websocket-driver (>= 0.6.1)
9
- actionmailbox (6.1.4.7)
10
- actionpack (= 6.1.4.7)
11
- activejob (= 6.1.4.7)
12
- activerecord (= 6.1.4.7)
13
- activestorage (= 6.1.4.7)
14
- activesupport (= 6.1.4.7)
15
- mail (>= 2.7.1)
16
- actionmailer (6.1.4.7)
17
- actionpack (= 6.1.4.7)
18
- actionview (= 6.1.4.7)
19
- activejob (= 6.1.4.7)
20
- activesupport (= 6.1.4.7)
21
- mail (~> 2.5, >= 2.5.4)
22
- rails-dom-testing (~> 2.0)
23
- actionpack (6.1.4.7)
24
- actionview (= 6.1.4.7)
25
- activesupport (= 6.1.4.7)
26
- rack (~> 2.0, >= 2.0.9)
27
- rack-test (>= 0.6.3)
28
- rails-dom-testing (~> 2.0)
29
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
30
- actiontext (6.1.4.7)
31
- actionpack (= 6.1.4.7)
32
- activerecord (= 6.1.4.7)
33
- activestorage (= 6.1.4.7)
34
- activesupport (= 6.1.4.7)
35
- nokogiri (>= 1.8.5)
36
- actionview (6.1.4.7)
37
- activesupport (= 6.1.4.7)
38
- builder (~> 3.1)
39
- erubi (~> 1.4)
40
- rails-dom-testing (~> 2.0)
41
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
42
- active_model_serializers (0.10.13)
43
- actionpack (>= 4.1, < 7.1)
44
- activemodel (>= 4.1, < 7.1)
45
- case_transform (>= 0.2)
46
- jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
47
- activejob (6.1.4.7)
48
- activesupport (= 6.1.4.7)
49
- globalid (>= 0.3.6)
50
- activemodel (6.1.4.7)
51
- activesupport (= 6.1.4.7)
52
- activerecord (6.1.4.7)
53
- activemodel (= 6.1.4.7)
54
- activesupport (= 6.1.4.7)
55
- activestorage (6.1.4.7)
56
- actionpack (= 6.1.4.7)
57
- activejob (= 6.1.4.7)
58
- activerecord (= 6.1.4.7)
59
- activesupport (= 6.1.4.7)
60
- marcel (~> 1.0.0)
61
- mini_mime (>= 1.1.0)
62
- activesupport (6.1.4.7)
63
- concurrent-ruby (~> 1.0, >= 1.0.2)
64
- i18n (>= 1.6, < 2)
65
- minitest (>= 5.1)
66
- tzinfo (~> 2.0)
67
- zeitwerk (~> 2.3)
68
- algolia (2.3.2)
69
- faraday (>= 0.15, < 3)
70
- faraday-net_http_persistent (>= 0.15, < 3)
71
- multi_json (~> 1.0)
72
- net-http-persistent
73
- base64 (0.2.0)
74
- builder (3.2.4)
75
- case_transform (0.2)
76
- activesupport
77
- concurrent-ruby (1.2.2)
78
- connection_pool (2.4.1)
79
- crass (1.0.6)
80
- date (3.3.3)
81
- diff-lcs (1.5.1)
82
- erubi (1.12.0)
83
- faraday (2.8.1)
84
- base64
85
- faraday-net_http (>= 2.0, < 3.1)
86
- ruby2_keywords (>= 0.0.4)
87
- faraday-net_http (3.0.2)
88
- faraday-net_http_persistent (2.3.0)
89
- faraday (~> 2.5)
90
- net-http-persistent (>= 4.0.4, < 5)
91
- globalid (1.1.0)
92
- activesupport (>= 5.0)
93
- i18n (1.14.1)
94
- concurrent-ruby (~> 1.0)
95
- json (2.6.3)
96
- jsonapi-renderer (0.2.2)
97
- kaminari (0.17.0)
98
- actionpack (>= 3.0.0)
99
- activesupport (>= 3.0.0)
100
- loofah (2.21.3)
101
- crass (~> 1.0.2)
102
- nokogiri (>= 1.12.0)
103
- mail (2.8.1)
104
- mini_mime (>= 0.1.1)
105
- net-imap
106
- net-pop
107
- net-smtp
108
- marcel (1.0.2)
109
- method_source (1.0.0)
110
- mini_mime (1.1.5)
111
- mini_portile2 (2.8.4)
112
- minitest (5.19.0)
113
- multi_json (1.15.0)
114
- net-http-persistent (4.0.4)
115
- connection_pool (~> 2.2)
116
- net-imap (0.3.7)
117
- date
118
- net-protocol
119
- net-pop (0.1.2)
120
- net-protocol
121
- net-protocol (0.2.1)
122
- timeout
123
- net-smtp (0.3.3)
124
- net-protocol
125
- nio4r (2.5.9)
126
- nokogiri (1.13.10)
127
- mini_portile2 (~> 2.8.0)
128
- racc (~> 1.4)
129
- pagy (6.5.0)
130
- psych (5.1.0)
131
- stringio
132
- racc (1.7.1)
133
- rack (2.2.8)
134
- rack-test (2.1.0)
135
- rack (>= 1.3)
136
- rails (6.1.4.7)
137
- actioncable (= 6.1.4.7)
138
- actionmailbox (= 6.1.4.7)
139
- actionmailer (= 6.1.4.7)
140
- actionpack (= 6.1.4.7)
141
- actiontext (= 6.1.4.7)
142
- actionview (= 6.1.4.7)
143
- activejob (= 6.1.4.7)
144
- activemodel (= 6.1.4.7)
145
- activerecord (= 6.1.4.7)
146
- activestorage (= 6.1.4.7)
147
- activesupport (= 6.1.4.7)
148
- bundler (>= 1.15.0)
149
- railties (= 6.1.4.7)
150
- sprockets-rails (>= 2.0.0)
151
- rails-dom-testing (2.2.0)
152
- activesupport (>= 5.0.0)
153
- minitest
154
- nokogiri (>= 1.6)
155
- rails-html-sanitizer (1.5.0)
156
- loofah (~> 2.19, >= 2.19.1)
157
- railties (6.1.4.7)
158
- actionpack (= 6.1.4.7)
159
- activesupport (= 6.1.4.7)
160
- method_source
161
- rake (>= 0.13)
162
- thor (~> 1.0)
163
- rake (10.1.1)
164
- rdoc (6.5.0)
165
- psych (>= 4.0.0)
166
- redgreen (1.2.2)
167
- rspec (2.99.0)
168
- rspec-core (~> 2.99.0)
169
- rspec-expectations (~> 2.99.0)
170
- rspec-mocks (~> 2.99.0)
171
- rspec-core (2.99.2)
172
- rspec-expectations (2.99.2)
173
- diff-lcs (>= 1.1.3, < 2.0)
174
- rspec-mocks (2.99.4)
175
- ruby2_keywords (0.0.5)
176
- sequel (5.71.0)
177
- sprockets (4.2.0)
178
- concurrent-ruby (~> 1.0)
179
- rack (>= 2.2.4, < 4)
180
- sprockets-rails (3.4.2)
181
- actionpack (>= 5.2)
182
- activesupport (>= 5.2)
183
- sprockets (>= 3.0.0)
184
- sqlite3 (1.4.4)
185
- stringio (3.0.6)
186
- thor (1.2.2)
187
- timeout (0.4.0)
188
- tzinfo (2.0.6)
189
- concurrent-ruby (~> 1.0)
190
- websocket-driver (0.7.6)
191
- websocket-extensions (>= 0.1.0)
192
- websocket-extensions (0.1.5)
193
- will_paginate (4.0.0)
194
- zeitwerk (2.6.11)
195
-
196
- PLATFORMS
197
- ruby
198
-
199
- DEPENDENCIES
200
- active_model_serializers
201
- activerecord-jdbc-adapter
202
- activerecord-jdbcsqlite3-adapter
203
- algolia (< 3.0.0)
204
- jdbc-sqlite3
205
- json (>= 1.5.1)
206
- kaminari (< 1)
207
- pagy
208
- rails (~> 6.1)
209
- rake (~> 10.1.0)
210
- rdoc
211
- redgreen
212
- rspec (>= 2.5.0, < 3.0)
213
- sequel (>= 4.0)
214
- sqlite3 (~> 1.4.0)
215
- will_paginate (>= 2.3.15)
216
-
217
- BUNDLED WITH
218
- 2.1.4