uptimerobot 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uptimerobot/client.rb +5 -2
- data/lib/uptimerobot/version.rb +1 -1
- data/spec/uptimerobot_spec.rb +10 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da8629d49c5fcbcaaf59d158f8fbef21cfb5fc0a
|
4
|
+
data.tar.gz: 50342afc368a91785b91c49b78f7e7bea57ecb3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4c1cb5b5e041839953449c57dd22c50770a6ef27d39ede27b136bd4315219b1002228870023b09b0e4b37150c9057f350ced4117bb48ef12a748ca06243b73
|
7
|
+
data.tar.gz: a5d127745ea72ca42c7e8b0ade4133502006c2d030196122cb6c5197526a5d0916dfd270857df5bd75662777bda1ba99bf4770c8604fd5510f7425a103a8a56a
|
data/lib/uptimerobot/client.rb
CHANGED
@@ -109,8 +109,11 @@ class UptimeRobot::Client
|
|
109
109
|
|
110
110
|
def unescape_monitor!(json)
|
111
111
|
json['monitors']['monitor'].each do |monitor|
|
112
|
-
friendlyname
|
113
|
-
|
112
|
+
%w(friendlyname keywordvalue httpusername httppassword).each do |key|
|
113
|
+
value = monitor[key] || ''
|
114
|
+
next if value.empty?
|
115
|
+
monitor[key] = CGI.unescapeHTML(value)
|
116
|
+
end
|
114
117
|
end
|
115
118
|
end
|
116
119
|
end
|
data/lib/uptimerobot/version.rb
CHANGED
data/spec/uptimerobot_spec.rb
CHANGED
@@ -115,23 +115,23 @@ describe UptimeRobot::Client do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
context 'when include escaped string' do
|
118
|
-
let(:escaped_string) do
|
119
|
-
'http monitor (basic auth)'
|
120
|
-
end
|
121
|
-
|
122
|
-
let(:unescaped_string) do
|
123
|
-
'http monitor (basic auth)'
|
124
|
-
end
|
125
|
-
|
126
118
|
let(:response_with_escaped_string) do
|
127
119
|
res = response.dup
|
128
|
-
res['monitors']['monitor'][0]
|
120
|
+
monitor = res['monitors']['monitor'][0]
|
121
|
+
monitor['friendlyname'] = 'http monitor (basic auth)'
|
122
|
+
monitor['keywordvalue'] = '(keywordvalue)'
|
123
|
+
monitor['httpusername'] = '(httpusername)'
|
124
|
+
monitor['httppassword'] = '(httppassword)'
|
129
125
|
res
|
130
126
|
end
|
131
127
|
|
132
128
|
let(:response_with_unescaped_string) do
|
133
129
|
res = response.dup
|
134
|
-
res['monitors']['monitor'][0]
|
130
|
+
monitor = res['monitors']['monitor'][0]
|
131
|
+
monitor['friendlyname'] = 'http monitor (basic auth)'
|
132
|
+
monitor['keywordvalue'] = '(keywordvalue)'
|
133
|
+
monitor['httpusername'] = '(httpusername)'
|
134
|
+
monitor['httppassword'] = '(httppassword)'
|
135
135
|
res
|
136
136
|
end
|
137
137
|
|