bolide_client 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bolide/account.rb +5 -3
- data/lib/bolide/q.rb +12 -6
- metadata +2 -2
data/lib/bolide/account.rb
CHANGED
@@ -21,7 +21,7 @@ module Bolide
|
|
21
21
|
q
|
22
22
|
end
|
23
23
|
|
24
|
-
def send_msg(body, qs = "
|
24
|
+
def send_msg(body, qs = ".*")
|
25
25
|
return false if !qs.kind_of?(String) && !qs.kind_of?(Array)
|
26
26
|
|
27
27
|
msg = create_msg(body, qs)
|
@@ -30,9 +30,11 @@ module Bolide
|
|
30
30
|
if resp.status > 400
|
31
31
|
xml = Nokogiri::XML(resp.body)
|
32
32
|
|
33
|
-
@error = xml.at_css('error')
|
33
|
+
@error = xml.at_css('error')
|
34
34
|
if(@error)
|
35
|
-
raise @error
|
35
|
+
raise @error.content
|
36
|
+
else
|
37
|
+
raise resp.body
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
data/lib/bolide/q.rb
CHANGED
@@ -59,10 +59,13 @@ module Bolide
|
|
59
59
|
def read_error(resp)
|
60
60
|
xml = Nokogiri::XML(resp.body)
|
61
61
|
|
62
|
-
@error = xml.at_css('error')
|
62
|
+
@error = xml.at_css('error')
|
63
63
|
if(@error)
|
64
|
-
p @error
|
65
|
-
@error
|
64
|
+
p @error.content
|
65
|
+
@error.content
|
66
|
+
else
|
67
|
+
p resp.body
|
68
|
+
resp.body
|
66
69
|
end
|
67
70
|
end
|
68
71
|
|
@@ -70,9 +73,12 @@ module Bolide
|
|
70
73
|
#parse xml
|
71
74
|
xml = Nokogiri::XML(resp.body)
|
72
75
|
|
73
|
-
|
74
|
-
@
|
75
|
-
|
76
|
+
token = xml.at_css('q token')
|
77
|
+
@token = token.content if token
|
78
|
+
expire_on = xml.at_css('q expire_on')
|
79
|
+
@expire_on = expire_on.content if expire_on
|
80
|
+
msg_count = xml.at_css('q msg_count')
|
81
|
+
@msg_count = msg_count.content if msg_count
|
76
82
|
end
|
77
83
|
end
|
78
84
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolide_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Guimont
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-21 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|