you_got_listed 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/you_got_listed/response.rb +16 -11
- data/lib/you_got_listed/version.rb +1 -1
- data/you_got_listed.gemspec +1 -1
- metadata +8 -8
@@ -4,19 +4,24 @@ module YouGotListed
|
|
4
4
|
attr_accessor :ygl_response
|
5
5
|
|
6
6
|
def initialize(response, raise_error = true)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
if
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
begin
|
8
|
+
if !response.respond_to?(:each_pair)
|
9
|
+
self.ygl_response = nil
|
10
|
+
raise Error.new('empty_response', 'Empty Response') if raise_error
|
11
|
+
else
|
12
|
+
rash = Hashie::Rash.new(response)
|
13
|
+
self.ygl_response = rash.ygl_response
|
14
|
+
if !success? && raise_error
|
15
|
+
if self.ygl_response.respond_to?(:response_code)
|
16
|
+
raise Error.new(self.ygl_response.response_code, self.ygl_response.error)
|
17
|
+
else
|
18
|
+
raise Error.new('empty_response', 'Empty Response')
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
22
|
+
rescue MultiXml::ParseError
|
23
|
+
self.ygl_response = nil
|
24
|
+
raise Error.new('parse_error', 'XML Parse Error') if raise_error
|
20
25
|
end
|
21
26
|
end
|
22
27
|
|
data/you_got_listed.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.platform = Gem::Platform::RUBY
|
18
18
|
|
19
19
|
s.add_dependency "activesupport", "~> 3"
|
20
|
-
s.add_dependency "httparty", "
|
20
|
+
s.add_dependency "httparty", "~> 0.8.3"
|
21
21
|
s.add_dependency "rash", ">= 0.3.2"
|
22
22
|
s.add_dependency "will_paginate", ">= 3"
|
23
23
|
s.add_development_dependency "rake", "~> 0.9.2"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: you_got_listed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Cocca
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirement: &id002 !ruby/object:Gem::Requirement
|
37
37
|
none: false
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
hash:
|
41
|
+
hash: 57
|
42
42
|
segments:
|
43
43
|
- 0
|
44
|
-
-
|
45
|
-
-
|
46
|
-
version: 0.
|
44
|
+
- 8
|
45
|
+
- 3
|
46
|
+
version: 0.8.3
|
47
47
|
version_requirements: *id002
|
48
48
|
name: httparty
|
49
49
|
type: :runtime
|