r53z 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a6328887d088f1a0290e8212e2d2616a39447d8
4
- data.tar.gz: 65af835f05379a6a2b4453b539a8dea21427c7fd
3
+ metadata.gz: 4a76e281d58be3c97125591da8dd480f32cc6cb5
4
+ data.tar.gz: 68e49615f4b31b8f390e2c92c0b4eeb7d36251e4
5
5
  SHA512:
6
- metadata.gz: 84ced6e36baa5d2e5585d95547290fffc620f5426d60e953cf10644e7a5ba8deadcb9818aa8d88cf77b2863d9f6163477f13934972228a6f078ebcb7553358ff
7
- data.tar.gz: f085d157ffd9150ebc1c9c12558cada1db5a30e563f782d1bd607df472a995c5f0bc8897467ea7fda4e8d27e712f5a1497a7125ed84db04f4507aa487274c9f1
6
+ metadata.gz: 0f3e3e61987f2387d890147b5d71945b6cbb8a815ec35640f6d7c773943651d075eadd0ef19f1b7569f4dbb0f883cf30451325332e170802e98a0ef6233277a5
7
+ data.tar.gz: 90e2b3812b188c15a6f556eda3d3047eecf70fd4eeafbff9df995f2f8c671ddc71933a809433e9caa6d11afccc8b0a6e840371365d23562279f213e2d9fe561d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- r53z (0.3.0)
4
+ r53z (0.3.1)
5
5
  aws-sdk
6
6
  inifile
7
7
  methadone (~> 1.9.2)
data/bin/r53z CHANGED
@@ -17,8 +17,8 @@ class App
17
17
  description "Simple CLI to manage, backup, and restore, Route 53 zones"
18
18
  #
19
19
  # Accept flags via:
20
- on("-x", "--export", "Export zones to files in specified directory, optionally specify one or more zones.")
21
- on("-r", "--restore", "Restore zone from directory, optionally specify one or more zones.")
20
+ on("-x DIR", "--export", "Export zones to files in specified directory, optionally specify one or more zones.")
21
+ on("-r DIR", "--restore", "Restore zone from directory, optionally specify one or more zones.")
22
22
  on("-l", "--list", "List name and ID of one or all zones.")
23
23
  on("-s", "--record-sets", "List record sets for the given zone.")
24
24
  on("-c NAME", "--create", "Create a zone with the given name and optional --comment and --delegation-set.")
data/lib/r53z/cli.rb CHANGED
@@ -14,12 +14,14 @@ module R53z
14
14
  # XXX Dispatch table seems smarter...can't figure out how to call methods based
15
15
  # directly on hash keys at the moment.
16
16
  if options[:export]
17
- help_now! "Export requires a directory path for zone files" if args.length < 1
17
+ unless Dir.exists?(File.expand_path(options[:export]))
18
+ help_now! "Export requires a directory path for zone files."
19
+ end
18
20
  export(:options => options, :args => args)
19
21
  end
20
22
 
21
23
  if options[:restore]
22
- if args.empty?
24
+ unless Dir.exists?(File.expand_path(options[:restore]))
23
25
  help_now! "Restore requires a directory containing zone files and optionally one or more zones to restore."
24
26
  end
25
27
  restore(:options => options, :args => args)
@@ -73,15 +75,18 @@ module R53z
73
75
  end
74
76
 
75
77
  def export(options:, args:)
76
- path = args.shift
78
+ path = File.expand_path(options[:export])
77
79
  # If no zones, dump all zones
78
80
  zones = []
79
81
  # One zone, multiple, or all?
80
82
  if args.empty?
81
- @client.list.each do |zone|
83
+ @client.list(:delegation_set_id => options['delegation-set']).each do |zone|
82
84
  zones.push(zone[:name])
83
85
  end
84
86
  else
87
+ if options['delegation-set']
88
+ puts "--delegation-set is overridden when one or more zones are provided"
89
+ end
85
90
  zones = args
86
91
  end
87
92
 
@@ -91,7 +96,7 @@ module R53z
91
96
  end
92
97
 
93
98
  def restore(options:, args:)
94
- path = args.shift
99
+ path = File.expand_path(options[:restore])
95
100
  # If no zones, restore all zones in directory
96
101
  zones = []
97
102
  if args.empty?
data/lib/r53z/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module R53z
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r53z
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Cooper