ultradns-sdk 0.0.4 → 0.0.5

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: 022ce047b720fbed64b50289908118bb10ffdd10
4
- data.tar.gz: 01f4b615c5329e6c61cdc248cf1b5b602c8af7d2
3
+ metadata.gz: 1e7c73a8161b279c698da154ad9c3a2deb7f6d3d
4
+ data.tar.gz: 5c533fac88f1b4d0e537a0529d8f6479897e1784
5
5
  SHA512:
6
- metadata.gz: a8e4cfe27ba7f547f467b25b1b767ba72cad1ca16e2917badabb7d4d07bcfe95fc3601f0fa04097e1f0d3f0ff99ba2251f6c4ed393d17d4ed729bf10f7dd5422
7
- data.tar.gz: 1794c9643093bac2ac7c0a689fe7f573d85253e4ecf393e70f8d277423409d90546b2f36368b191c41d4493c334ebcf5bfbff11c8dd46023d076c9ce70474da5
6
+ metadata.gz: 63e9dbb43a3a65875c8d45c27ac52c550d0254829db649c4376083b5c35e2ca0b9bc189d9712dfa30a81e23303d0f8b9a8b7871b3bf6d16742cdfbef6972ab87
7
+ data.tar.gz: ee6e8c5538de7e069e41b312c5fe3e6f966485d7f560d03f1ad5b1017584b6aee8128d18a9fd16f1d0b8a72899130fae87436fae4251876d3c623ed01ecf26a4
@@ -51,7 +51,16 @@ class Ultradns::Client
51
51
 
52
52
  @options = {}
53
53
  # override or ignored if nil
54
- @options[:base_uri] = HTTParty.normalize_base_uri(options[:host]) if options[:host]
54
+
55
+ default_base_uri = URI(self.class.default_options[:base_uri])
56
+
57
+ if options[:host]
58
+ host = options[:host].prepend("#{default_base_uri.scheme}://")
59
+ host << default_base_uri.path
60
+ @options[:base_uri] = HTTParty.normalize_base_uri(host)
61
+ elsif options[:base_uri] # take whatever they provide
62
+ @options[:base_uri] = HTTParty.normalize_base_uri(options[:base_uri])
63
+ end
55
64
 
56
65
  auth(username, password, @options[:base_uri] || self.class.default_options[:base_uri])
57
66
 
@@ -5,5 +5,5 @@
5
5
  # of their respective owners.
6
6
 
7
7
  module Ultradns
8
- VERSION = "0.0.4"
8
+ VERSION = "0.0.5"
9
9
  end
@@ -18,7 +18,7 @@ class TestClientApi < Minitest::Unit::TestCase
18
18
 
19
19
  def test_different_base_uri
20
20
  VCR.use_cassette('test_different_base_uri') do
21
- client = Ultradns::Client.new(@user, @pw, host: 'test-restapi.ultradns.com:443/v1')
21
+ client = Ultradns::Client.new(@user, @pw, host: 'test-restapi.ultradns.com:443')
22
22
 
23
23
  result = client.status
24
24
  assert result['message'] != nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultradns-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ultradns