redzone 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/redzone/cli.rb +7 -5
- data/lib/redzone/environment.rb +7 -0
- data/lib/redzone/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDNiYmE0OTdjNGE4NjdmNTBmYmJkOTJmZGZhZjBmMzAzMDgxM2RiMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGU3YzVmOGE4ODUxYjg5ZTA1NjlmZTMyMmE0ODA5NmZjMTdlZTllZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2RkOWQwMTY4MjA1NmJjNzhhYzkzM2I3NDVhMTE5NjI2MGM0YjhhYTllNTRm
|
10
|
+
NzNmYmEwNjMyNGZkYTdkMjIwYWU0MThjMTQzMmE5YmMxNjQ4MWY3MGU2OGEw
|
11
|
+
YWFmZGM3YmI3OTlhMjA4OWQ0Y2EzYzY5M2IzZDhiNDIxOWU5NjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzFjMTJlMDY2ZmNiZDI2MmYyZWM0YTQyZDg1MzFkNjQwZDYwYzI2ZGU5NjAx
|
14
|
+
MTU0ZmRlYjI2MGI0ZTQ4YmMxYTAzNzE3M2JlZTIxMjBhODMxYzAxZWRjZTFk
|
15
|
+
NDAwNmRmNzI1OTBmZGU4NTdjNTNiZjI0MWQ0ZDdhOWUxMWFhZWY=
|
data/lib/redzone/cli.rb
CHANGED
@@ -7,18 +7,20 @@ module RedZone
|
|
7
7
|
# RedZone Command-line actions
|
8
8
|
class Cli < Thor
|
9
9
|
package_name 'RedZone'
|
10
|
-
class_option :zones, :type => :string, :desc => <<-eos.strip
|
11
|
-
RedZone zone
|
10
|
+
class_option :zones, :type => :string, :default => RedZone::Environment.default_zonefile ,:desc => <<-eos.strip
|
11
|
+
RedZone zone configuration.
|
12
12
|
eos
|
13
13
|
#class_option :config, :type => :string, :desc => <<-eos.strip
|
14
14
|
# RedZone configuration file. (Default: #{RedZone::Environment.default_configfile})
|
15
15
|
#eos
|
16
16
|
|
17
|
-
desc 'generate
|
18
|
-
Generates a bind database files into the given
|
17
|
+
desc 'generate [DIRECTORY]', <<-eos.strip
|
18
|
+
Generates a bind database files into the given DIRECTORY.
|
19
|
+
If DIRECTORY is not supplied, it defaults to '#{RedZone::Environment.default_var_named}'
|
19
20
|
eos
|
20
21
|
# Generates a bind database files into the given directory.
|
21
|
-
def generate(dir)
|
22
|
+
def generate(dir=nil)
|
23
|
+
target = dir || RedZone::Environment.default_var_named.to_s
|
22
24
|
c = ZoneConfig.new(options[:zones])
|
23
25
|
writer = ZonefileWriter.new(c)
|
24
26
|
writer.write_zones(Pathname.new(dir))
|
data/lib/redzone/environment.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
1
3
|
module RedZone
|
2
4
|
# RedZone environment properties
|
3
5
|
module Environment
|
@@ -11,6 +13,11 @@ module RedZone
|
|
11
13
|
def self.default_zonefile
|
12
14
|
self.default_etc.join('zones.yml')
|
13
15
|
end
|
16
|
+
# Get the default location of the zone file
|
17
|
+
# @return [Pathname] default zones.yml path
|
18
|
+
def self.default_var_named
|
19
|
+
Pathname.new('/var/named')
|
20
|
+
end
|
14
21
|
# Get the default location of the config file
|
15
22
|
# @return [Pathname] default config.yml path
|
16
23
|
def self.default_configfile
|
data/lib/redzone/version.rb
CHANGED