1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

update styling per rubocop

This commit is contained in:
joe morgan 2014-07-11 14:54:38 -05:00
parent fc5c23a917
commit 1245e2d791
2 changed files with 17 additions and 17 deletions

View file

@ -2,7 +2,7 @@ module Fog
module DNS
class Zerigo
class Real
require 'fog/zerigo/parsers/dns/list_hosts'
require "fog/zerigo/parsers/dns/list_hosts"
# Get list of all DNS zones hosted on Slicehost (for this account)
#
@ -30,9 +30,9 @@ module Fog
# * 'status'<~Integer> - 200 indicates success
def list_hosts(zone_id, options={})
request(
:query => options,
:query => options,
:expects => 200,
:method => 'GET',
:method => "GET",
:parser => Fog::Parsers::DNS::Zerigo::ListHosts.new,
:path => "/api/1.1/zones/#{zone_id}/hosts.xml"
)
@ -49,16 +49,16 @@ module Fog
if options.empty?
response.status = 200
response.body = {
'hosts' => zone['hosts']
"hosts" => zone["hosts"]
}
else
hosts = zone['hosts']
hosts.select! {|h| h['fqdn'] == options['fqdn']} if options['fqdn']
hosts = options['per_page'] ? hosts.each_slice(options['per_page'] - 1).to_a : hosts.each_slice(100).to_a
hosts = options['page'] ? hosts[options['page']] : hosts[0]
hosts = zone["hosts"]
hosts = hosts.select {|h| h["fqdn"] == options["fqdn"]} if options["fqdn"]
hosts = options["per_page"] ? hosts.each_slice(options["per_page"] - 1).to_a : hosts.each_slice(100).to_a
hosts = options["page"] ? hosts[options["page"]] : hosts[0]
response.status = 200
response.body = {
'hosts' => hosts
"hosts" => hosts
}
end
else

View file

@ -327,18 +327,18 @@ Shindo.tests('Fog::DNS[:zerigo] | DNS requests', ['zerigo', 'dns']) do
host_count == 4
end
test('list host records') do
test("list host records") do
pending if Fog.mocking?
result = false
response = Fog::DNS[:zerigo].list_hosts( @zone_id)
if response.status == 200
hosts = response.body['hosts']
hosts = response.body["hosts"]
if (hosts.count == 4)
hosts.each { |host|
if (host['id'] > 0) and (host['fqdn'].length > 0) and (host['host-type'].length > 0) and
(host['created-at'].length > 0) and (host['updated-at'].length > 0)
if (host["id"] > 0) and (host["fqdn"].length > 0) and (host["host-type"].length > 0) and
(host["created-at"].length > 0) and (host["updated-at"].length > 0)
result = true
end
}
@ -348,18 +348,18 @@ Shindo.tests('Fog::DNS[:zerigo] | DNS requests', ['zerigo', 'dns']) do
result
end
test('list host records with options') do
test("list host records with options") do
pending if Fog.mocking?
result = false
response = Fog::DNS[:zerigo].list_hosts(@zone_id, {:per_page=>2, :page=>1})
if response.status == 200
hosts = response.body['hosts']
hosts = response.body["hosts"]
if (hosts.count == 2)
hosts.each { |host|
if (host['id'] > 0) and (host['fqdn'].length > 0) and (host['host-type'].length > 0) and
(host['created-at'].length > 0) and (host['updated-at'].length > 0)
if (host["id"] > 0) and (host["fqdn"].length > 0) and (host["host-type"].length > 0) and
(host["created-at"].length > 0) and (host["updated-at"].length > 0)
result = true
end
}