meilisearch 0.28.1 → 0.28.3

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: 6ab1ca4588a18f8b05adf716bd51dc0eab2fb3e701e6d3054dd764575daaa044
4
- data.tar.gz: bd65d7e3a941b7fdf5282a16287cedd5cd148d1c202ef56b145e1c574f6580b0
3
+ metadata.gz: 5fb15bd61b76373cf166b4977ef4ccf7598a7aaa9c7eb1ce85f6730a306ee18e
4
+ data.tar.gz: 7e719a0c3e3bed01c3057f363688e4f5f4e447a72932585d2d9fc4a31006f0f2
5
5
  SHA512:
6
- metadata.gz: e217f70e25f8cd18c040ce373a4f1a853426889a6ac31b2d8fabab176a29cfb42b21be61cfa385c9f1ad7f9a557a3caae818218776f9ab65f3f07c7528d0f719
7
- data.tar.gz: 7fbea96f89362ec7699f8ef51f95c13b84161754d15366069d933bb61dd9defcf47d385d68f477eb6a72d16b6d392015bcb012451085f63b2b73e28d74fc71d0
6
+ metadata.gz: 82b9c0d1d3deb894610ed834ed063f2864fdb19cbea2146a309b4a8ef1bbf21228141a618708da2955fb443f778b1f0799c4768ec5817ca0ea16ddbf547d91bf
7
+ data.tar.gz: 40fa4e4803ac36dac67f2b588a416f40a60a48ebbfc356686d90f5b2127825f4a4accae56ba150474a0129ad0a40f1f339fb1a764c57122eb891bb03c0513fb5
@@ -70,6 +70,15 @@ module MeiliSearch
70
70
  end
71
71
  end
72
72
 
73
+ class InvalidDocumentId < Error
74
+ attr_reader :message
75
+
76
+ def initialize(message = nil)
77
+ @message = "The document id is invalid. #{message}"
78
+ super(@message)
79
+ end
80
+ end
81
+
73
82
  module TenantToken
74
83
  class ExpireOrInvalidSignature < MeiliSearch::Error; end
75
84
  class InvalidApiKey < MeiliSearch::Error; end
@@ -220,6 +220,10 @@ module MeiliSearch
220
220
  alias delete_multiple_documents! delete_documents!
221
221
 
222
222
  def delete_document(document_id)
223
+ if document_id.nil? || document_id.to_s.empty?
224
+ raise MeiliSearch::InvalidDocumentId, 'document_id cannot be empty or nil'
225
+ end
226
+
223
227
  encode_document = URI.encode_www_form_component(document_id)
224
228
  response = http_delete "/indexes/#{@uid}/documents/#{encode_document}"
225
229
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeiliSearch
4
- VERSION = '0.28.1'
4
+ VERSION = '0.28.3'
5
5
 
6
6
  def self.qualified_version
7
7
  "Meilisearch Ruby (v#{VERSION})"
data/lib/meilisearch.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
4
+
3
5
  require 'meilisearch/version'
4
6
  require 'meilisearch/utils'
5
7
  require 'meilisearch/models/task'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meilisearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.1
4
+ version: 0.28.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-09 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty