nchosts 0.0.2 → 0.0.3
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.
- data/lib/nchosts/command.rb +8 -1
- data/lib/nchosts/version.rb +1 -1
- metadata +1 -1
data/lib/nchosts/command.rb
CHANGED
@@ -34,10 +34,17 @@ module Nchosts
|
|
34
34
|
option :format, :aliases => :f # hosts, capistrano, ssh_config
|
35
35
|
option :include # host name regexp
|
36
36
|
option :exclude # host name regexp
|
37
|
+
option :format, :aliases => :f
|
37
38
|
option :template, :aliases => :t
|
38
39
|
option :input_path, :aliases => :i
|
39
40
|
def generate
|
40
|
-
|
41
|
+
if options[:format]
|
42
|
+
template = template(options[:format])
|
43
|
+
elsif options[:template]
|
44
|
+
template = File.read(options[:template])
|
45
|
+
else
|
46
|
+
abort "Please specify :format or :template"
|
47
|
+
end
|
41
48
|
instances = JSON.parse File.read options[:input_path]
|
42
49
|
puts Erubis::Eruby.new(template).result(:instances => instances)
|
43
50
|
end
|
data/lib/nchosts/version.rb
CHANGED