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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c6efde531365d0e2b4c79911fd48588682e915e
4
- data.tar.gz: 4e7f1c0df6ad59ffe779826267d49567b50697c9
3
+ metadata.gz: da8629d49c5fcbcaaf59d158f8fbef21cfb5fc0a
4
+ data.tar.gz: 50342afc368a91785b91c49b78f7e7bea57ecb3e
5
5
  SHA512:
6
- metadata.gz: 88e304c91e8d447d594530f9e1dbceda11a49bd663ca5fd53f451c79badf2ee15a8a6e190c1816b6c01d4ff0c066fa70255422000fc2073d918bcf4932a46424
7
- data.tar.gz: ec2ac15600d8aa04a161b43a1f7228eb23c95ea2d0d0f584a49f8ca4c2d9948fdc9517073ae51afb4390fb0719813942beee3d9360ed00338b1f830caafd9a8a
6
+ metadata.gz: 5e4c1cb5b5e041839953449c57dd22c50770a6ef27d39ede27b136bd4315219b1002228870023b09b0e4b37150c9057f350ced4117bb48ef12a748ca06243b73
7
+ data.tar.gz: a5d127745ea72ca42c7e8b0ade4133502006c2d030196122cb6c5197526a5d0916dfd270857df5bd75662777bda1ba99bf4770c8604fd5510f7425a103a8a56a
@@ -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 = monitor['friendlyname']
113
- monitor['friendlyname'] = CGI.unescapeHTML(friendlyname)
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
@@ -1,3 +1,3 @@
1
1
  module UptimeRobot
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
@@ -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]['friendlyname'] = escaped_string
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]['friendlyname'] = unescaped_string
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptimerobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara