algoliasearch 1.19.1 → 1.19.2

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
- SHA1:
3
- metadata.gz: c6d3628900c483aa108829e4d1f098279ff5dbef
4
- data.tar.gz: 6d9f67c79f103e9f09a3b815438f955d8a38fb85
2
+ SHA256:
3
+ metadata.gz: 7415df1901dcf0b5385fb28c1e442dcf0d4dbdbff4daa47ce1373103304a2382
4
+ data.tar.gz: ff76387ec82d308e1cd6388ab4f8c33969c086f4a504dc2e122e9fc20004b353
5
5
  SHA512:
6
- metadata.gz: 46855237729ca01b7a050dcaae33b23ffab39c84a6170513218473da3d32cde79a2d50f1e69283adaa5d0f23509c0bb6e9e4dfacd5ee8b7448bf6b5bd4e74054
7
- data.tar.gz: 34d64abe9d1504a6006e69ebfaa39874ed1e156acc19095ab6751fd67563e901a54e653831a7b4f8437c1af4acd6c6f6d732ebd0027673693f80967a72cfae45
6
+ metadata.gz: 7e76676e94d0386306ad19675804020bee0146c1f2dcb2581bb0f7f5a851b25218febed68151da64b2dbf15550fb3f2feae3328a2b206d534f4fe6b566892955
7
+ data.tar.gz: 5bedebce436947e4651daaff28cbba69dfc32302f2b515870663fea93fb05e85757ad0f836c20b2e19c31f9891582976fc4a56906ca91f23e98c377fcfb7c34d
data/.travis.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  language: ruby
2
+
2
3
  branches:
3
4
  only:
4
- - master
5
+ - master
6
+
5
7
  rvm:
6
8
  - 1.8.7
7
9
  - 1.9.3
@@ -10,16 +12,19 @@ rvm:
10
12
  - 2.2.5
11
13
  - 2.3.4
12
14
  - 2.4.1
15
+ - 2.5.0
13
16
  - jruby
14
17
  - rbx-2
18
+
15
19
  matrix:
16
20
  allow_failures:
17
- - rvm: rbx-2
18
- - rvm: jruby
21
+ - rvm: rbx-2
22
+ - rvm: jruby
23
+
19
24
  cache: bundler
20
- env:
21
- global:
22
- # ALGOLIA_APPLICATION_ID
23
- - secure: D+xCYUPyCXiuznMX0VYaihUQ+OO/qItazlAqJRT70fQfl5UlqAMOSaeN6ybE32dm3K1meWucINeDRecvFxB8XQy0a3oxUz6GTlEUOAXtKtn7XtdzwXmNaKdQMmAxYyomiCnlLB7LX14MldPl5S95Tf4tRs4d0nPHQmzsNPshzTM=
24
- # ALGOLIA_API_KEY
25
- - secure: dc5+Ulb1siqrWEydpyeccxfaZ/V6sFKmq+Xc8BLv6rwR/saBsXP1M5zVRXAkF6u6jnpLAxYBBIA9rbdFUAaYPY/16PKQY1lux1QYLW4pxc0Kk9s+JOSNyxLNoIeDJp8zOTwS/heDYj6WabL4n3mr5hsy645EC1VIbpfCe4IpMnw=
25
+
26
+ before_script:
27
+ - wget https://alg.li/algolia-keys && chmod +x algolia-keys
28
+
29
+ script:
30
+ - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [[ ! "$TRAVIS_PULL_REQUEST_SLUG" =~ ^algolia\/ ]]; then eval $(./algolia-keys export) && bundle exec rspec --tag ~maintainers_only; else bundle exec rspec; fi
data/Gemfile CHANGED
@@ -15,7 +15,7 @@ gem 'rubysl', '~> 2.0', :platform => :rbx
15
15
  group :development do
16
16
  gem 'highline', '< 1.7.0'
17
17
  gem 'coveralls'
18
- gem 'safe_yaml', '~> 1.0.4'
18
+ gem 'safe_yaml'
19
19
  gem 'travis'
20
20
  gem 'rake'
21
21
  gem 'rdoc'
@@ -26,5 +26,5 @@ group :test do
26
26
  gem 'redgreen'
27
27
  gem 'webmock'
28
28
  gem 'simplecov'
29
- gem 'mime-types', '< 2.0'
29
+ gem 'mime-types'
30
30
  end
data/Gemfile.lock CHANGED
@@ -2,31 +2,31 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  algoliasearch (1.19.1)
5
- httpclient (~> 2.8.3)
5
+ httpclient (~> 2.8, >= 2.8.3)
6
6
  json (>= 1.5.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  addressable (2.4.0)
12
- backports (3.10.3)
13
- coveralls (0.8.21)
14
- json (>= 1.8, < 3)
15
- simplecov (~> 0.14.1)
16
- term-ansicolor (~> 1.3)
17
- thor (~> 0.19.4)
18
- tins (~> 1.6)
12
+ backports (3.11.1)
13
+ coveralls (0.7.2)
14
+ multi_json (~> 1.3)
15
+ rest-client (= 1.6.7)
16
+ simplecov (>= 0.7)
17
+ term-ansicolor (= 1.2.2)
18
+ thor (= 0.18.1)
19
19
  crack (0.4.3)
20
20
  safe_yaml (~> 1.0.0)
21
21
  diff-lcs (1.3)
22
22
  docile (1.1.5)
23
23
  ethon (0.11.0)
24
24
  ffi (>= 1.3.0)
25
- faraday (0.13.1)
25
+ faraday (0.14.0)
26
26
  multipart-post (>= 1.2, < 3)
27
27
  faraday_middleware (0.12.2)
28
28
  faraday (>= 0.7.4, < 1.0)
29
- ffi (1.9.18)
29
+ ffi (1.9.23)
30
30
  ffi2-generators (0.1.1)
31
31
  gh (0.15.1)
32
32
  addressable (~> 2.4.0)
@@ -35,14 +35,16 @@ GEM
35
35
  multi_json (~> 1.0)
36
36
  net-http-persistent (~> 2.9)
37
37
  net-http-pipeline
38
- hashdiff (0.3.5)
38
+ hashdiff (0.3.7)
39
39
  highline (1.6.21)
40
40
  httpclient (2.8.3)
41
41
  json (2.1.0)
42
42
  launchy (2.4.3)
43
43
  addressable (~> 2.3)
44
- mime-types (1.25.1)
45
- multi_json (1.12.2)
44
+ mime-types (3.1)
45
+ mime-types-data (~> 3.2015)
46
+ mime-types-data (3.2016.0521)
47
+ multi_json (1.13.1)
46
48
  multipart-post (2.0.0)
47
49
  net-http-persistent (2.9.4)
48
50
  net-http-pipeline (1.0.1)
@@ -50,13 +52,15 @@ GEM
50
52
  json
51
53
  websocket (~> 1.0)
52
54
  rake (12.3.0)
53
- rdoc (6.0.0)
55
+ rdoc (6.0.1)
54
56
  redgreen (1.2.2)
57
+ rest-client (1.6.7)
58
+ mime-types (>= 1.16)
55
59
  rspec (3.7.0)
56
60
  rspec-core (~> 3.7.0)
57
61
  rspec-expectations (~> 3.7.0)
58
62
  rspec-mocks (~> 3.7.0)
59
- rspec-core (3.7.0)
63
+ rspec-core (3.7.1)
60
64
  rspec-support (~> 3.7.0)
61
65
  rspec-expectations (3.7.0)
62
66
  diff-lcs (>= 1.2.0, < 2.0)
@@ -64,7 +68,7 @@ GEM
64
68
  rspec-mocks (3.7.0)
65
69
  diff-lcs (>= 1.2.0, < 2.0)
66
70
  rspec-support (~> 3.7.0)
67
- rspec-support (3.7.0)
71
+ rspec-support (3.7.1)
68
72
  rubysl (2.2.0)
69
73
  rubysl-abbrev (~> 2.0)
70
74
  rubysl-base64 (~> 2.0)
@@ -222,7 +226,7 @@ GEM
222
226
  rubysl-observer (2.0.0)
223
227
  rubysl-open-uri (2.0.0)
224
228
  rubysl-open3 (2.0.0)
225
- rubysl-openssl (2.9)
229
+ rubysl-openssl (2.10)
226
230
  rubysl-optparse (2.0.1)
227
231
  rubysl-shellwords (~> 2.0)
228
232
  rubysl-ostruct (2.1.0)
@@ -268,15 +272,15 @@ GEM
268
272
  rubysl-yaml (2.1.0)
269
273
  rubysl-zlib (2.0.1)
270
274
  safe_yaml (1.0.4)
271
- simplecov (0.14.1)
275
+ simplecov (0.15.1)
272
276
  docile (~> 1.1.0)
273
277
  json (>= 1.8, < 3)
274
278
  simplecov-html (~> 0.10.0)
275
279
  simplecov-html (0.10.2)
276
- term-ansicolor (1.6.0)
277
- tins (~> 1.0)
278
- thor (0.19.4)
279
- tins (1.16.1)
280
+ term-ansicolor (1.2.2)
281
+ tins (~> 0.8)
282
+ thor (0.18.1)
283
+ tins (0.13.2)
280
284
  travis (1.8.8)
281
285
  backports
282
286
  faraday (~> 0.9)
@@ -288,7 +292,7 @@ GEM
288
292
  typhoeus (~> 0.6, >= 0.6.8)
289
293
  typhoeus (0.8.0)
290
294
  ethon (>= 0.8.0)
291
- webmock (3.1.1)
295
+ webmock (3.3.0)
292
296
  addressable (>= 2.3.6)
293
297
  crack (>= 0.3.2)
294
298
  hashdiff
@@ -301,16 +305,16 @@ DEPENDENCIES
301
305
  algoliasearch!
302
306
  coveralls
303
307
  highline (< 1.7.0)
304
- mime-types (< 2.0)
308
+ mime-types
305
309
  rake
306
310
  rdoc
307
311
  redgreen
308
312
  rspec (>= 2.5.0)
309
313
  rubysl (~> 2.0)
310
- safe_yaml (~> 1.0.4)
314
+ safe_yaml
311
315
  simplecov
312
316
  travis
313
317
  webmock
314
318
 
315
319
  BUNDLED WITH
316
- 1.16.0
320
+ 1.16.1
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
1
  # Algolia Search API Client for Ruby
2
2
 
3
- [Algolia Search](https://www.algolia.com) is a hosted full-text, numerical, and faceted search engine capable of delivering realtime results from the first keystroke.
4
- The **Algolia Search API Client for Ruby** lets you easily use the [Algolia Search REST API](https://www.algolia.com/doc/rest-api/search) from your Ruby code.
3
+ [Algolia Search](https://www.algolia.com) is a hosted full-text, numerical,
4
+ and faceted search engine capable of delivering realtime results from the first keystroke.
5
+
6
+ The **Algolia Search API Client for Ruby** lets
7
+ you easily use the [Algolia Search REST API](https://www.algolia.com/doc/rest-api/search) from
8
+ your Ruby code.
5
9
 
6
10
  [![Build Status](https://travis-ci.org/algolia/algoliasearch-client-ruby.svg?branch=master)](https://travis-ci.org/algolia/algoliasearch-client-ruby) [![Gem Version](https://badge.fury.io/rb/algoliasearch.svg)](http://badge.fury.io/rb/algoliasearch) [![Code Climate](https://codeclimate.com/github/algolia/algoliasearch-client-ruby.svg)](https://codeclimate.com/github/algolia/algoliasearch-client-ruby) [![Coverage Status](https://coveralls.io/repos/algolia/algoliasearch-client-ruby/badge.svg)](https://coveralls.io/r/algolia/algoliasearch-client-ruby)
7
11
 
@@ -22,11 +26,9 @@ You can find the full reference on [Algolia's website](https://www.algolia.com/d
22
26
 
23
27
  1. **[Install](#install)**
24
28
 
25
- * [Ruby on Rails](#ruby-on-rails)
26
29
 
27
30
  1. **[Quick Start](#quick-start)**
28
31
 
29
- * [Initialize the client](#initialize-the-client)
30
32
 
31
33
  1. **[Push data](#push-data)**
32
34
 
@@ -39,18 +41,14 @@ You can find the full reference on [Algolia's website](https://www.algolia.com/d
39
41
 
40
42
  1. **[Search UI](#search-ui)**
41
43
 
42
- * [index.html](#indexhtml)
43
44
 
44
45
  1. **[List of available methods](#list-of-available-methods)**
45
46
 
46
47
 
47
-
48
-
49
48
  # Getting Started
50
49
 
51
50
 
52
51
 
53
-
54
52
  ## Install
55
53
 
56
54
  Install AlgoliaSearch using:
@@ -212,75 +210,94 @@ search.start();
212
210
 
213
211
 
214
212
 
213
+
214
+
215
215
  ### Search
216
216
 
217
- - [Search an index](https://algolia.com/doc/api-reference/api-methods/search/?language=ruby)
218
- - [Search for facet values](https://algolia.com/doc/api-reference/api-methods/search-for-facet-values/?language=ruby)
219
- - [Search multiple indexes](https://algolia.com/doc/api-reference/api-methods/multiple-queries/?language=ruby)
220
- - [Browse an index](https://algolia.com/doc/api-reference/api-methods/browse/?language=ruby)
217
+ - [Search an index](https://algolia.com/doc/api-reference/api-methods/search/?language=ruby)
218
+ - [Search for facet values](https://algolia.com/doc/api-reference/api-methods/search-for-facet-values/?language=ruby)
219
+ - [Search multiple indexes](https://algolia.com/doc/api-reference/api-methods/multiple-queries/?language=ruby)
220
+ - [Browse an index](https://algolia.com/doc/api-reference/api-methods/browse/?language=ruby)
221
+
222
+
221
223
 
222
224
 
223
225
 
224
226
  ### Indexing
225
227
 
226
- - [Add objects](https://algolia.com/doc/api-reference/api-methods/add-objects/?language=ruby)
227
- - [Update objects](https://algolia.com/doc/api-reference/api-methods/update-objects/?language=ruby)
228
- - [Partial update objects](https://algolia.com/doc/api-reference/api-methods/partial-update-objects/?language=ruby)
229
- - [Delete objects](https://algolia.com/doc/api-reference/api-methods/delete-objects/?language=ruby)
230
- - [Delete by query](https://algolia.com/doc/api-reference/api-methods/delete-by-query/?language=ruby)
231
- - [Get objects](https://algolia.com/doc/api-reference/api-methods/get-objects/?language=ruby)
232
- - [Custom batch](https://algolia.com/doc/api-reference/api-methods/batch/?language=ruby)
233
- - [Wait for operations](https://algolia.com/doc/api-reference/api-methods/wait-task/?language=ruby)
228
+ - [Add objects](https://algolia.com/doc/api-reference/api-methods/add-objects/?language=ruby)
229
+ - [Update objects](https://algolia.com/doc/api-reference/api-methods/update-objects/?language=ruby)
230
+ - [Partial update objects](https://algolia.com/doc/api-reference/api-methods/partial-update-objects/?language=ruby)
231
+ - [Delete objects](https://algolia.com/doc/api-reference/api-methods/delete-objects/?language=ruby)
232
+ - [Delete by query](https://algolia.com/doc/api-reference/api-methods/delete-by-query/?language=ruby)
233
+ - [Get objects](https://algolia.com/doc/api-reference/api-methods/get-objects/?language=ruby)
234
+ - [Custom batch](https://algolia.com/doc/api-reference/api-methods/batch/?language=ruby)
235
+ - [Wait for operations](https://algolia.com/doc/api-reference/api-methods/wait-task/?language=ruby)
236
+
237
+
234
238
 
235
239
 
236
240
 
237
241
  ### Settings
238
242
 
239
- - [Get settings](https://algolia.com/doc/api-reference/api-methods/get-settings/?language=ruby)
240
- - [Set settings](https://algolia.com/doc/api-reference/api-methods/set-settings/?language=ruby)
243
+ - [Get settings](https://algolia.com/doc/api-reference/api-methods/get-settings/?language=ruby)
244
+ - [Set settings](https://algolia.com/doc/api-reference/api-methods/set-settings/?language=ruby)
245
+
246
+
241
247
 
242
248
 
243
249
 
244
250
  ### Manage indices
245
251
 
246
- - [List indexes](https://algolia.com/doc/api-reference/api-methods/list-indices/?language=ruby)
247
- - [Delete index](https://algolia.com/doc/api-reference/api-methods/delete-index/?language=ruby)
248
- - [Copy index](https://algolia.com/doc/api-reference/api-methods/copy-index/?language=ruby)
249
- - [Move index](https://algolia.com/doc/api-reference/api-methods/move-index/?language=ruby)
250
- - [Clear index](https://algolia.com/doc/api-reference/api-methods/clear-index/?language=ruby)
252
+ - [List indexes](https://algolia.com/doc/api-reference/api-methods/list-indices/?language=ruby)
253
+ - [Delete index](https://algolia.com/doc/api-reference/api-methods/delete-index/?language=ruby)
254
+ - [Copy index](https://algolia.com/doc/api-reference/api-methods/copy-index/?language=ruby)
255
+ - [Move index](https://algolia.com/doc/api-reference/api-methods/move-index/?language=ruby)
256
+ - [Clear index](https://algolia.com/doc/api-reference/api-methods/clear-index/?language=ruby)
257
+
258
+
251
259
 
252
260
 
253
261
 
254
262
  ### API Keys
255
263
 
256
- - [Create secured API Key](https://algolia.com/doc/api-reference/api-methods/generate-secured-api-key/?language=ruby)
257
- - [Add API Key](https://algolia.com/doc/api-reference/api-methods/add-api-key/?language=ruby)
258
- - [Update API Key](https://algolia.com/doc/api-reference/api-methods/update-api-key/?language=ruby)
259
- - [Delete API Key](https://algolia.com/doc/api-reference/api-methods/delete-api-key/?language=ruby)
260
- - [Get API Key permissions](https://algolia.com/doc/api-reference/api-methods/get-api-key/?language=ruby)
261
- - [List API Keys](https://algolia.com/doc/api-reference/api-methods/list-api-keys/?language=ruby)
264
+ - [Create secured API Key](https://algolia.com/doc/api-reference/api-methods/generate-secured-api-key/?language=ruby)
265
+ - [Add API Key](https://algolia.com/doc/api-reference/api-methods/add-api-key/?language=ruby)
266
+ - [Update API Key](https://algolia.com/doc/api-reference/api-methods/update-api-key/?language=ruby)
267
+ - [Delete API Key](https://algolia.com/doc/api-reference/api-methods/delete-api-key/?language=ruby)
268
+ - [Get API Key permissions](https://algolia.com/doc/api-reference/api-methods/get-api-key/?language=ruby)
269
+ - [List API Keys](https://algolia.com/doc/api-reference/api-methods/list-api-keys/?language=ruby)
270
+
271
+
262
272
 
263
273
 
264
274
 
265
275
  ### Synonyms
266
276
 
267
- - [Save synonym](https://algolia.com/doc/api-reference/api-methods/save-synonym/?language=ruby)
268
- - [Batch synonyms](https://algolia.com/doc/api-reference/api-methods/batch-synonyms/?language=ruby)
269
- - [Delete synonym](https://algolia.com/doc/api-reference/api-methods/delete-synonym/?language=ruby)
270
- - [Clear all synonyms](https://algolia.com/doc/api-reference/api-methods/clear-synonyms/?language=ruby)
271
- - [Get synonym](https://algolia.com/doc/api-reference/api-methods/get-synonym/?language=ruby)
272
- - [Search synonyms](https://algolia.com/doc/api-reference/api-methods/search-synonyms/?language=ruby)
277
+ - [Save synonym](https://algolia.com/doc/api-reference/api-methods/save-synonym/?language=ruby)
278
+ - [Batch synonyms](https://algolia.com/doc/api-reference/api-methods/batch-synonyms/?language=ruby)
279
+ - [Delete synonym](https://algolia.com/doc/api-reference/api-methods/delete-synonym/?language=ruby)
280
+ - [Clear all synonyms](https://algolia.com/doc/api-reference/api-methods/clear-synonyms/?language=ruby)
281
+ - [Get synonym](https://algolia.com/doc/api-reference/api-methods/get-synonym/?language=ruby)
282
+ - [Search synonyms](https://algolia.com/doc/api-reference/api-methods/search-synonyms/?language=ruby)
283
+ - [Export Synonyms](https://algolia.com/doc/api-reference/api-methods/export-synonyms/?language=ruby)
284
+
285
+
273
286
 
274
287
 
275
288
 
276
289
  ### Query rules
277
290
 
278
- - [Save a single rule](https://algolia.com/doc/api-reference/api-methods/rules-save/?language=ruby)
279
- - [Batch save multiple rules](https://algolia.com/doc/api-reference/api-methods/rules-save-batch/?language=ruby)
280
- - [Read a rule](https://algolia.com/doc/api-reference/api-methods/rules-read/?language=ruby)
281
- - [Delete a single rule](https://algolia.com/doc/api-reference/api-methods/rules-delete/?language=ruby)
282
- - [Clear all rules](https://algolia.com/doc/api-reference/api-methods/rules-clear/?language=ruby)
283
- - [Search for rules](https://algolia.com/doc/api-reference/api-methods/rules-search/?language=ruby)
291
+ - [Save a single rule](https://algolia.com/doc/api-reference/api-methods/rules-save/?language=ruby)
292
+ - [Batch save multiple rules](https://algolia.com/doc/api-reference/api-methods/rules-save-batch/?language=ruby)
293
+ - [Read a rule](https://algolia.com/doc/api-reference/api-methods/rules-read/?language=ruby)
294
+ - [Delete a single rule](https://algolia.com/doc/api-reference/api-methods/rules-delete/?language=ruby)
295
+ - [Clear all rules](https://algolia.com/doc/api-reference/api-methods/rules-clear/?language=ruby)
296
+ - [Search for rules](https://algolia.com/doc/api-reference/api-methods/rules-search/?language=ruby)
297
+ - [Export rules](https://algolia.com/doc/api-reference/api-methods/rules-export/?language=ruby)
298
+
299
+
300
+
284
301
 
285
302
 
286
303
 
@@ -288,7 +305,8 @@ search.start();
288
305
 
289
306
  ### Advanced
290
307
 
291
- - [Get latest logs](https://algolia.com/doc/api-reference/api-methods/get-logs/?language=ruby)
308
+ - [Get latest logs](https://algolia.com/doc/api-reference/api-methods/get-logs/?language=ruby)
309
+
292
310
 
293
311
 
294
312
 
@@ -298,4 +316,3 @@ search.start();
298
316
  - **Need help**? Ask a question to the [Algolia Community](https://discourse.algolia.com/) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/algolia).
299
317
  - **Found a bug?** You can open a [GitHub issue](https://github.com/algolia/algoliasearch-client-ruby/issues).
300
318
 
301
-
@@ -4,15 +4,28 @@ require 'date'
4
4
  require File.join(File.dirname(__FILE__), 'lib', 'algolia', 'version')
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "algoliasearch"
8
- s.version = Algolia::VERSION
7
+ s.name = "algoliasearch"
8
+ s.version = Algolia::VERSION
9
+ s.authors = ["Algolia"]
10
+ s.email = "contact@algolia.com"
9
11
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.require_paths = ["lib"]
12
- s.authors = ["Algolia"]
13
- s.date = Date.today
12
+ s.date = Date.today
13
+ s.licenses = ["MIT"]
14
+ s.summary = "A simple Ruby client for the algolia.com REST API"
14
15
  s.description = "A simple Ruby client for the algolia.com REST API"
15
- s.email = "contact@algolia.com"
16
+ s.homepage = "https://github.com/algolia/algoliasearch-client-ruby"
17
+
18
+ s.metadata = {
19
+ "bug_tracker_uri" => "https://github.com/algolia/algoliasearch-client-ruby/issues",
20
+ "changelog_uri" => "https://github.com/algolia/algoliasearch-client-ruby/blob/master/ChangeLog",
21
+ "documentation_uri" => "http://www.rubydoc.info/gems/algoliasearch",
22
+ "homepage_uri" => "https://www.algolia.com/doc/api-client/ruby/getting-started/",
23
+ "source_code_uri" => "https://github.com/algolia/algoliasearch-client-ruby"
24
+ }
25
+
26
+ s.require_paths = ["lib"]
27
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
28
+
16
29
  s.extra_rdoc_files = [
17
30
  "ChangeLog",
18
31
  "LICENSE.txt",
@@ -42,26 +55,22 @@ Gem::Specification.new do |s|
42
55
  "spec/spec_helper.rb",
43
56
  "spec/stub_spec.rb"
44
57
  ]
45
- s.homepage = "http://github.com/algolia/algoliasearch-client-ruby"
46
- s.licenses = ["MIT"]
47
- s.rubygems_version = "2.2.1"
48
- s.summary = "A simple Ruby client for the algolia.com REST API"
49
58
 
50
59
  if s.respond_to? :specification_version then
51
60
  s.specification_version = 4
52
61
 
53
62
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
- s.add_runtime_dependency(%q<httpclient>, ["~> 2.8.3"])
55
- s.add_runtime_dependency(%q<json>, [">= 1.5.1"])
56
- s.add_development_dependency "travis"
57
- s.add_development_dependency "rake"
58
- s.add_development_dependency "rdoc"
63
+ s.add_runtime_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
64
+ s.add_runtime_dependency 'json', '>= 1.5.1'
65
+ s.add_development_dependency 'travis', '~> 0'
66
+ s.add_development_dependency 'rake', '~> 0'
67
+ s.add_development_dependency 'rdoc', '~> 0'
59
68
  else
60
- s.add_dependency(%q<httpclient>, ["~> 2.8.3"])
61
- s.add_dependency(%q<json>, [">= 1.5.1"])
69
+ s.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
70
+ s.add_dependency 'json', '>= 1.5.1'
62
71
  end
63
72
  else
64
- s.add_dependency(%q<httpclient>, ["~> 2.8.3"])
65
- s.add_dependency(%q<json>, [">= 1.5.1"])
73
+ s.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
74
+ s.add_dependency 'json', '>= 1.5.1'
66
75
  end
67
76
  end
@@ -134,7 +134,7 @@ module Algolia
134
134
 
135
135
  #
136
136
  # List all existing indexes
137
- # return an Answer object with answer in the form
137
+ # return an Answer object with answer in the form
138
138
  # {"items": [{ "name": "contacts", "createdAt": "2013-01-18T15:33:13.556Z"},
139
139
  # {"name": "notes", "createdAt": "2013-01-18T15:33:13.556Z"}]}
140
140
  #
@@ -194,15 +194,19 @@ module Algolia
194
194
  end
195
195
 
196
196
  # Delete an index
197
+ # @param name the name of the index to delete
198
+ # @param request_options contains extra parameters to send with your query
197
199
  #
198
- def delete_index(name)
199
- init_index(name).delete
200
+ def delete_index(name, request_options = {})
201
+ init_index(name).delete(request_options)
200
202
  end
201
203
 
202
204
  # Delete an index and wait until the deletion has been processed.
205
+ # @param name the name of the index to delete
206
+ # @param request_options contains extra parameters to send with your query
203
207
  #
204
- def delete_index!(name)
205
- init_index(name).delete!
208
+ def delete_index!(name, request_options = {})
209
+ init_index(name).delete!(request_options)
206
210
  end
207
211
 
208
212
  #
@@ -579,7 +583,7 @@ module Algolia
579
583
 
580
584
  #
581
585
  # List all existing indexes
582
- # return an Answer object with answer in the form
586
+ # return an Answer object with answer in the form
583
587
  # {"items": [{ "name": "contacts", "createdAt": "2013-01-18T15:33:13.556Z"},
584
588
  # {"name": "notes", "createdAt": "2013-01-18T15:33:13.556Z"}]}
585
589
  #
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = "1.19.1"
2
+ VERSION = "1.19.2"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -6,7 +6,7 @@ require 'base64'
6
6
  def safe_index_name(name)
7
7
  return name if ENV['TRAVIS'].to_s != "true"
8
8
  id = ENV['TRAVIS_JOB_NUMBER']
9
- "#{name}_travis-#{id}"
9
+ "TRAVIS_RUBY_#{name}-#{id}"
10
10
  end
11
11
 
12
12
  def is_include(array, attr, value)
@@ -18,6 +18,150 @@ def is_include(array, attr, value)
18
18
  return false
19
19
  end
20
20
 
21
+ describe 'API keys', :maintainers_only => true do
22
+ before(:all) do
23
+ @index = Algolia::Index.new(safe_index_name("àlgol?a"))
24
+ @index.delete_index rescue "not fatal"
25
+ end
26
+
27
+ after(:all) do
28
+ @index.delete_index rescue "not fatal"
29
+ end
30
+
31
+ def wait_key(index, key, &block)
32
+ 1.upto(60) do # do not wait too long
33
+ begin
34
+ k = index.get_api_key(key)
35
+ if block_given?
36
+ return if yield k
37
+ # not found
38
+ sleep 1
39
+ next
40
+ end
41
+ return
42
+ rescue
43
+ # not found
44
+ sleep 1
45
+ end
46
+ end
47
+ end
48
+
49
+ def wait_key_missing(index, key)
50
+ 1.upto(60) do # do not wait too long
51
+ begin
52
+ k = index.get_api_key(key)
53
+ sleep 1
54
+ rescue
55
+ # not found
56
+ return
57
+ end
58
+ end
59
+ end
60
+
61
+ def wait_global_key(key, &block)
62
+ 1.upto(60) do # do not wait too long
63
+ begin
64
+ k = Algolia.get_api_key(key)
65
+ if block_given?
66
+ return if yield k
67
+ # not found
68
+ sleep 1
69
+ next
70
+ end
71
+ return
72
+ rescue
73
+ # not found
74
+ sleep 1
75
+ end
76
+ end
77
+ end
78
+
79
+ def wait_global_key_missing(key)
80
+ 1.upto(60) do # do not wait too long
81
+ begin
82
+ k = Algolia.get_api_key(key)
83
+ sleep 1
84
+ rescue
85
+ # not found
86
+ return
87
+ end
88
+ end
89
+ end
90
+
91
+ it "should test index keys" do
92
+ @index.set_settings!({}) # ensure the index exists
93
+ resIndex = @index.list_api_keys
94
+ newIndexKey = @index.add_api_key(['search'])
95
+ newIndexKey['key'].should_not eq("")
96
+ wait_key(@index, newIndexKey['key'])
97
+ resIndexAfter = @index.list_api_keys
98
+ is_include(resIndex['keys'], 'value', newIndexKey['key']).should eq(false)
99
+ is_include(resIndexAfter['keys'], 'value', newIndexKey['key']).should eq(true)
100
+ indexKey = @index.get_api_key(newIndexKey['key'])
101
+ indexKey['acl'][0].should eq('search')
102
+ @index.update_api_key(newIndexKey['key'], ['addObject'])
103
+ wait_key(@index, newIndexKey['key']) do |key|
104
+ key['acl'] == ['addObject']
105
+ end
106
+ indexKey = @index.get_api_key(newIndexKey['key'])
107
+ indexKey['acl'][0].should eq('addObject')
108
+ @index.delete_api_key(newIndexKey['key'])
109
+ wait_key_missing(@index, newIndexKey['key'])
110
+ resIndexEnd = @index.list_api_keys
111
+ is_include(resIndexEnd['keys'], 'value', newIndexKey['key']).should eq(false)
112
+ end
113
+
114
+ it "should test global keys" do
115
+ res = Algolia.list_api_keys
116
+ newKey = Algolia.add_api_key(['search'])
117
+ newKey['key'].should_not eq("")
118
+ wait_global_key(newKey['key'])
119
+ resAfter = Algolia.list_api_keys
120
+ is_include(res['keys'], 'value', newKey['key']).should eq(false)
121
+ is_include(resAfter['keys'], 'value', newKey['key']).should eq(true)
122
+ key = Algolia.get_api_key(newKey['key'])
123
+ key['acl'][0].should eq('search')
124
+ Algolia.update_api_key(newKey['key'], ['addObject'])
125
+ wait_global_key(newKey['key']) do |key|
126
+ key['acl'] == ['addObject']
127
+ end
128
+ key = Algolia.get_api_key(newKey['key'])
129
+ key['acl'][0].should eq('addObject')
130
+ Algolia.delete_api_key(newKey['key'])
131
+ wait_global_key_missing(newKey['key'])
132
+ resEnd = Algolia.list_api_keys
133
+ is_include(resEnd['keys'], 'value', newKey['key']).should eq(false)
134
+ end
135
+
136
+ it "Check add keys" do
137
+ newIndexKey = @index.add_api_key(['search'])
138
+ newIndexKey.should have_key('key')
139
+ newIndexKey['key'].should be_a(String)
140
+ newIndexKey.should have_key('createdAt')
141
+ newIndexKey['createdAt'].should be_a(String)
142
+ sleep 5 # no task ID here
143
+ resIndex = @index.list_api_keys
144
+ resIndex.should have_key('keys')
145
+ resIndex['keys'].should be_a(Array)
146
+ resIndex['keys'][0].should have_key('value')
147
+ resIndex['keys'][0]['value'].should be_a(String)
148
+ resIndex['keys'][0].should have_key('acl')
149
+ resIndex['keys'][0]['acl'].should be_a(Array)
150
+ resIndex['keys'][0].should have_key('validity')
151
+ resIndex['keys'][0]['validity'].should be_a(Integer)
152
+ indexKey = @index.get_api_key(newIndexKey['key'])
153
+ indexKey.should have_key('value')
154
+ indexKey['value'].should be_a(String)
155
+ indexKey.should have_key('acl')
156
+ indexKey['acl'].should be_a(Array)
157
+ indexKey.should have_key('validity')
158
+ indexKey['validity'].should be_a(Integer)
159
+ task = @index.delete_api_key(newIndexKey['key'])
160
+ task.should have_key('deletedAt')
161
+ task['deletedAt'].should be_a(String)
162
+ end
163
+ end
164
+
21
165
  describe 'Client' do
22
166
  before(:all) do
23
167
  @index = Algolia::Index.new(safe_index_name("àlgol?a"))
@@ -452,111 +596,6 @@ describe 'Client' do
452
596
  res['facets']['g']['g2'].should be_nil
453
597
  end
454
598
 
455
- def wait_key(index, key, &block)
456
- 1.upto(60) do # do not wait too long
457
- begin
458
- k = index.get_api_key(key)
459
- if block_given?
460
- return if yield k
461
- # not found
462
- sleep 1
463
- next
464
- end
465
- return
466
- rescue
467
- # not found
468
- sleep 1
469
- end
470
- end
471
- end
472
-
473
- def wait_key_missing(index, key)
474
- 1.upto(60) do # do not wait too long
475
- begin
476
- k = index.get_api_key(key)
477
- sleep 1
478
- rescue
479
- # not found
480
- return
481
- end
482
- end
483
- end
484
-
485
- def wait_global_key(key, &block)
486
- 1.upto(60) do # do not wait too long
487
- begin
488
- k = Algolia.get_api_key(key)
489
- if block_given?
490
- return if yield k
491
- # not found
492
- sleep 1
493
- next
494
- end
495
- return
496
- rescue
497
- # not found
498
- sleep 1
499
- end
500
- end
501
- end
502
-
503
- def wait_global_key_missing(key)
504
- 1.upto(60) do # do not wait too long
505
- begin
506
- k = Algolia.get_api_key(key)
507
- sleep 1
508
- rescue
509
- # not found
510
- return
511
- end
512
- end
513
- end
514
-
515
- it "should test index keys" do
516
- @index.set_settings!({}) # ensure the index exists
517
- resIndex = @index.list_api_keys
518
- newIndexKey = @index.add_api_key(['search'])
519
- newIndexKey['key'].should_not eq("")
520
- wait_key(@index, newIndexKey['key'])
521
- resIndexAfter = @index.list_api_keys
522
- is_include(resIndex['keys'], 'value', newIndexKey['key']).should eq(false)
523
- is_include(resIndexAfter['keys'], 'value', newIndexKey['key']).should eq(true)
524
- indexKey = @index.get_api_key(newIndexKey['key'])
525
- indexKey['acl'][0].should eq('search')
526
- @index.update_api_key(newIndexKey['key'], ['addObject'])
527
- wait_key(@index, newIndexKey['key']) do |key|
528
- key['acl'] == ['addObject']
529
- end
530
- indexKey = @index.get_api_key(newIndexKey['key'])
531
- indexKey['acl'][0].should eq('addObject')
532
- @index.delete_api_key(newIndexKey['key'])
533
- wait_key_missing(@index, newIndexKey['key'])
534
- resIndexEnd = @index.list_api_keys
535
- is_include(resIndexEnd['keys'], 'value', newIndexKey['key']).should eq(false)
536
- end
537
-
538
- it "should test global keys" do
539
- res = Algolia.list_api_keys
540
- newKey = Algolia.add_api_key(['search'])
541
- newKey['key'].should_not eq("")
542
- wait_global_key(newKey['key'])
543
- resAfter = Algolia.list_api_keys
544
- is_include(res['keys'], 'value', newKey['key']).should eq(false)
545
- is_include(resAfter['keys'], 'value', newKey['key']).should eq(true)
546
- key = Algolia.get_api_key(newKey['key'])
547
- key['acl'][0].should eq('search')
548
- Algolia.update_api_key(newKey['key'], ['addObject'])
549
- wait_global_key(newKey['key']) do |key|
550
- key['acl'] == ['addObject']
551
- end
552
- key = Algolia.get_api_key(newKey['key'])
553
- key['acl'][0].should eq('addObject')
554
- Algolia.delete_api_key(newKey['key'])
555
- wait_global_key_missing(newKey['key'])
556
- resEnd = Algolia.list_api_keys
557
- is_include(resEnd['keys'], 'value', newKey['key']).should eq(false)
558
- end
559
-
560
599
  it "should handle slash in objectId" do
561
600
  @index.clear_index!()
562
601
  @index.add_object!({:firstname => "Robert", :objectID => "A/go/?a"})
@@ -752,34 +791,6 @@ describe 'Client' do
752
791
  status.should be_a(String)
753
792
  end
754
793
 
755
- it "Check add keys" do
756
- newIndexKey = @index.add_api_key(['search'])
757
- newIndexKey.should have_key('key')
758
- newIndexKey['key'].should be_a(String)
759
- newIndexKey.should have_key('createdAt')
760
- newIndexKey['createdAt'].should be_a(String)
761
- sleep 5 # no task ID here
762
- resIndex = @index.list_api_keys
763
- resIndex.should have_key('keys')
764
- resIndex['keys'].should be_a(Array)
765
- resIndex['keys'][0].should have_key('value')
766
- resIndex['keys'][0]['value'].should be_a(String)
767
- resIndex['keys'][0].should have_key('acl')
768
- resIndex['keys'][0]['acl'].should be_a(Array)
769
- resIndex['keys'][0].should have_key('validity')
770
- resIndex['keys'][0]['validity'].should be_a(Integer)
771
- indexKey = @index.get_api_key(newIndexKey['key'])
772
- indexKey.should have_key('value')
773
- indexKey['value'].should be_a(String)
774
- indexKey.should have_key('acl')
775
- indexKey['acl'].should be_a(Array)
776
- indexKey.should have_key('validity')
777
- indexKey['validity'].should be_a(Integer)
778
- task = @index.delete_api_key(newIndexKey['key'])
779
- task.should have_key('deletedAt')
780
- task['deletedAt'].should be_a(String)
781
- end
782
-
783
794
  it 'Check attributes log : ' do
784
795
  logs = Algolia.get_logs()
785
796
  logs.should have_key('logs')
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,10 @@
1
1
 
2
2
  if ENV['COVERAGE']
3
- require 'simplecov'
4
- SimpleCov.start
3
+ require 'simplecov'
4
+ SimpleCov.start
5
5
  end
6
6
 
7
- if ENV['TRAVIS'] && Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "ruby"
7
+ if ENV['TRAVIS'] && Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
8
8
  require 'coveralls'
9
9
  Coveralls.wear!
10
10
  end
@@ -18,15 +18,20 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
18
 
19
19
  require 'algoliasearch'
20
20
  require 'rspec'
21
-
22
21
  require 'webmock/rspec'
23
- WebMock.disable!
24
-
25
22
  require 'algolia/webmock'
26
23
 
27
- raise "missing ALGOLIA_APPLICATION_ID or ALGOLIA_API_KEY environment variables" if ENV['ALGOLIA_APPLICATION_ID'].nil? || ENV['ALGOLIA_API_KEY'].nil?
24
+ raise 'missing ALGOLIA_APPLICATION_ID or ALGOLIA_API_KEY environment variables' if ENV['ALGOLIA_APPLICATION_ID'].nil? || ENV['ALGOLIA_API_KEY'].nil?
28
25
  Algolia.init :application_id => ENV['ALGOLIA_APPLICATION_ID'], :api_key => ENV['ALGOLIA_API_KEY']
29
26
 
30
- RSpec.configure do |c|
31
- c.mock_with :rspec
27
+ RSpec.configure do |config|
28
+ config.mock_with :rspec
29
+
30
+ config.before(:suite) do
31
+ WebMock.disable!
32
+ end
33
+
34
+ config.after(:suite) do
35
+ WebMock.disable!
36
+ end
32
37
  end
metadata CHANGED
@@ -1,20 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.1
4
+ version: 1.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.8'
20
+ - - ">="
18
21
  - !ruby/object:Gem::Version
19
22
  version: 2.8.3
20
23
  type: :runtime
@@ -22,6 +25,9 @@ dependencies:
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.8'
30
+ - - ">="
25
31
  - !ruby/object:Gem::Version
26
32
  version: 2.8.3
27
33
  - !ruby/object:Gem::Dependency
@@ -42,42 +48,42 @@ dependencies:
42
48
  name: travis
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '0'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: rake
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - ">="
65
+ - - "~>"
60
66
  - !ruby/object:Gem::Version
61
67
  version: '0'
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - ">="
72
+ - - "~>"
67
73
  - !ruby/object:Gem::Version
68
74
  version: '0'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rdoc
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - ">="
79
+ - - "~>"
74
80
  - !ruby/object:Gem::Version
75
81
  version: '0'
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
- - - ">="
86
+ - - "~>"
81
87
  - !ruby/object:Gem::Version
82
88
  version: '0'
83
89
  description: A simple Ruby client for the algolia.com REST API
@@ -111,10 +117,15 @@ files:
111
117
  - spec/mock_spec.rb
112
118
  - spec/spec_helper.rb
113
119
  - spec/stub_spec.rb
114
- homepage: http://github.com/algolia/algoliasearch-client-ruby
120
+ homepage: https://github.com/algolia/algoliasearch-client-ruby
115
121
  licenses:
116
122
  - MIT
117
- metadata: {}
123
+ metadata:
124
+ bug_tracker_uri: https://github.com/algolia/algoliasearch-client-ruby/issues
125
+ changelog_uri: https://github.com/algolia/algoliasearch-client-ruby/blob/master/ChangeLog
126
+ documentation_uri: http://www.rubydoc.info/gems/algoliasearch
127
+ homepage_uri: https://www.algolia.com/doc/api-client/ruby/getting-started/
128
+ source_code_uri: https://github.com/algolia/algoliasearch-client-ruby
118
129
  post_install_message:
119
130
  rdoc_options: []
120
131
  require_paths:
@@ -131,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
142
  version: '0'
132
143
  requirements: []
133
144
  rubyforge_project:
134
- rubygems_version: 2.6.13
145
+ rubygems_version: 2.7.6
135
146
  signing_key:
136
147
  specification_version: 4
137
148
  summary: A simple Ruby client for the algolia.com REST API