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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmI1Mjc3YWJmMjYzYTg5YTFhZDlkOGZiMzhhZTUwODFhZDdiNTJjMQ==
4
+ NDNiYmE0OTdjNGE4NjdmNTBmYmJkOTJmZGZhZjBmMzAzMDgxM2RiMg==
5
5
  data.tar.gz: !binary |-
6
- ODU2Mjk3NDc2YWM5MGFiNjExOTg1Nzc4Mzg1OWIxMWNlZGI1M2ZkYw==
6
+ ZGU3YzVmOGE4ODUxYjg5ZTA1NjlmZTMyMmE0ODA5NmZjMTdlZTllZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTRhNzRmYjZkYzZhYWRiNjI2MWYzZDMwNWM0OGIzYTRlOTE1ZjYwMDU4YWNm
10
- ZWMyNWFhMTdhZDBjODcwOWVlNDU3YWI5ODRhNGEwYjc0ODA5M2QyNmIxYWRh
11
- NGNiOTNmNTk3MzE1YTg3ZWQ0N2Q2NTFlYjUwODQ3ZGQ1ZDhlMjg=
9
+ Y2RkOWQwMTY4MjA1NmJjNzhhYzkzM2I3NDVhMTE5NjI2MGM0YjhhYTllNTRm
10
+ NzNmYmEwNjMyNGZkYTdkMjIwYWU0MThjMTQzMmE5YmMxNjQ4MWY3MGU2OGEw
11
+ YWFmZGM3YmI3OTlhMjA4OWQ0Y2EzYzY5M2IzZDhiNDIxOWU5NjA=
12
12
  data.tar.gz: !binary |-
13
- ZTk0ODhkOTJkMTFlYTUwNGNjMzA4N2IyYzQ1ZmFlMGFlZTdmY2JiZWE0NTY3
14
- NGQ1Mjc3MzUyMjdiOWQ4ZDQ2NzEzNzEyNDc5YzdjZWNmZDRiMjE4ODgzMmY2
15
- NDFhM2M4ZThlOTQ4MjY4ODVlMjYyYmNlNTJkMzBkODk5MDgzYmE=
13
+ NzFjMTJlMDY2ZmNiZDI2MmYyZWM0YTQyZDg1MzFkNjQwZDYwYzI2ZGU5NjAx
14
+ MTU0ZmRlYjI2MGI0ZTQ4YmMxYTAzNzE3M2JlZTIxMjBhODMxYzAxZWRjZTFk
15
+ NDAwNmRmNzI1OTBmZGU4NTdjNTNiZjI0MWQ0ZDdhOWUxMWFhZWY=
@@ -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 file. (Default: #{RedZone::Environment.default_zonefile})
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 DIR', <<-eos.strip
18
- Generates a bind database files into the given directory.
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))
@@ -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
@@ -2,5 +2,5 @@
2
2
  #
3
3
  module RedZone
4
4
  # Current version of RedZone
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redzone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justen Walker