algoliasearch 1.2.12 → 1.2.13

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: ce03495d8a65c3fc3df2ecce17d405ea3b06ec10
4
- data.tar.gz: ce3aca4b079c7ae6c904bc72ed8a717e4d6d052f
3
+ metadata.gz: cb867d51f1112797761177032870c0298192b7d3
4
+ data.tar.gz: 6f7acc04bb4e2e6674cf404c3641860c2cf32673
5
5
  SHA512:
6
- metadata.gz: 496951be33beaee2a259bdacd641774f7718644ac5f36b2d70b71420e715db3f6db3341de6ff8a955224cf46e184f13421ab3d26a76765a747f88526001ce5b9
7
- data.tar.gz: 782d7260a5083a9d2c34006694cd94d393f8ec658a20fd209eca9b352a286df0cd081f46c179e4578f2d01a4e6c34a32aa5664dae79bb45e8522f77a06384699
6
+ metadata.gz: b02427a9bc1e2a9438d2178dc3abc11a447aeb2395f8cfc28eca58f657c200bcd7bd1356a9bc19b636bae43e908fa936cdc58e9f9dd9a2b88d01f2d540eeee7c
7
+ data.tar.gz: e0dde1753432e5ba3235da83a1dbdb7475dfa70dc5e344a1dea97baeee96d330a3de9be0b3facd7e07dc0e1c693ea84a64435afeaa6da6185f8f39bf7babfcf0
@@ -1,17 +1,15 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
5
- # stub: algoliasearch 1.2.0 ruby lib
2
+
3
+ require File.join(File.dirname(__FILE__), 'lib', 'algolia', 'version')
6
4
 
7
5
  Gem::Specification.new do |s|
8
6
  s.name = "algoliasearch"
9
- s.version = "1.2.12"
7
+ s.version = Algolia::VERSION
10
8
 
11
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
10
  s.require_paths = ["lib"]
13
11
  s.authors = ["Algolia"]
14
- s.date = "2014-10-08"
12
+ s.date = Date.today
15
13
  s.description = "A simple Ruby client for the algolia.com REST API"
16
14
  s.email = "contact@algolia.com"
17
15
  s.extra_rdoc_files = [
@@ -40,7 +40,7 @@ module Algolia
40
40
  begin
41
41
  return perform_request(host[:session], host[:base_url] + uri, method, data)
42
42
  rescue AlgoliaProtocolError => e
43
- raise if e.code != Protocol::ERROR_TIMEOUT and e.code != Protocol::ERROR_UNAVAILABLE
43
+ raise if e.code == Protocol::ERROR_BAD_REQUEST or e.code == Protocol::ERROR_FORBIDDEN or e.code == Protocol::ERROR_NOT_FOUND
44
44
  exceptions << e
45
45
  rescue => e
46
46
  exceptions << e
@@ -134,6 +134,13 @@ module Algolia
134
134
  @@client = Client.new(defaulted)
135
135
  end
136
136
 
137
+ #
138
+ # Allow to set custom headers
139
+ #
140
+ def Algolia.set_extra_header(key, value)
141
+ Algolia.client.headers[key] = value
142
+ end
143
+
137
144
  #
138
145
  # Allow to use IP rate limit when you have a proxy between end-user and Algolia.
139
146
  # This option will set the X-Forwarded-For HTTP header with the client IP and the X-Forwarded-API-Key with the API Key having rate limits.
@@ -27,8 +27,9 @@ module Algolia
27
27
  # HTTP ERROR CODES
28
28
  # ----------------------------------------
29
29
 
30
- ERROR_TIMEOUT = 124
31
- ERROR_UNAVAILABLE = 503
30
+ ERROR_BAD_REQUEST = 400
31
+ ERROR_FORBIDDEN = 403
32
+ ERROR_NOT_FOUND = 404
32
33
 
33
34
  # URI Helpers
34
35
  # ----------------------------------------
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = "1.2.12"
2
+ VERSION = "1.2.13"
3
3
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.12
4
+ version: 1.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-08 00:00:00.000000000 Z
11
+ date: 2014-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.5.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.5.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: travis
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: A simple Ruby client for the algolia.com REST API
@@ -89,8 +89,8 @@ extra_rdoc_files:
89
89
  - LICENSE.txt
90
90
  - README.md
91
91
  files:
92
- - ".rspec"
93
- - ".travis.yml"
92
+ - .rspec
93
+ - .travis.yml
94
94
  - ChangeLog
95
95
  - Gemfile
96
96
  - Gemfile.lock
@@ -121,12 +121,12 @@ require_paths:
121
121
  - lib
122
122
  required_ruby_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ">="
124
+ - - '>='
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []