splicer 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ee3f3666c4fb37ba0db7c158873b85a2e1bd83b3
4
+ data.tar.gz: ce1c2e7aa24e3721fd94aec9c53f151802799335
5
+ SHA512:
6
+ metadata.gz: bb157253f48075777154b7ed69b8c32ba6dbb22934aba83f5831c814838dbb92b32f0417fcb14227cfb82e8b12b3dc21d3218a09887fdc8f866e3a9f813b255e
7
+ data.tar.gz: 90b05fe18fea57e79e9d76dbf851b0bd1f8a118a967c356bff6502c71ed24622bc7b7737a4d498659fdb3bcf493ee8d2ff345ad303e7358ba47e69afd6423604
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .idea/
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 1.9.3
1
+ 2.1.6
data/HISTORY.md ADDED
@@ -0,0 +1 @@
1
+ Version 2.2.0 drops support for splicer-dynect 2.1.0 and prior, as it does not contain a get_records_for method
data/README.md CHANGED
@@ -86,3 +86,7 @@ If you write a provider you **MUST** follow a few rules:
86
86
  Any and all contributions are welcome. Be sure to create a feature branch and
87
87
  send pull requests. Always, always, run `rspec spec` or `rake` to ensure that
88
88
  all tests are passing.
89
+
90
+ ## Note:
91
+
92
+ As of version 2.2.0, Dynect will no longer be fully supported.
@@ -20,6 +20,10 @@ module Splicer
20
20
  def create_record_in_zone(record, zone)
21
21
  false
22
22
  end
23
+
24
+ def get_records_for(zone)
25
+ []
26
+ end
23
27
  end
24
28
 
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module Splicer
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
data/lib/splicer.rb CHANGED
@@ -54,7 +54,7 @@ module Splicer
54
54
 
55
55
  # @return [void]
56
56
  def self.create_zone(zone)
57
- return false unless zone.is_a?(Splicer::Zone)
57
+ return false if zone_is_invalid(zone)
58
58
  providers.each do |provider|
59
59
  provider.create_zone(zone)
60
60
  end
@@ -62,7 +62,7 @@ module Splicer
62
62
 
63
63
  # @return [void]
64
64
  def self.delete_zone(zone)
65
- return false unless zone.is_a?(Splicer::Zone)
65
+ return false if zone_is_invalid(zone)
66
66
  providers.each do |provider|
67
67
  provider.delete_zone(zone)
68
68
  end
@@ -70,8 +70,7 @@ module Splicer
70
70
 
71
71
  # @return [void]
72
72
  def self.create_record_in_zone(record, zone)
73
- return false unless zone.is_a?(Splicer::Zone)
74
- return false unless record.is_a?(Splicer::Records::Record)
73
+ return false if domain_information_is_invalid(record, zone)
75
74
  providers.each do |provider|
76
75
  provider.create_record_in_zone(record, zone)
77
76
  end
@@ -79,18 +78,30 @@ module Splicer
79
78
 
80
79
  # @return [void]
81
80
  def self.update_record_in_zone(record, zone)
82
- return false unless zone.is_a?(Splicer::Zone)
83
- return false unless record.is_a?(Splicer::Records::Record)
81
+ return false if domain_information_is_invalid(record, zone)
84
82
  providers.each do |provider|
85
83
  provider.update_record_in_zone(record, zone)
86
84
  end
87
85
  end
88
86
 
87
+ # Fetches list of associated records
88
+ # @returns an array of Record objects
89
+ def self.get_records_for(zone)
90
+ return [] if zone_is_invalid(zone)
91
+ providers.map { |provider| provider.get_records_for(zone)}.flatten
92
+ # records = []
93
+ # providers.each do |provider|
94
+ # result = provider.get_records_for(zone)
95
+ # next unless result
96
+ # result.each { |record| records << record }
97
+ # end
98
+ # records
99
+ end
100
+
89
101
  # Deletes a record from a zone
90
102
  # @return [void]
91
103
  def self.delete_record_in_zone(record, zone)
92
- return false unless zone.is_a?(Splicer::Zone)
93
- return false unless record.is_a?(Splicer::Records::Record)
104
+ return false if domain_information_is_invalid(record, zone)
94
105
  providers.each do |provider|
95
106
  provider.delete_record_in_zone(record, zone)
96
107
  end
@@ -101,4 +112,13 @@ module Splicer
101
112
  def self.logger
102
113
  @@logger || NullObject.new
103
114
  end
115
+
116
+ def self.domain_information_is_invalid(record, zone)
117
+ !record.is_a?(Splicer::Records::Record) || zone_is_invalid(zone)
118
+ end
119
+
120
+ def self.zone_is_invalid(zone)
121
+ !zone.is_a?(Splicer::Zone)
122
+ end
123
+
104
124
  end
@@ -8,8 +8,8 @@ describe Splicer::Configuration do
8
8
  end
9
9
 
10
10
  describe '#initialize' do
11
- subject { config }
12
- its(:providers) { should eq([]) }
11
+ subject { config.providers }
12
+ it { should eq([]) }
13
13
  end
14
14
 
15
15
  describe '#register' do
@@ -7,26 +7,31 @@ describe Splicer::Provider do
7
7
 
8
8
  describe '#create_zone' do
9
9
  subject { provider.create_zone(zone) }
10
- it { should be_false }
10
+ it { should be_falsy }
11
11
  end
12
12
 
13
13
  describe '#delete_zone' do
14
14
  subject { provider.delete_zone(zone) }
15
- it { should be_false }
15
+ it { should be_falsy }
16
16
  end
17
17
 
18
18
  describe '#create_record_in_zone' do
19
19
  subject { provider.create_record_in_zone(record, zone) }
20
- it { should be_false }
20
+ it { should be_falsy }
21
21
  end
22
22
 
23
23
  describe '#update_record_in_zone' do
24
24
  subject { provider.update_record_in_zone(record, zone) }
25
- it { should be_false }
25
+ it { should be_falsy }
26
26
  end
27
27
 
28
28
  describe '#delete_record_in_zone' do
29
29
  subject { provider.delete_record_in_zone(record, zone) }
30
- it { should be_false }
30
+ it { should be_falsy }
31
+ end
32
+
33
+ describe '#get_records_for' do
34
+ subject { provider.get_records_for(zone) }
35
+ it { should eq([]) }
31
36
  end
32
37
  end
@@ -12,8 +12,14 @@ describe Splicer::Zone do
12
12
 
13
13
  describe '#initialize' do
14
14
  subject { zone }
15
- its(:name) { should eq('example.com') }
16
- its(:records) { should eq([]) }
15
+
16
+ it "is expected to have :name equal to 'example.com'" do
17
+ expect(zone.name).to eq('example.com')
18
+ end
19
+
20
+ it 'is expected to see records return an empty array' do
21
+ expect(zone.records).to eq([])
22
+ end
17
23
  end
18
24
 
19
25
  describe '#add_record' do
data/splicer.gemspec CHANGED
@@ -6,11 +6,11 @@ require 'splicer/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "splicer"
8
8
  spec.version = Splicer::VERSION
9
- spec.authors = ["Matthew Johnston"]
10
- spec.email = ["warmwaffles@gmail.com"]
9
+ spec.authors = ["Matthew Johnston", "Joshua Stowers"]
10
+ spec.email = ["warmwaffles@gmail.com", "joshua@pressable.com"]
11
11
  spec.description = %q{Splicer allows communication with one or more dns providers}
12
- spec.summary = %q{Splicer allows communication with one or more dns providers}
13
- spec.homepage = "https://github.com/zippykid/splicer"
12
+ spec.summary = %q{Use this gem if you are using multiple DNS providers, and want a unified interface to manage each of them simultaneously}
13
+ spec.homepage = "https://github.com/pressable/splicer"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rspec"
21
+ spec.add_development_dependency 'bundler', '~> 1.3', '>= 1.3.0'
22
+ spec.add_development_dependency 'rake', '~> 10.4', '>= 10.4.0'
23
+ spec.add_development_dependency 'rspec', '~> 3.4.0', '>= 3.4.0'
24
24
  end
metadata CHANGED
@@ -1,76 +1,90 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splicer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
5
- prerelease:
4
+ version: 2.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matthew Johnston
8
+ - Joshua Stowers
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-30 00:00:00.000000000 Z
12
+ date: 2015-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
17
  requirements:
19
- - - ~>
18
+ - - "~>"
20
19
  - !ruby/object:Gem::Version
21
20
  version: '1.3'
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.3.0
22
24
  type: :development
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
27
  requirements:
27
- - - ~>
28
+ - - "~>"
28
29
  - !ruby/object:Gem::Version
29
30
  version: '1.3'
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.0
30
34
  - !ruby/object:Gem::Dependency
31
35
  name: rake
32
36
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
37
  requirements:
35
- - - ! '>='
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.4'
41
+ - - ">="
36
42
  - !ruby/object:Gem::Version
37
- version: '0'
43
+ version: 10.4.0
38
44
  type: :development
39
45
  prerelease: false
40
46
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
47
  requirements:
43
- - - ! '>='
48
+ - - "~>"
44
49
  - !ruby/object:Gem::Version
45
- version: '0'
50
+ version: '10.4'
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 10.4.0
46
54
  - !ruby/object:Gem::Dependency
47
55
  name: rspec
48
56
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
57
  requirements:
51
- - - ! '>='
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 3.4.0
61
+ - - ">="
52
62
  - !ruby/object:Gem::Version
53
- version: '0'
63
+ version: 3.4.0
54
64
  type: :development
55
65
  prerelease: false
56
66
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
67
  requirements:
59
- - - ! '>='
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: 3.4.0
71
+ - - ">="
60
72
  - !ruby/object:Gem::Version
61
- version: '0'
73
+ version: 3.4.0
62
74
  description: Splicer allows communication with one or more dns providers
63
75
  email:
64
76
  - warmwaffles@gmail.com
77
+ - joshua@pressable.com
65
78
  executables: []
66
79
  extensions: []
67
80
  extra_rdoc_files: []
68
81
  files:
69
- - .gitignore
70
- - .rspec
71
- - .ruby-gemset
72
- - .ruby-version
82
+ - ".gitignore"
83
+ - ".rspec"
84
+ - ".ruby-gemset"
85
+ - ".ruby-version"
73
86
  - Gemfile
87
+ - HISTORY.md
74
88
  - LICENSE.txt
75
89
  - README.md
76
90
  - Rakefile
@@ -109,37 +123,31 @@ files:
109
123
  - spec/splicer/zone_spec.rb
110
124
  - spec/splicer_spec.rb
111
125
  - splicer.gemspec
112
- homepage: https://github.com/zippykid/splicer
126
+ homepage: https://github.com/pressable/splicer
113
127
  licenses:
114
128
  - MIT
129
+ metadata: {}
115
130
  post_install_message:
116
131
  rdoc_options: []
117
132
  require_paths:
118
133
  - lib
119
134
  required_ruby_version: !ruby/object:Gem::Requirement
120
- none: false
121
135
  requirements:
122
- - - ! '>='
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
- segments:
126
- - 0
127
- hash: -800734796650687555
128
139
  required_rubygems_version: !ruby/object:Gem::Requirement
129
- none: false
130
140
  requirements:
131
- - - ! '>='
141
+ - - ">="
132
142
  - !ruby/object:Gem::Version
133
143
  version: '0'
134
- segments:
135
- - 0
136
- hash: -800734796650687555
137
144
  requirements: []
138
145
  rubyforge_project:
139
- rubygems_version: 1.8.25
146
+ rubygems_version: 2.2.3
140
147
  signing_key:
141
- specification_version: 3
142
- summary: Splicer allows communication with one or more dns providers
148
+ specification_version: 4
149
+ summary: Use this gem if you are using multiple DNS providers, and want a unified
150
+ interface to manage each of them simultaneously
143
151
  test_files:
144
152
  - spec/spec_helper.rb
145
153
  - spec/splicer/configuration_spec.rb