From 91d6e8ee4e6180979adefa6b71abc9b8024fdd21 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 24 May 2011 13:43:08 -0700 Subject: [PATCH] [dnsimple|dns] add dnsimple_url param to facilitate using https://test.dnsimple.com closes #323 --- lib/fog/dns/dnsimple.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/fog/dns/dnsimple.rb b/lib/fog/dns/dnsimple.rb index 02328af6b..d2005b16e 100644 --- a/lib/fog/dns/dnsimple.rb +++ b/lib/fog/dns/dnsimple.rb @@ -3,7 +3,7 @@ module Fog class DNS < Fog::Service requires :dnsimple_email, :dnsimple_password - recognizes :host, :path, :port, :scheme, :persistent + recognizes :dnsimple_url, :host, :path, :port, :scheme, :persistent recognizes :provider # remove post deprecation model_path 'fog/dns/models/dnsimple' @@ -71,6 +71,12 @@ module Fog @dnsimple_email = options[:dnsimple_email] @dnsimple_password = options[:dnsimple_password] + if options[:dnsimple_url] + uri = URI.parse(options[:dnsimple_url]) + options[:host] = uri.host + options[:port] = uri.port + options[:scheme] = uri.scheme + end @host = options[:host] || "dnsimple.com" @port = options[:port] || 443 @scheme = options[:scheme] || 'https'