yelp 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yelp/error.rb +16 -7
- data/lib/yelp/version.rb +1 -1
- data/spec/yelp/error_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11c890b74574ed87a98958e5492b2576187d53ae
|
4
|
+
data.tar.gz: ffb12c0d8ab4e37692aea9a51ab7ba2268d255cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4078c68dc24492572c45a995d9aa4d0dcea9ea5ff518bee4f7640ba886259d97d362523420d73c2cc123697a485bc21c38623a38b1e546119184835fb4dfe7df
|
7
|
+
data.tar.gz: 8482cbc5453a520cacb584a9a3c7521e2084a194771acd126c322e8ea4cb99a4ae423a4ff0b21e525b04e29d90a1cfea12b35905329097f5ffa189356d7ad995
|
data/lib/yelp/error.rb
CHANGED
@@ -25,7 +25,7 @@ module Yelp
|
|
25
25
|
def error_from_response(response)
|
26
26
|
body = JSON.parse(response.body)
|
27
27
|
klass = error_classes[body['error']['id']]
|
28
|
-
klass.new(body['error']['text'])
|
28
|
+
klass.new(body['error']['text'], body['error'])
|
29
29
|
end
|
30
30
|
|
31
31
|
# Maps from API Error id's to Yelp::Error exception classes.
|
@@ -45,29 +45,39 @@ module Yelp
|
|
45
45
|
@response_validator.validate(response)
|
46
46
|
end
|
47
47
|
|
48
|
-
class Base < StandardError
|
48
|
+
class Base < StandardError
|
49
|
+
def initialize(msg,error=nil)
|
50
|
+
end
|
51
|
+
end
|
49
52
|
|
50
53
|
class AlreadyConfigured < Base
|
51
54
|
def initialize(msg = 'Gem cannot be reconfigured. Initialize a new ' +
|
52
|
-
'instance of Yelp::Client.')
|
55
|
+
'instance of Yelp::Client.', error=nil)
|
53
56
|
super
|
54
57
|
end
|
55
58
|
end
|
56
59
|
|
57
60
|
class MissingAPIKeys < Base
|
58
|
-
def initialize(msg = "You're missing an API key")
|
61
|
+
def initialize(msg = "You're missing an API key", error=nil)
|
59
62
|
super
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
63
66
|
class MissingLatLng < Base
|
64
|
-
def initialize(msg = 'Missing required latitude or longitude parameters')
|
67
|
+
def initialize(msg = 'Missing required latitude or longitude parameters', error=nil)
|
65
68
|
super
|
66
69
|
end
|
67
70
|
end
|
68
71
|
|
69
72
|
class BoundingBoxNotComplete < Base
|
70
|
-
def initialize(msg = 'Missing required values for bounding box')
|
73
|
+
def initialize(msg = 'Missing required values for bounding box', error=nil)
|
74
|
+
super
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class InvalidParameter < Base
|
79
|
+
def initialize(msg='One or more parameters were invalid', error=nil)
|
80
|
+
msg = msg + ': ' + error['field'] unless error.nil?
|
71
81
|
super
|
72
82
|
end
|
73
83
|
end
|
@@ -75,7 +85,6 @@ module Yelp
|
|
75
85
|
class InternalError < Base; end
|
76
86
|
class ExceededRequests < Base; end
|
77
87
|
class MissingParameter < Base; end
|
78
|
-
class InvalidParameter < Base; end
|
79
88
|
class InvalidSignature < Base; end
|
80
89
|
class InvalidOAuthCredentials < Base; end
|
81
90
|
class InvalidOAuthUser < Base; end
|
data/lib/yelp/version.rb
CHANGED
data/spec/yelp/error_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yelp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomer Elmalem
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|