typesense 0.5.3 → 0.7.0.pre1

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: bcf637e89f09c24ce984420370602cc27326e71a4fc813b2b3c530ab6647c91d
4
- data.tar.gz: 3439e7c8a0eaed0ffeeaf9a2b3c695927251f3b38741181023d581d0813fe9ba
3
+ metadata.gz: 3803dbc3cd03bcd1fe38c1d677f69154e8e96440c5854fa0ed55ed96a391f861
4
+ data.tar.gz: 18879ab944d054d7ae1bbdfedcf12a6df1aaf6afe1ff46c4cbee3689368ebdc4
5
5
  SHA512:
6
- metadata.gz: 002cacde4237f98f06bb1d291eb37b984c394d37dfa544c8e58c723b12ff92813599574acf1207df1d9b539622a28f72a4cd975edee3254f0def13d935684fd2
7
- data.tar.gz: 0343b17045c714e25091537dc319ae00145d151f8fe30b216deae1170d3b7f24bf9a6003090ee0b9dff8e2adae406a2c723e07a97ee230d16b365ed574601204
6
+ metadata.gz: bce2e1a2749cfbb67093ac42b41cd5c5c940fde602f9e7f30974396ba182fb61e3352d634be4364a02772e86a4d66b9e4c89d6a07923f0ec0b8d256b40918952
7
+ data.tar.gz: c0197e8c8f81c655b41dca0be24bfaaf05922774ca327865a46c4f9fdf4512d9e53b60bbff340e211b7c7d683e2434ff1e7a944c2219db8b8dcbeee3c96dbe0a
@@ -1,34 +1,39 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require: rubocop-rspec
4
-
5
1
  AllCops:
6
- TargetRubyVersion: "2.4"
7
2
  NewCops: enable
8
3
 
9
- Metrics/BlockLength:
10
- Exclude:
11
- - 'spec/**/*'
12
- - 'Gemfile'
13
- - 'typesense.gemspec'
14
-
15
4
  Style/Documentation:
16
5
  Enabled: false
17
6
 
18
- RSpec/ExampleLength:
7
+ Metrics/AbcSize:
19
8
  Enabled: false
20
9
 
21
- Metrics/MethodLength:
10
+ Metrics/CyclomaticComplexity:
22
11
  Enabled: false
23
12
 
24
- Metrics/AbcSize:
13
+ Metrics/PerceivedComplexity:
25
14
  Enabled: false
26
15
 
27
16
  Metrics/ClassLength:
28
17
  Enabled: false
29
18
 
30
- Metrics/CyclomaticComplexity:
19
+ Metrics/ParameterLists:
31
20
  Enabled: false
32
21
 
33
- Metrics/PerceivedComplexity:
22
+ Metrics/MethodLength:
23
+ Enabled: false
24
+
25
+ Metrics/BlockLength:
34
26
  Enabled: false
27
+
28
+ Metrics/BlockNesting:
29
+ Enabled: false
30
+
31
+ Style/FrozenStringLiteralComment:
32
+ EnforcedStyle: always_true
33
+
34
+ Layout/LineLength:
35
+ Max: 300
36
+
37
+ Lint/SuppressedException:
38
+ Exclude:
39
+ - examples/**
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # A sample Guardfile
4
+ # More info at https://github.com/guard/guard#readme
5
+
6
+ ## Uncomment and set this to only include directories you want to watch
7
+ # directories %w(app lib config test spec features) \
8
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
9
+
10
+ ## Note: if you are using the `directories` clause above and you are not
11
+ ## watching the project directory ('.'), then you will want to move
12
+ ## the Guardfile to a watched dir and symlink it back, e.g.
13
+ #
14
+ # $ mkdir config
15
+ # $ mv Guardfile config/
16
+ # $ ln -s config/Guardfile .
17
+ #
18
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
+
20
+ guard :rubocop, cli: '-a' do
21
+ watch(/.+\.rb$/)
22
+ watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
23
+ end
data/README.md CHANGED
@@ -25,7 +25,7 @@ Or install it yourself as:
25
25
 
26
26
  You'll find detailed documentation here: [https://typesense.org/api/](https://typesense.org/api/)
27
27
 
28
- Here are some examples that show you how the Ruby client works: [examples](examples)
28
+ Here are some examples with inline comments that walk you through how to use the Ruby client: [examples](examples)
29
29
 
30
30
  Tests are also a good place to know how the the library works internally: [spec](spec)
31
31
 
@@ -33,6 +33,7 @@ Tests are also a good place to know how the the library works internally: [spec]
33
33
 
34
34
  | Typesense Server | typesense-ruby |
35
35
  |------------------|----------------|
36
+ | \>= v0.15.0 | \>= v0.7.0 |
36
37
  | \>= v0.12.1 | \>= v0.5.0 |
37
38
  | \>= v0.12.0 | \>= v0.4.0 |
38
39
  | <= v0.11 | <= v0.3.0 |
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative '../lib/typesense'
4
4
  require 'awesome_print'
5
+ require 'logger'
5
6
 
6
7
  AwesomePrint.defaults = {
7
8
  indent: -2
@@ -62,6 +63,6 @@ AwesomePrint.defaults = {
62
63
  healthcheck_interval_seconds: 1,
63
64
  retry_interval_seconds: 0.01,
64
65
  connection_timeout_seconds: 10,
65
- logger: Logger.new(STDOUT),
66
+ logger: Logger.new($stdout),
66
67
  log_level: Logger::DEBUG
67
68
  )
@@ -210,17 +210,17 @@ documents = [
210
210
  ]
211
211
  ap @typesense.collections['companies'].documents.create_many(documents)
212
212
 
213
+ ## If you already have documents in JSONL format, you can also use #import instead, to avoid the JSON parsing overhead:
214
+ # @typesense.collections['companies'].documents.import(documents_in_jsonl_format)
215
+
213
216
  ##
214
217
  # Export all documents in a collection in JSON Lines format
215
- # We use JSON Lines format for performance reasons. You can choose to parse selected lines (elements in the array) as needed.
218
+ # We use JSON Lines format for performance reasons. You can choose to parse selected lines as needed, by splitting on \n.
216
219
  sleep 0.5 # Give Typesense cluster a few hundred ms to create the document on all nodes, before reading it right after (eventually consistent)
217
- array_of_json_strings = @typesense.collections['companies'].documents.export
218
- ap array_of_json_strings
220
+ jsonl_data = @typesense.collections['companies'].documents.export
221
+ ap jsonl_data
219
222
 
220
- # [
221
- # [0] "{\"company_name\":\"Stark Industries\",\"country\":\"USA\",\"id\":\"124\",\"num_employees\":5215}",
222
- # [1] "{\"company_name\":\"Acme Corp\",\"country\":\"France\",\"id\":\"125\",\"num_employees\":1002}"
223
- # ]
223
+ # "{\"company_name\":\"Stark Industries\",\"country\":\"USA\",\"id\":\"124\",\"num_employees\":5215}\n{\"company_name\":\"Acme Corp\",\"country\":\"France\",\"id\":\"125\",\"num_employees\":1002}"
224
224
 
225
225
  ##
226
226
  # Cleanup
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'httparty'
3
+ require 'typhoeus'
4
+ require 'oj'
4
5
 
5
6
  module Typesense
6
7
  class ApiCall
7
- include HTTParty
8
-
9
8
  API_KEY_HEADER_NAME = 'X-TYPESENSE-API-KEY'
10
9
 
11
10
  def initialize(configuration)
@@ -30,8 +29,8 @@ module Typesense
30
29
 
31
30
  perform_request :post,
32
31
  endpoint,
33
- body: body,
34
- headers: default_headers.merge(headers)
32
+ headers,
33
+ body: body
35
34
  end
36
35
 
37
36
  def put(endpoint, parameters = {})
@@ -39,8 +38,8 @@ module Typesense
39
38
 
40
39
  perform_request :put,
41
40
  endpoint,
42
- body: body,
43
- headers: default_headers.merge(headers)
41
+ headers,
42
+ body: body
44
43
  end
45
44
 
46
45
  def get(endpoint, parameters = {})
@@ -48,8 +47,8 @@ module Typesense
48
47
 
49
48
  perform_request :get,
50
49
  endpoint,
51
- query: query,
52
- headers: default_headers.merge(headers)
50
+ headers,
51
+ params: query
53
52
  end
54
53
 
55
54
  def delete(endpoint, parameters = {})
@@ -57,11 +56,11 @@ module Typesense
57
56
 
58
57
  perform_request :delete,
59
58
  endpoint,
60
- query: query,
61
- headers: default_headers.merge(headers)
59
+ headers,
60
+ params: query
62
61
  end
63
62
 
64
- def perform_request(method, endpoint, options = {})
63
+ def perform_request(method, endpoint, headers = {}, options = {})
65
64
  @configuration.validate!
66
65
  last_exception = nil
67
66
  @logger.debug "Performing #{method.to_s.upcase} request: #{endpoint}"
@@ -71,24 +70,30 @@ module Typesense
71
70
  @logger.debug "Attempting #{method.to_s.upcase} request Try ##{num_tries} to Node #{node[:index]}"
72
71
 
73
72
  begin
74
- response_object = self.class.send(method,
75
- uri_for(endpoint, node),
76
- default_options.merge(options))
77
- response_code = response_object.response.code.to_i
78
- set_node_healthcheck(node, is_healthy: true) if response_code >= 1 && response_code <= 499
79
-
80
- @logger.debug "Request to Node #{node[:index]} was successfully made (at the network layer). Response Code was #{response_code}."
73
+ response = Typhoeus::Request.new(uri_for(endpoint, node),
74
+ {
75
+ method: method,
76
+ headers: default_headers.merge(headers),
77
+ timeout: @connection_timeout_seconds
78
+ }.merge(options)).run
79
+ set_node_healthcheck(node, is_healthy: true) if response.code >= 1 && response.code <= 499
80
+
81
+ @logger.debug "Request to Node #{node[:index]} was successfully made (at the network layer). Response Code was #{response.code}."
82
+
83
+ parsed_response = if response.headers && (response.headers['content-type'] || '').include?('application/json')
84
+ Oj.load(response.body)
85
+ else
86
+ response.body
87
+ end
81
88
 
82
89
  # If response is 2xx return the object, else raise the response as an exception
83
- return response_object.parsed_response if response_object.response.code_type <= Net::HTTPSuccess # 2xx
90
+ return parsed_response if response.code >= 200 && response.code <= 299
84
91
 
85
- exception_message = (response_object.parsed_response && response_object.parsed_response['message']) || 'Error'
86
- raise custom_exception_klass_for(response_object.response), exception_message
87
- rescue Net::ReadTimeout, Net::OpenTimeout,
88
- EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
89
- Errno::EINVAL, Errno::ENETDOWN, Errno::ENETUNREACH, Errno::ENETRESET, Errno::ECONNABORTED, Errno::ECONNRESET,
92
+ exception_message = (parsed_response && parsed_response['message']) || 'Error'
93
+ raise custom_exception_klass_for(response), exception_message
94
+ rescue Errno::EINVAL, Errno::ENETDOWN, Errno::ENETUNREACH, Errno::ENETRESET, Errno::ECONNABORTED, Errno::ECONNRESET,
90
95
  Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTDOWN, Errno::EHOSTUNREACH,
91
- Timeout::Error, HTTParty::ResponseError, Typesense::Error::ServerError, Typesense::Error::HTTPStatus0Error => e
96
+ Typesense::Error::TimeoutError, Typesense::Error::ServerError, Typesense::Error::HTTPStatus0Error => e
92
97
  # Rescue network layer exceptions and HTTP 5xx errors, so the loop can continue.
93
98
  # Using loops for retries instead of rescue...retry to maintain consistency with client libraries in
94
99
  # other languages that might not support the same construct.
@@ -108,7 +113,7 @@ module Typesense
108
113
  def extract_headers_and_body_from(parameters)
109
114
  if json_request?(parameters)
110
115
  headers = { 'Content-Type' => 'application/json' }
111
- body = sanitize_parameters(parameters).to_json
116
+ body = Oj.dump(sanitize_parameters(parameters))
112
117
  else
113
118
  headers = {}
114
119
  body = parameters[:body]
@@ -199,35 +204,31 @@ module Typesense
199
204
  end
200
205
 
201
206
  def custom_exception_klass_for(response)
202
- response_code_type = response.code_type
203
- if response_code_type <= Net::HTTPBadRequest # 400
207
+ if response.code == 400
204
208
  Typesense::Error::RequestMalformed
205
- elsif response_code_type <= Net::HTTPUnauthorized # 401
209
+ elsif response.code == 401
206
210
  Typesense::Error::RequestUnauthorized
207
- elsif response_code_type <= Net::HTTPNotFound # 404
211
+ elsif response.code == 404
208
212
  Typesense::Error::ObjectNotFound
209
- elsif response_code_type <= Net::HTTPConflict # 409
213
+ elsif response.code == 409
210
214
  Typesense::Error::ObjectAlreadyExists
211
- elsif response_code_type <= Net::HTTPUnprocessableEntity # 422
215
+ elsif response.code == 422
212
216
  Typesense::Error::ObjectUnprocessable
213
- elsif response_code_type <= Net::HTTPServerError # 5xx
217
+ elsif response.code >= 500 && response.code <= 599
214
218
  Typesense::Error::ServerError
215
- elsif response.code.to_i.zero?
219
+ elsif response.timed_out?
220
+ Typesense::Error::TimeoutError
221
+ elsif response.code.zero?
216
222
  Typesense::Error::HTTPStatus0Error
217
223
  else
218
224
  Typesense::Error::HTTPError
219
225
  end
220
226
  end
221
227
 
222
- def default_options
223
- {
224
- timeout: @connection_timeout_seconds
225
- }
226
- end
227
-
228
228
  def default_headers
229
229
  {
230
- API_KEY_HEADER_NAME.to_s => @api_key
230
+ API_KEY_HEADER_NAME.to_s => @api_key,
231
+ 'User-Agent' => 'Typesense Ruby Client'
231
232
  }
232
233
  end
233
234
  end
@@ -2,13 +2,7 @@
2
2
 
3
3
  module Typesense
4
4
  class Client
5
- attr_reader :configuration
6
- attr_reader :collections
7
- attr_reader :aliases
8
- attr_reader :keys
9
- attr_reader :debug
10
- attr_reader :health
11
- attr_reader :metrics
5
+ attr_reader :configuration, :collections, :aliases, :keys, :debug, :health, :metrics
12
6
 
13
7
  def initialize(options = {})
14
8
  @configuration = Configuration.new(options)
@@ -2,8 +2,7 @@
2
2
 
3
3
  module Typesense
4
4
  class Collection
5
- attr_reader :documents
6
- attr_reader :overrides
5
+ attr_reader :documents, :overrides
7
6
 
8
7
  def initialize(name, api_call)
9
8
  @name = name
@@ -1,16 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'logger'
4
+
3
5
  module Typesense
4
6
  class Configuration
5
- attr_accessor :nodes
6
- attr_accessor :nearest_node
7
- attr_accessor :connection_timeout_seconds
8
- attr_accessor :healthcheck_interval_seconds
9
- attr_accessor :num_retries
10
- attr_accessor :retry_interval_seconds
11
- attr_accessor :api_key
12
- attr_accessor :logger
13
- attr_accessor :log_level
7
+ attr_accessor :nodes, :nearest_node, :connection_timeout_seconds, :healthcheck_interval_seconds, :num_retries, :retry_interval_seconds, :api_key, :logger, :log_level
14
8
 
15
9
  def initialize(options = {})
16
10
  @nodes = options[:nodes] || []
@@ -21,7 +15,7 @@ module Typesense
21
15
  @retry_interval_seconds = options[:retry_interval_seconds] || 0.1
22
16
  @api_key = options[:api_key]
23
17
 
24
- @logger = options[:logger] || Logger.new(STDOUT)
18
+ @logger = options[:logger] || Logger.new($stdout)
25
19
  @log_level = options[:log_level] || Logger::WARN
26
20
  @logger.level = @log_level
27
21
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'oj'
4
+
3
5
  module Typesense
4
6
  class Documents
5
7
  RESOURCE_PATH = '/documents'
@@ -15,12 +17,17 @@ module Typesense
15
17
  end
16
18
 
17
19
  def create_many(documents)
18
- documents_in_jsonl_format = documents.map { |document| JSON.dump(document) }.join("\n")
20
+ documents_in_jsonl_format = documents.map { |document| Oj.dump(document) }.join("\n")
21
+ results_in_jsonl_format = import(documents_in_jsonl_format)
22
+ results_in_jsonl_format.split("\n").map { |r| Oj.load(r) }
23
+ end
24
+
25
+ def import(documents_in_jsonl_format)
19
26
  @api_call.post(endpoint_path('import'), as_json: false, body: documents_in_jsonl_format)
20
27
  end
21
28
 
22
29
  def export
23
- (@api_call.get(endpoint_path('export')) || '').split("\n")
30
+ @api_call.get(endpoint_path('export'))
24
31
  end
25
32
 
26
33
  def search(search_parameters)
@@ -34,7 +41,7 @@ module Typesense
34
41
  private
35
42
 
36
43
  def endpoint_path(operation = nil)
37
- "#{Collections::RESOURCE_PATH}/#{@collection_name}#{Documents::RESOURCE_PATH}#{operation.nil? ? '' : '/' + operation}"
44
+ "#{Collections::RESOURCE_PATH}/#{@collection_name}#{Documents::RESOURCE_PATH}#{operation.nil? ? '' : "/#{operation}"}"
38
45
  end
39
46
  end
40
47
  end
@@ -26,6 +26,9 @@ module Typesense
26
26
  class HTTPStatus0Error < Error
27
27
  end
28
28
 
29
+ class TimeoutError < Error
30
+ end
31
+
29
32
  class NoMethodError < ::NoMethodError
30
33
  end
31
34
 
@@ -25,7 +25,7 @@ module Typesense
25
25
  private
26
26
 
27
27
  def endpoint_path(operation = nil)
28
- "#{Collections::RESOURCE_PATH}/#{@collection_name}#{Overrides::RESOURCE_PATH}#{operation.nil? ? '' : '/' + operation}"
28
+ "#{Collections::RESOURCE_PATH}/#{@collection_name}#{Overrides::RESOURCE_PATH}#{operation.nil? ? '' : "/#{operation}"}"
29
29
  end
30
30
  end
31
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Typesense
4
- VERSION = '0.5.3'
4
+ VERSION = '0.7.0.pre1'
5
5
  end
@@ -15,6 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://typesense.org'
16
16
  spec.license = 'Apache-2.0'
17
17
 
18
+ spec.required_ruby_version = '>= 2.4'
19
+
18
20
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
21
  f.match(%r{^(test|spec|features)/})
20
22
  end
@@ -25,16 +27,19 @@ Gem::Specification.new do |spec|
25
27
  spec.add_development_dependency 'awesome_print', '~> 1.8'
26
28
  spec.add_development_dependency 'bundler', '~> 2.0'
27
29
  spec.add_development_dependency 'codecov', '~> 0.1'
30
+ spec.add_development_dependency 'guard', '~> 2.16'
31
+ spec.add_development_dependency 'guard-rubocop', '~> 1.3'
28
32
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
29
33
  spec.add_development_dependency 'rake', '~> 13.0'
30
34
  spec.add_development_dependency 'rspec', '~> 3.9'
31
- spec.add_development_dependency 'rspec-legacy_formatters', '~> 1.0' # For codecov formatter
32
35
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4'
33
- spec.add_development_dependency 'rubocop', '~> 0.83'
36
+ spec.add_development_dependency 'rspec-legacy_formatters', '~> 1.0' # For codecov formatter
37
+ spec.add_development_dependency 'rubocop', '~> 0.88'
34
38
  spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
35
39
  spec.add_development_dependency 'simplecov', '~> 0.18'
36
40
  spec.add_development_dependency 'timecop', '~> 0.9'
37
41
  spec.add_development_dependency 'webmock', '~> 3.8'
38
42
 
39
- spec.add_dependency 'httparty', '~> 0.18'
43
+ spec.add_dependency 'oj', '~> 3.10'
44
+ spec.add_dependency 'typhoeus', '~> 1.4'
40
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typesense
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.7.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Typesense, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-09 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.16'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.16'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.3'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: pry-byebug
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -95,47 +123,47 @@ dependencies:
95
123
  - !ruby/object:Gem::Version
96
124
  version: '3.9'
97
125
  - !ruby/object:Gem::Dependency
98
- name: rspec-legacy_formatters
126
+ name: rspec_junit_formatter
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
129
  - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: '1.0'
131
+ version: '0.4'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '1.0'
138
+ version: '0.4'
111
139
  - !ruby/object:Gem::Dependency
112
- name: rspec_junit_formatter
140
+ name: rspec-legacy_formatters
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: '0.4'
145
+ version: '1.0'
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: '0.4'
152
+ version: '1.0'
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: rubocop
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: '0.83'
159
+ version: '0.88'
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: '0.83'
166
+ version: '0.88'
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: rubocop-rspec
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -193,19 +221,33 @@ dependencies:
193
221
  - !ruby/object:Gem::Version
194
222
  version: '3.8'
195
223
  - !ruby/object:Gem::Dependency
196
- name: httparty
224
+ name: oj
197
225
  requirement: !ruby/object:Gem::Requirement
198
226
  requirements:
199
227
  - - "~>"
200
228
  - !ruby/object:Gem::Version
201
- version: '0.18'
229
+ version: '3.10'
202
230
  type: :runtime
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
205
233
  requirements:
206
234
  - - "~>"
207
235
  - !ruby/object:Gem::Version
208
- version: '0.18'
236
+ version: '3.10'
237
+ - !ruby/object:Gem::Dependency
238
+ name: typhoeus
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '1.4'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '1.4'
209
251
  description: Typesense is an open source search engine for building a delightful search
210
252
  experience.
211
253
  email:
@@ -218,8 +260,8 @@ files:
218
260
  - ".gitignore"
219
261
  - ".rspec"
220
262
  - ".rubocop.yml"
221
- - ".rubocop_todo.yml"
222
263
  - Gemfile
264
+ - Guardfile
223
265
  - LICENSE
224
266
  - README.md
225
267
  - Rakefile
@@ -256,7 +298,7 @@ homepage: https://typesense.org
256
298
  licenses:
257
299
  - Apache-2.0
258
300
  metadata: {}
259
- post_install_message:
301
+ post_install_message:
260
302
  rdoc_options: []
261
303
  require_paths:
262
304
  - lib
@@ -264,15 +306,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
306
  requirements:
265
307
  - - ">="
266
308
  - !ruby/object:Gem::Version
267
- version: '0'
309
+ version: '2.4'
268
310
  required_rubygems_version: !ruby/object:Gem::Requirement
269
311
  requirements:
270
- - - ">="
312
+ - - ">"
271
313
  - !ruby/object:Gem::Version
272
- version: '0'
314
+ version: 1.3.1
273
315
  requirements: []
274
316
  rubygems_version: 3.0.6
275
- signing_key:
317
+ signing_key:
276
318
  specification_version: 4
277
319
  summary: Ruby Library for Typesense
278
320
  test_files: []
@@ -1,50 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2020-05-21 20:10:36 -0700 using RuboCop version 0.83.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- Lint/ShadowedException:
11
- Exclude:
12
- - 'lib/typesense/api_call.rb'
13
-
14
- # Offense count: 2
15
- # Configuration parameters: AllowComments.
16
- Lint/SuppressedException:
17
- Exclude:
18
- - 'examples/collections_and_documents.rb'
19
- - 'examples/search.rb'
20
- - 'examples/keys.rb'
21
-
22
- # Offense count: 10
23
- RSpec/MultipleExpectations:
24
- Max: 5
25
-
26
- # Offense count: 13
27
- Style/Documentation:
28
- Exclude:
29
- - 'spec/**/*'
30
- - 'test/**/*'
31
- - 'lib/typesense.rb'
32
- - 'lib/typesense/alias.rb'
33
- - 'lib/typesense/aliases.rb'
34
- - 'lib/typesense/api_call.rb'
35
- - 'lib/typesense/client.rb'
36
- - 'lib/typesense/collection.rb'
37
- - 'lib/typesense/collections.rb'
38
- - 'lib/typesense/configuration.rb'
39
- - 'lib/typesense/debug.rb'
40
- - 'lib/typesense/document.rb'
41
- - 'lib/typesense/documents.rb'
42
- - 'lib/typesense/override.rb'
43
- - 'lib/typesense/overrides.rb'
44
-
45
- # Offense count: 157
46
- # Cop supports --auto-correct.
47
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
48
- # URISchemes: http, https
49
- Layout/LineLength:
50
- Max: 312