nchosts 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- template = template(options[:template])
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
@@ -1,3 +1,3 @@
1
1
  module Nchosts
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nchosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: