algoliasearch 1.0.0 → 1.0.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,15 @@
1
- ---
2
- SHA1:
3
- data.tar.gz: f1833d8ef8fe5af6c44ce31e169929b7c84b049c
4
- metadata.gz: e02ffcaf7597034df5b829752a7b8cc2069cbd19
5
- SHA512:
6
- data.tar.gz: b5a0bcf7afb047ffb0cc5a9b53a770e48c586a912fa03d1c49a3a7ef007be42e08dcd7fea13ca5c61e459256537f74a35ef7e4fcab5411f3eaaf2f2cffdaaf74
7
- metadata.gz: 536122b2dc1a59f5e50f09819af7b3b996c2b8ca0e1093534a799e4d5f4a5108e66402c16389882c965a7cbf15e4ab65528f29244359511fb4e4dbdcc75b99c6
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDg3MGEyNjMwMzgwMWE4YTFlNDNiOWM1NjI3NTE3MDBiYjczNWQ5YQ==
5
+ data.tar.gz: !binary |-
6
+ NmM2ZTA5Y2U2Y2RhZjNkOWZjY2ExMGZmODVhYzk5OTJiMGE0NTUzMg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YzU1M2ZmMzlkYzRmM2I2NWZmMGI5MGVkZGM2ZGRmYjlhOGEwNjA0YmU4M2Fj
10
+ Yzc4OTdlODc4ODZjOWI2ZDI1MWQzNjI3YzY1ZGI3NGQwZDhlMGQwYjYwYTc2
11
+ OTM1MjE1OThhNjg4OWM1MTk2OGY4YzZlYTYzNzU3NWZmODlmOTg=
12
+ data.tar.gz: !binary |-
13
+ MmNiNWI5OTZjOTU2MzIxM2VjZDI4MTM0N2Y5Mjg1Y2I2OWY5NzcwZTUzOGY3
14
+ NDY2ZTFlN2M5Y2IxMTM0NWFlM2U5ZGM5ZDhhOTBjYTViMjBjYjQ3Y2UxYWYy
15
+ ZWNhNjIxZjUyZjM0OWUyNmNjZjk0OTE5ZmUyMzFlOTQ3NzE0N2I=
data/Gemfile.lock CHANGED
@@ -1,34 +1,67 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.3.4)
5
- crack (0.3.2)
4
+ addressable (2.3.5)
5
+ builder (3.2.2)
6
+ crack (0.4.1)
7
+ safe_yaml (~> 0.9.0)
6
8
  curb (0.8.4)
7
- diff-lcs (1.1.3)
8
- git (1.2.5)
9
- jeweler (1.8.4)
9
+ diff-lcs (1.2.4)
10
+ faraday (0.8.8)
11
+ multipart-post (~> 1.2.0)
12
+ git (1.2.6)
13
+ github_api (0.10.1)
14
+ addressable
15
+ faraday (~> 0.8.1)
16
+ hashie (>= 1.2)
17
+ multi_json (~> 1.4)
18
+ nokogiri (~> 1.5.2)
19
+ oauth2
20
+ hashie (2.0.5)
21
+ highline (1.6.19)
22
+ httpauth (0.2.0)
23
+ jeweler (1.8.7)
24
+ builder
10
25
  bundler (~> 1.0)
11
26
  git (>= 1.2.5)
27
+ github_api (= 0.10.1)
28
+ highline (>= 1.6.15)
29
+ nokogiri (= 1.5.10)
12
30
  rake
13
31
  rdoc
14
32
  json (1.8.0)
15
- rake (10.0.4)
16
- rdoc (3.12.2)
33
+ jwt (0.1.8)
34
+ multi_json (>= 1.5)
35
+ multi_json (1.8.0)
36
+ multi_xml (0.5.5)
37
+ multipart-post (1.2.0)
38
+ nokogiri (1.5.10)
39
+ oauth2 (0.9.2)
40
+ faraday (~> 0.8)
41
+ httpauth (~> 0.2)
42
+ jwt (~> 0.1.4)
43
+ multi_json (~> 1.0)
44
+ multi_xml (~> 0.5)
45
+ rack (~> 1.2)
46
+ rack (1.5.2)
47
+ rake (10.1.0)
48
+ rdoc (4.0.1)
17
49
  json (~> 1.4)
18
50
  redgreen (1.2.2)
19
- rspec (2.11.0)
20
- rspec-core (~> 2.11.0)
21
- rspec-expectations (~> 2.11.0)
22
- rspec-mocks (~> 2.11.0)
23
- rspec-core (2.11.1)
24
- rspec-expectations (2.11.3)
25
- diff-lcs (~> 1.1.3)
26
- rspec-mocks (2.11.2)
27
- shoulda-context (1.0.2)
28
- test-unit (2.5.4)
29
- webmock (1.9.0)
51
+ rspec (2.14.1)
52
+ rspec-core (~> 2.14.0)
53
+ rspec-expectations (~> 2.14.0)
54
+ rspec-mocks (~> 2.14.0)
55
+ rspec-core (2.14.5)
56
+ rspec-expectations (2.14.2)
57
+ diff-lcs (>= 1.1.3, < 2.0)
58
+ rspec-mocks (2.14.3)
59
+ safe_yaml (0.9.7)
60
+ shoulda-context (1.1.5)
61
+ test-unit (2.5.5)
62
+ webmock (1.13.0)
30
63
  addressable (>= 2.2.7)
31
- crack (>= 0.1.7)
64
+ crack (>= 0.3.2)
32
65
 
33
66
  PLATFORMS
34
67
  ruby
data/README.md CHANGED
@@ -29,8 +29,8 @@ Setup
29
29
  -------------
30
30
  To setup your project, follow these steps:
31
31
 
32
- 2. Install AlgoliaSearch using <code>gem install algoliasearch</code>.
33
- 2. Initialize the client with your ApplicationID and API-Key (you can find all of them on your Algolia account).
32
+ 1. Install AlgoliaSearch using <code>gem install algoliasearch</code>.
33
+ 2. Initialize the client with your ApplicationID and API-Key. You can find all of them on [your Algolia account](http://www.algolia.com/users/edit).
34
34
 
35
35
  ```ruby
36
36
  require 'rubygems'
@@ -254,7 +254,7 @@ You can retrieve all settings using the `getSettings` function. The result will
254
254
  * **attributesToIndex**: (array of strings) the list of fields you want to index.<br/>By default all textual attributes of your objects are indexed, but you should update it to get optimal results.<br/>This parameter has two important uses:
255
255
  * *Limits the attributes to index*.<br/>For example if you store a binary image in base64, you want to store it and be able to retrieve it but you don't want to search in the base64 string.
256
256
  * *Controls part of the ranking*.<br/>Matches in attributes at the beginning of the list will be considered more important than matches in attributes further down the list.
257
- * **ranking**: (array of strings) controls the way hits are sorted.<br/>We have five available criteria:
257
+ * **ranking**: (array of strings) controls the way hits are sorted.<br/>We have six available criteria:
258
258
  * **typo**: sort according to number of typos,
259
259
  * **geo**: sort according to decreasing distance when performing a geo-location based search,
260
260
  * **proximity**: sort according to the proximity of query words in hits,
@@ -308,7 +308,7 @@ res = index.add_object!({"firstname" => "Jimmie",
308
308
  "lastname" => "Barninger"})
309
309
  ```
310
310
 
311
- If you want to ensure multiple objects have been indexed, you can only check the biggest taskID.
311
+ If you want to ensure multiple objects have been indexed, you can only check the biggest taskID with `wait_task`.
312
312
 
313
313
  Batch writes
314
314
  -------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.2
@@ -2,14 +2,15 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: algoliasearch 1.0.2 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "algoliasearch"
8
- s.version = "1.0.0"
9
+ s.version = "1.0.2"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
12
  s.authors = ["Algolia"]
12
- s.date = "2013-08-05"
13
+ s.date = "2013-09-17"
13
14
  s.description = "A simple Ruby client for the algolia.com REST API"
14
15
  s.email = "contact@algolia.com"
15
16
  s.extra_rdoc_files = [
@@ -17,7 +18,6 @@ Gem::Specification.new do |s|
17
18
  "README.md"
18
19
  ]
19
20
  s.files = [
20
- "contacts.json",
21
21
  "Gemfile",
22
22
  "Gemfile.lock",
23
23
  "LICENSE.txt",
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "algoliasearch.gemspec",
28
+ "contacts.json",
28
29
  "lib/algolia/client.rb",
29
30
  "lib/algolia/error.rb",
30
31
  "lib/algolia/index.rb",
@@ -34,7 +35,7 @@ Gem::Specification.new do |s|
34
35
  s.homepage = "http://github.com/algolia/algoliasearch-client-ruby"
35
36
  s.licenses = ["MIT"]
36
37
  s.require_paths = ["lib"]
37
- s.rubygems_version = "2.0.5"
38
+ s.rubygems_version = "2.1.3"
38
39
  s.summary = "A simple Ruby client for the algolia.com REST API"
39
40
 
40
41
  if s.respond_to? :specification_version then
data/lib/algolia/index.rb CHANGED
@@ -208,9 +208,23 @@ module Algolia
208
208
  # @param objectID the unique identifier of object to delete
209
209
  #
210
210
  def delete_object(objectID)
211
+ if (objectID == nil || objectID.length == 0) then
212
+ raise AlgoliaProtocolError.new(0, "objectID is required")
213
+ end
211
214
  Algolia.client.delete(Protocol.object_uri(name, objectID))
212
215
  end
213
216
 
217
+ #
218
+ # Delete an object from the index and wait end of indexing
219
+ #
220
+ # @param objectID the unique identifier of object to delete
221
+ #
222
+ def delete_object!(objectID)
223
+ res = delete_object(objectID)
224
+ wait_task(res["taskID"])
225
+ return res
226
+ end
227
+
214
228
  #
215
229
  # Set settings for this index
216
230
  #
metadata CHANGED
@@ -1,94 +1,135 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2013-08-05 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+ date: 2013-09-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
15
14
  name: curb
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - &id002
20
- - ">="
21
- - !ruby/object:Gem::Version
22
- version: "0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
23
20
  type: :runtime
24
- version_requirements: *id001
25
- - !ruby/object:Gem::Dependency
26
- name: bundler
27
21
  prerelease: false
28
- requirement: &id003 !ruby/object:Gem::Requirement
29
- requirements:
30
- - *id002
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
31
34
  type: :development
32
- version_requirements: *id003
33
- - !ruby/object:Gem::Dependency
34
- name: jeweler
35
35
  prerelease: false
36
- requirement: &id004 !ruby/object:Gem::Requirement
37
- requirements:
38
- - *id002
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jeweler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
39
48
  type: :development
40
- version_requirements: *id004
41
- - !ruby/object:Gem::Dependency
42
- name: test-unit
43
49
  prerelease: false
44
- requirement: &id005 !ruby/object:Gem::Requirement
45
- requirements:
46
- - *id002
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  type: :development
48
- version_requirements: *id005
49
- - !ruby/object:Gem::Dependency
50
- name: rspec
51
63
  prerelease: false
52
- requirement: &id006 !ruby/object:Gem::Requirement
53
- requirements:
54
- - *id002
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
55
76
  type: :development
56
- version_requirements: *id006
57
- - !ruby/object:Gem::Dependency
58
- name: shoulda-context
59
77
  prerelease: false
60
- requirement: &id007 !ruby/object:Gem::Requirement
61
- requirements:
62
- - *id002
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: shoulda-context
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
63
90
  type: :development
64
- version_requirements: *id007
65
- - !ruby/object:Gem::Dependency
66
- name: webmock
67
91
  prerelease: false
68
- requirement: &id008 !ruby/object:Gem::Requirement
69
- requirements:
70
- - *id002
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
71
104
  type: :development
72
- version_requirements: *id008
73
- - !ruby/object:Gem::Dependency
74
- name: redgreen
75
105
  prerelease: false
76
- requirement: &id009 !ruby/object:Gem::Requirement
77
- requirements:
78
- - *id002
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: redgreen
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
79
118
  type: :development
80
- version_requirements: *id009
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
81
125
  description: A simple Ruby client for the algolia.com REST API
82
126
  email: contact@algolia.com
83
127
  executables: []
84
-
85
128
  extensions: []
86
-
87
- extra_rdoc_files:
129
+ extra_rdoc_files:
88
130
  - LICENSE.txt
89
131
  - README.md
90
- files:
91
- - contacts.json
132
+ files:
92
133
  - Gemfile
93
134
  - Gemfile.lock
94
135
  - LICENSE.txt
@@ -96,33 +137,34 @@ files:
96
137
  - Rakefile
97
138
  - VERSION
98
139
  - algoliasearch.gemspec
140
+ - contacts.json
99
141
  - lib/algolia/client.rb
100
142
  - lib/algolia/error.rb
101
143
  - lib/algolia/index.rb
102
144
  - lib/algolia/protocol.rb
103
145
  - lib/algoliasearch.rb
104
146
  homepage: http://github.com/algolia/algoliasearch-client-ruby
105
- licenses:
147
+ licenses:
106
148
  - MIT
107
149
  metadata: {}
108
-
109
150
  post_install_message:
110
151
  rdoc_options: []
111
-
112
- require_paths:
152
+ require_paths:
113
153
  - lib
114
- required_ruby_version: !ruby/object:Gem::Requirement
115
- requirements:
116
- - *id002
117
- required_rubygems_version: !ruby/object:Gem::Requirement
118
- requirements:
119
- - *id002
154
+ required_ruby_version: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - ! '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
120
164
  requirements: []
121
-
122
165
  rubyforge_project:
123
- rubygems_version: 2.0.3
166
+ rubygems_version: 2.1.3
124
167
  signing_key:
125
168
  specification_version: 4
126
169
  summary: A simple Ruby client for the algolia.com REST API
127
170
  test_files: []
128
-