algolia 2.0.0.pre.beta.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47d18253040f91e77f82a815e90b4064c88aac2ddbacbe4c26b1dea81304d847
4
- data.tar.gz: 530b601d76e6de0b4f252dc13bcce01f7446428f839cd22fb4b286a1b5a17f73
3
+ metadata.gz: 555e432d41a84d3031f58dc7c74acf5297df48fe693fadf977c6b15547a82d6b
4
+ data.tar.gz: a3fbbc9ba6552b0b432a20e34cd5cf7a311f339c2df7f7a3c549ced84f409ba0
5
5
  SHA512:
6
- metadata.gz: 04c63a1fb49fcd66817e0b43f66c16b3cbe8bd044ca513409047f8709ab8cc757deb30cedaeafcddf831f98179efa9c21fdcbf4bb09a1641b9b5b7aa96d6fc8c
7
- data.tar.gz: e552093cc4ab5827c8ab87e448856bfdbd68f113b8e321e928e66ceb03f8ecf96531aad902d256a6372336c9efeedd166e85165d63a0c83f0795de942a0b4eb7
6
+ metadata.gz: 757d57c2723f3f036bfb7faa38615fd751311e99b0a3f5e1b3c13087c53a9010af88c99a5412e31bb3e6d3cdb9201478d7100c71080b3fe948004170a870f875
7
+ data.tar.gz: ede51228b6bc2498b65434102f8b25b17d7db74ae74cd2b50a1ec7184f42692e4b24d94de8c621ec91a8192c924e71ac1067bfdde038a03936407f12147b6175
data/.gitignore CHANGED
@@ -35,4 +35,5 @@ pkg
35
35
  Gemfile.lock
36
36
  spec/integration_spec_conf.rb
37
37
  data.sqlite3
38
+
38
39
  debug.log
@@ -0,0 +1,7 @@
1
+ # ChangeLog
2
+
3
+ ## Unreleased
4
+
5
+ ## [2.0.0](https://github.com/algolia/algoliasearch-client-ruby/releases/tag/2.0.0) (2020-10-27)
6
+
7
+ * Initial release of v2
data/README.md CHANGED
@@ -6,9 +6,9 @@
6
6
  <h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your Ruby project</h4>
7
7
 
8
8
  <p align="center">
9
- <a href="https://circleci.com/gh/algolia/algoliasearch-client-ruby/tree/release%2Fv2"><img src="https://circleci.com/gh/algolia/algoliasearch-client-ruby/tree/release%2Fv2.svg?style=shield" alt="CircleCI" /></a>
10
- <a href="https://rubygems.org/gems/algoliasearch"><img src="https://badge.fury.io/rb/algoliasearch.svg" alt="Gem Version"></a>
11
- <a href="https://rubygems.org/gems/algoliasearch"><img src="https://img.shields.io/badge/licence-MIT-blue.svg" alt="License"></a>
9
+ <a href="https://circleci.com/gh/algolia/algoliasearch-client-ruby"><img src="https://circleci.com/gh/algolia/algoliasearch-client-ruby/tree/release%2Fv2.svg?style=shield" alt="CircleCI" /></a>
10
+ <a href="https://rubygems.org/gems/algolia"><img src="https://badge.fury.io/rb/algoliasearch.svg" alt="Gem Version"></a>
11
+ <a href="https://rubygems.org/gems/algolia"><img src="https://img.shields.io/badge/licence-MIT-blue.svg" alt="License"></a>
12
12
  </p>
13
13
  </p>
14
14
 
@@ -18,39 +18,47 @@
18
18
  <a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
19
19
  <a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
20
20
  <a href="https://github.com/algolia/algoliasearch-client-ruby/issues" target="_blank">Report a bug</a> •
21
+ <a href="https://www.algolia.com/doc/api-client/troubleshooting/faq/ruby/" target="_blank">FAQ</a> •
21
22
  <a href="https://www.algolia.com/support" target="_blank">Support</a>
22
23
  </p>
23
24
 
24
25
  ## ✨ Features
25
26
 
26
27
  - Thin & minimal low-level HTTP client to interact with Algolia's API
27
- - Supports Ruby `^1.8.7`.
28
+ - Supports Ruby `^2.2`.
28
29
 
29
30
  ## 💡 Getting Started
30
31
 
31
32
  First, install Algolia Ruby API Client via the [RubyGems](https://rubygems.org/) package manager:
32
33
  ```bash
33
- gem install algoliasearch
34
+ gem install algolia
34
35
  ```
35
36
 
36
37
  Then, create objects on your index:
37
38
 
38
39
 
39
40
  ```ruby
40
- Algolia.init(application_id: 'YourApplicationID',
41
- api_key: 'YourAPIKey')
42
- index = Algolia::Index.new('your_index_name')
41
+ client = Algolia::Search::Client.create('YourApplicationID', 'YourAPIKey')
42
+ index = client.init_index('your_index_name')
43
43
 
44
- index.save_objects([objectID: 1, name: 'Foo'])
44
+ index.save_objects([objectID: 1, name: 'Foo'])
45
45
  ```
46
46
 
47
47
  Finally, you may begin searching a object using the `search` method:
48
48
  ```ruby
49
- objects = index.search('Fo')
49
+ objects = index.search('Foo')
50
50
  ```
51
51
 
52
52
  For full documentation, visit the **[Algolia Ruby API Client](https://www.algolia.com/doc/api-client/getting-started/install/ruby/)**.
53
53
 
54
+ ## ❓ Troubleshooting
55
+
56
+ Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/ruby/) where you will find answers for the most common issues and gotchas with the client.
57
+
58
+ ## Upgrade from V1 to V2
59
+
60
+ If you were using the v1 and wish to update to v2, please follow our [Upgrade Guide](upgrade_guide.md)
61
+
54
62
  ## 📄 License
55
63
 
56
64
  Algolia Ruby API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).
@@ -0,0 +1,3 @@
1
+ ## Reporting a Vulnerability
2
+
3
+ To report a security vulnerability, please use the [Algolia security email](security@algolia.com). Algolia will coordinate the fix and disclosure.
@@ -12,14 +12,14 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.date = Date.today
14
14
  spec.licenses = ['MIT']
15
- spec.summary = 'A simple Ruby client for the algolia.com REST API (alpha release)'
16
- spec.description = 'This is the alpha version of the upcoming v2 release of Algolia Client. Please keep on using the algoliasearch gem in the meantime.'
17
- spec.homepage = 'https://github.com/algolia/algoliasearch-client-ruby/tree/release/v2'
15
+ spec.summary = 'A simple Ruby client for the algolia.com REST API'
16
+ spec.description = 'A simple Ruby client for the algolia.com REST API'
17
+ spec.homepage = 'https://github.com/algolia/algoliasearch-client-ruby'
18
18
 
19
19
  spec.metadata = {
20
20
  'bug_tracker_uri' => 'https://github.com/algolia/algoliasearch-client-ruby/issues',
21
- 'documentation_uri' => 'http://www.rubydoc.info/gems/algolia',
22
- 'source_code_uri' => 'https://github.com/algolia/algoliasearch-client-ruby/tree/release/v2'
21
+ 'documentation_uri' => 'https://www.algolia.com/doc/api-client/getting-started/install/ruby',
22
+ 'source_code_uri' => 'https://github.com/algolia/algoliasearch-client-ruby'
23
23
  }
24
24
 
25
25
  # Specify which files should be added to the gem when it is released.
@@ -34,8 +34,6 @@ module Algolia
34
34
  @connect_timeout = opts[:connect_timeout] || Defaults::CONNECT_TIMEOUT
35
35
  @compression_type = opts[:compression_type] || Defaults::NONE_ENCODING
36
36
  @symbolize_keys = opts.has_key?(:symbolize_keys) ? opts[:symbolize_keys] : true
37
- # used to avoid BC break on Rails integration, should not be documented
38
- @use_latest_settings = opts.has_key?(:use_latest_settings) ? opts[:use_latest_settings] : true
39
37
  end
40
38
 
41
39
  def set_extra_header(key, value)
@@ -52,9 +52,7 @@ module Helpers
52
52
 
53
53
  # Support to convert old settings to their new names
54
54
  #
55
- def deserialize_settings(data, use_latest_settings, symbolize_keys)
56
- return data unless use_latest_settings
57
-
55
+ def deserialize_settings(data, symbolize_keys)
58
56
  settings = symbolize_hash(data)
59
57
  keys = {
60
58
  attributesToIndex: 'searchableAttributes',
@@ -976,7 +976,7 @@ module Algolia
976
976
  def get_settings(opts = {})
977
977
  response = @transporter.read(:GET, path_encode('/1/indexes/%s/settings', @name) + handle_params({ getVersion: 2 }), {}, opts)
978
978
 
979
- deserialize_settings(response, @config.use_latest_settings, @config.symbolize_keys)
979
+ deserialize_settings(response, @config.symbolize_keys)
980
980
  end
981
981
 
982
982
  # Update some index settings. Only specified settings are overridden
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = '2.0.0-beta.3'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
@@ -18,21 +18,10 @@ class HelpersTest
18
18
  replicas: %w(index1 index2)
19
19
  }
20
20
 
21
- deserialized_settings = deserialize_settings(old_settings, true, true)
21
+ deserialized_settings = deserialize_settings(old_settings, true)
22
22
  assert_equal new_settings, deserialized_settings
23
23
  end
24
24
 
25
- def test_deserialize_settings_with_old_settings
26
- old_settings = {
27
- attributesToIndex: %w(attr1 attr2),
28
- numericAttributesToIndex: %w(attr1 attr2),
29
- slaves: %w(index1 index2)
30
- }
31
-
32
- deserialized_settings = deserialize_settings(old_settings, false, true)
33
- assert_equal old_settings, deserialized_settings
34
- end
35
-
36
25
  def test_deserialize_settings_with_string
37
26
  old_settings = {
38
27
  'attributesToIndex' => %w(attr1 attr2),
@@ -46,7 +35,7 @@ class HelpersTest
46
35
  'replicas' => %w(index1 index2)
47
36
  }
48
37
 
49
- deserialized_settings = deserialize_settings(old_settings, true, false)
38
+ deserialized_settings = deserialize_settings(old_settings, false)
50
39
  assert_equal new_settings, deserialized_settings
51
40
  end
52
41
  end
@@ -229,7 +229,7 @@ client.search_user_ids('query', {clusterName: 'my-cluster', hitPerPage: 12, page
229
229
  #### `pending_mappings`
230
230
  New method to check the status of your clusters' migration or user creation.
231
231
  ```ruby
232
- client.pending_mapping?({ retrieveMappings: true })
232
+ client.pending_mappings?({ retrieveMappings: true })
233
233
  ```
234
234
 
235
235
  #### `get_logs`
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.beta.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-21 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -178,8 +178,7 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- description: This is the alpha version of the upcoming v2 release of Algolia Client.
182
- Please keep on using the algoliasearch gem in the meantime.
181
+ description: A simple Ruby client for the algolia.com REST API
183
182
  email:
184
183
  - support@algolia.com
185
184
  executables: []
@@ -192,11 +191,13 @@ files:
192
191
  - ".gitignore"
193
192
  - ".rubocop.yml"
194
193
  - ".rubocop_todo.yml"
194
+ - CHANGELOG.md
195
195
  - CODE_OF_CONDUCT.md
196
196
  - Gemfile
197
197
  - LICENSE
198
198
  - README.md
199
199
  - Rakefile
200
+ - SECURITY.md
200
201
  - Steepfile
201
202
  - algolia.gemspec
202
203
  - bin/console
@@ -271,13 +272,13 @@ files:
271
272
  - test/algolia/unit/user_agent_test.rb
272
273
  - test/test_helper.rb
273
274
  - upgrade_guide.md
274
- homepage: https://github.com/algolia/algoliasearch-client-ruby/tree/release/v2
275
+ homepage: https://github.com/algolia/algoliasearch-client-ruby
275
276
  licenses:
276
277
  - MIT
277
278
  metadata:
278
279
  bug_tracker_uri: https://github.com/algolia/algoliasearch-client-ruby/issues
279
- documentation_uri: http://www.rubydoc.info/gems/algolia
280
- source_code_uri: https://github.com/algolia/algoliasearch-client-ruby/tree/release/v2
280
+ documentation_uri: https://www.algolia.com/doc/api-client/getting-started/install/ruby
281
+ source_code_uri: https://github.com/algolia/algoliasearch-client-ruby
281
282
  post_install_message:
282
283
  rdoc_options: []
283
284
  require_paths:
@@ -289,14 +290,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
289
290
  version: '0'
290
291
  required_rubygems_version: !ruby/object:Gem::Requirement
291
292
  requirements:
292
- - - ">"
293
+ - - ">="
293
294
  - !ruby/object:Gem::Version
294
- version: 1.3.1
295
+ version: '0'
295
296
  requirements: []
296
297
  rubygems_version: 3.0.3
297
298
  signing_key:
298
299
  specification_version: 4
299
- summary: A simple Ruby client for the algolia.com REST API (alpha release)
300
+ summary: A simple Ruby client for the algolia.com REST API
300
301
  test_files:
301
302
  - test/algolia/integration/account_client_test.rb
302
303
  - test/algolia/integration/analytics_client_test.rb