splicer-dns_made_easy 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjAzMjQ4NjVmNWZlMTdiZjAwZDMxMWNmMTlhMjJiODMzYzQ5OTA4Mg==
5
+ data.tar.gz: !binary |-
6
+ ZTk1MTA4Y2JmOTY3ZThhOGU2MDhhMzUyZTczN2I3ZGQ1ZDQzMjg0NQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzU0Y2RmOWM3NDQwMGYyNGM4Y2EyYjg5ZThmN2E3MDQ5MThlNDZhM2RmMGYy
10
+ N2RkNDYxNTU4MmQzZmFhNWU4NGJmMTg1NjNiODdiNTg3YTAwODgzMzQ2ZTFh
11
+ Mjc0NjRhYTI5ZTY1M2I4MzdiYTEwMTdjOGFkMGIxY2ZmZjhjN2I=
12
+ data.tar.gz: !binary |-
13
+ ZGQzNGY4MmJiYThlYTRiNzRiMjYxMzAzMTBhMTJlNjE3Yzc3ODNkNWM5NTQ5
14
+ MDc4ODNhNTIwMGI1MTkyOWFhZDhiZDFkYTU2MzViZTU2ZTM3NDIyNmMwYjU1
15
+ MGVjNmM5NDI1YWYyNDMxNjE2NGQ2MThmYjZiODFhMDEzOTZlM2Q=
@@ -11,11 +11,19 @@ module Splicer
11
11
  #
12
12
  # @author Matthew A. Johnston
13
13
  class Client
14
+
15
+ DEFAULT_END_POINTS = {
16
+ :sandbox => "https://api.sandbox.dnsmadeeasy.com/V2.0",
17
+ :live => "https://api.dnsmadeeasy.com/V2.0"
18
+ }
19
+
14
20
  # @param [String] key
15
21
  # @param [String] secret
16
- def initialize(key, secret)
22
+ def initialize(key, secret, options = {})
17
23
  @key = key
18
24
  @secret = secret
25
+ @api_mode = options[:api_mode] || :live
26
+ @use_ssl = options[:use_ssl]
19
27
  end
20
28
 
21
29
  # @param [String] resource the resource path
@@ -116,7 +124,15 @@ module Splicer
116
124
  end
117
125
 
118
126
  def resource_url(resource)
119
- ["https://api.dnsmadeeasy.com/V2.0", resource.gsub(/^\//,'')].join('/')
127
+ [base_url, resource.gsub(/^\//,'')].join('/')
128
+ end
129
+
130
+ def base_url
131
+ if @use_ssl
132
+ DEFAULT_END_POINTS[@api_mode]
133
+ else
134
+ DEFAULT_END_POINTS[@api_mode].sub('https', 'http')
135
+ end
120
136
  end
121
137
 
122
138
  end
@@ -2,11 +2,13 @@ module Splicer
2
2
  module DnsMadeEasy
3
3
 
4
4
  class Config
5
- attr_reader :key, :secret
5
+ attr_reader :key, :secret, :api_mode, :use_ssl
6
6
 
7
- def initialize(key, secret)
7
+ def initialize(key, secret, options = {})
8
8
  @key = key
9
9
  @secret = secret
10
+ @api_mode = options[:api_mode] || :live
11
+ @use_ssl = options[:use_ssl]
10
12
  end
11
13
 
12
14
  def provider
@@ -7,7 +7,7 @@ module Splicer
7
7
 
8
8
  def initialize(config)
9
9
  @config = config
10
- @client = Client.new(config.key, config.secret)
10
+ @client = Client.new(config.key, config.secret, api_mode: config.api_mode, use_ssl: config.use_ssl)
11
11
  end
12
12
 
13
13
  def create_zone(zone)
@@ -1,5 +1,5 @@
1
1
  module Splicer
2
2
  module DnsMadeEasy
3
- VERSION = "2.1.1"
3
+ VERSION = "2.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splicer-dns_made_easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
5
- prerelease:
4
+ version: 2.1.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matthew Johnston
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-30 00:00:00.000000000 Z
11
+ date: 2015-08-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: splicer
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rest-client
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: bundler
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -124,33 +113,26 @@ files:
124
113
  homepage: https://github.com/zippykid/dns_made_easy
125
114
  licenses:
126
115
  - MIT
116
+ metadata: {}
127
117
  post_install_message:
128
118
  rdoc_options: []
129
119
  require_paths:
130
120
  - lib
131
121
  required_ruby_version: !ruby/object:Gem::Requirement
132
- none: false
133
122
  requirements:
134
123
  - - ! '>='
135
124
  - !ruby/object:Gem::Version
136
125
  version: '0'
137
- segments:
138
- - 0
139
- hash: 2898526824841093068
140
126
  required_rubygems_version: !ruby/object:Gem::Requirement
141
- none: false
142
127
  requirements:
143
128
  - - ! '>='
144
129
  - !ruby/object:Gem::Version
145
130
  version: '0'
146
- segments:
147
- - 0
148
- hash: 2898526824841093068
149
131
  requirements: []
150
132
  rubyforge_project:
151
- rubygems_version: 1.8.25
133
+ rubygems_version: 2.4.5
152
134
  signing_key:
153
- specification_version: 3
135
+ specification_version: 4
154
136
  summary: The splicer adapter for interacting DnsMadeEasy
155
137
  test_files:
156
138
  - spec/spec_helper.rb