hansolo 0.0.1.alpha.2 → 0.0.1.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/hansolo CHANGED
@@ -41,9 +41,13 @@ optparse = OptionParser.new do |opts|
41
41
  end
42
42
  end.parse!(ARGV)
43
43
 
44
- opts = conf_options.merge(options).inject({}){|m,(k,v)| m[k.to_sym] = v; m}
44
+ unless conf_options.any?
45
+ default_conf_filename = File.expand_path(File.join(".",".hansolo.json"))
46
+ conf_options = JSON.parse(File.read(default_conf_filename)) if File.exists?(default_conf_filename)
47
+ end
48
+
45
49
 
46
- puts opts.inspect
50
+ opts = conf_options.merge(options).inject({}){|m,(k,v)| m[k.to_sym] = v; m}
47
51
 
48
52
  h = Hansolo::Cli.new conf_options.merge(opts)
49
53
  h.all!
data/lib/hansolo.rb CHANGED
@@ -182,19 +182,19 @@ __END__
182
182
  This is a simple cli program to automate deploy using chef-solo and
183
183
  berkshelf.
184
184
 
185
- If you pass a filename, put in JSON for the configuration. So in hans.json:
185
+ If you pass a filename, put in JSON for the configuration. So in .hansolo.json:
186
186
 
187
187
  { "keydir": "/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/keys/vagrant" }
188
188
 
189
189
  Then you can pass to the command as:
190
190
 
191
- $ hansolo -c hans.json
191
+ $ hansolo -c .hansolo.json
192
192
 
193
193
  NOTE: Command-line args trump config settings.
194
194
 
195
195
  Example Usage:
196
196
 
197
- $ hansolo -t /tmp/myapp.cookbooks \
197
+ $ hansolo -s approval -t /tmp/myapp.cookbooks \
198
198
 
199
199
  -k /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/keys/vagrant \
200
200
 
@@ -202,4 +202,9 @@ Example Usage:
202
202
 
203
203
  -r apt::default,myapp::deploy
204
204
 
205
- $ hansolo -c hans.json
205
+ $ hansolo -s approval -c .hansolo.json
206
+
207
+ $ hansolo -s approval
208
+
209
+ NOTE: You don't need to pass -c if you use the filename .hansolo.json. Passing -c
210
+ will override reading this default.
@@ -1,3 +1,3 @@
1
1
  module Hansolo
2
- VERSION = "0.0.1.alpha.2"
2
+ VERSION = "0.0.1.alpha.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hansolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha.2
4
+ version: 0.0.1.alpha.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-11 00:00:00.000000000 Z
12
+ date: 2013-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk