algoliasearch 1.12.7 → 1.13.0

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
  SHA1:
3
- metadata.gz: 3c2db1d4cb3dd9d598ae67374ce047c0537cc336
4
- data.tar.gz: 26b61accfebfad33730f6bc9f37aa9df1b8812f1
3
+ metadata.gz: b2c28ac6561ea6ee8b1bbd6d96f1d39ad455e134
4
+ data.tar.gz: c0da09cd340a8e6e37123c61455d87d0dd99435c
5
5
  SHA512:
6
- metadata.gz: 7041be1e54b500f18993340631e1016ac296442cd428528b8568ad416b86e1321babda347cc4455f05fa965436b2e4fdd136abb146becd531db2d620daefdd7b
7
- data.tar.gz: 819a1b0c3f5b17ba9cabcf9ac6fc2c87e143cc6f6737232eda60ad687ed4908aee60192f4a3e7a4526c15d96c447829a17893d5d2356865ab3c4c915b39074ca
6
+ metadata.gz: e51bae499fb4e185a9ee7303b46e7643e6867f79a9b31ab766cbcd44aa5e33426d7a029faa0bda63794e7c7b54aec974e67080ac0d9f4ac2bb559ad185940cba
7
+ data.tar.gz: 0b34163669b36db24e083857495c95900722ff5a20361d55c497092619befe9e799c7fe3a939a231eac3403f9fff61108c5a0b1b7c7df19e6efe134ae08f847e
data/ChangeLog CHANGED
@@ -1,5 +1,8 @@
1
1
  CHANGELOG
2
2
 
3
+ 2017-03-17 1.13.0
4
+ * Add a `index.get_task_status(taskID)` method (#199)
5
+
3
6
  2017-03-01 1.12.7
4
7
  * Renamed all `*_user_key` methods to `*_api_key`
5
8
 
data/lib/algolia/index.rb CHANGED
@@ -235,6 +235,15 @@ module Algolia
235
235
  client.post(Protocol.objects_uri, { :requests => requests }.to_json, :read)['results']
236
236
  end
237
237
 
238
+ # Check the status of a task on the server.
239
+ # All server task are asynchronous and you can check the status of a task with this method.
240
+ #
241
+ # @param taskID the id of the task returned by server
242
+ #
243
+ def get_task_status(taskID)
244
+ client.get(Protocol.task_uri(name, taskID), :read)["status"]
245
+ end
246
+
238
247
  # Wait the publication of a task on the server.
239
248
  # All server task are asynchronous and you can check with this method that the task is published.
240
249
  #
@@ -243,7 +252,7 @@ module Algolia
243
252
  #
244
253
  def wait_task(taskID, timeBeforeRetry = 100)
245
254
  loop do
246
- status = client.get(Protocol.task_uri(name, taskID), :read)["status"]
255
+ status = get_task_status(taskID)
247
256
  if status == "published"
248
257
  return
249
258
  end
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = "1.12.7"
2
+ VERSION = "1.13.0"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -691,6 +691,12 @@ describe 'Client' do
691
691
  [true, false].should include(task['pendingTask'])
692
692
  end
693
693
 
694
+ it 'Check attributes get_task_status' do
695
+ task = @index.add_object!({ :name => "John Doe", :email => "john@doe.org" }, "1")
696
+ status = @index.get_task_status(task["taskID"])
697
+ status.should be_a(String)
698
+ end
699
+
694
700
  it "Check add keys" do
695
701
  newIndexKey = @index.add_api_key(['search'])
696
702
  newIndexKey.should have_key('key')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.7
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.5.1
134
+ rubygems_version: 2.6.8
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: A simple Ruby client for the algolia.com REST API