bind9mgr 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/lib/bind9mgr.rb +1 -1
- data/lib/named_conf.rb +10 -0
- data/lib/zone.rb +0 -1
- data/spec/named_conf_spec.rb +15 -0
- metadata +4 -4
data/History.txt
CHANGED
data/lib/bind9mgr.rb
CHANGED
data/lib/named_conf.rb
CHANGED
@@ -32,6 +32,16 @@ module Bind9mgr
|
|
32
32
|
parse File.read( @file ) if File.exists?(@file)
|
33
33
|
end
|
34
34
|
|
35
|
+
# Load just one zone and return it
|
36
|
+
def load_one( zone_name )
|
37
|
+
raise ArgumentError, "Zone name expected to be a string" unless zone_name.kind_of? String
|
38
|
+
load
|
39
|
+
if zone = zones.find{ |z| z.name == zone_name }
|
40
|
+
zone.load
|
41
|
+
end
|
42
|
+
zone
|
43
|
+
end
|
44
|
+
|
35
45
|
def load_with_zones
|
36
46
|
load
|
37
47
|
zones.each{ |z| z.load}
|
data/lib/zone.rb
CHANGED
data/spec/named_conf_spec.rb
CHANGED
@@ -181,6 +181,21 @@ alias1 IN CNAME ns
|
|
181
181
|
pending "should automatically make dir for zone db files"
|
182
182
|
pending "should have methods to edit SOA values"
|
183
183
|
|
184
|
+
it "should have method to load just one zone" do
|
185
|
+
@nc.should respond_to :load_one
|
186
|
+
end
|
187
|
+
|
188
|
+
it "should load one zone on load_one call" do
|
189
|
+
Bind9mgr::Zone.any_instance.should_receive(:load).once
|
190
|
+
zone = @nc.load_one 'cloud.ru'
|
191
|
+
end
|
192
|
+
|
193
|
+
it "should return loadl zone on load_one call" do
|
194
|
+
zone = @nc.load_one 'cloud.ru'
|
195
|
+
zone.should be_kind_of Bind9mgr::Zone
|
196
|
+
zone.records.count.should > 0
|
197
|
+
end
|
198
|
+
|
184
199
|
it "'load!' should raise error if named conf file is missing" do
|
185
200
|
@nc.file = "missing.file"
|
186
201
|
expect{ @nc.load! }.to raise_error
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bind9mgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-
|
12
|
+
date: 2011-09-17 00:00:00.000000000 +04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hoe
|
17
|
-
requirement: &
|
17
|
+
requirement: &14356860 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: '2.12'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *14356860
|
26
26
|
description: This gem contains some classes to manage bind9 zone files
|
27
27
|
email:
|
28
28
|
- mikhail@mad-box.ru
|