bogo-cli 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b01bbff8ee153a763c6d8e1b9e8eb1ee909b5e0
4
- data.tar.gz: 812895d1225324fdc72550628d797d99c423b334
3
+ metadata.gz: 40194be8698b033b66a7dadb2c61bb9d20246f72
4
+ data.tar.gz: c6dc9e1f1b35404392d7b8b9912162e10e10d537
5
5
  SHA512:
6
- metadata.gz: b07e0bd539268efaadadbc242681665ba12deb00890bf7a2b2c54edee5ad7ce530fe1615debc7f0ff0b3954a8d172c55a18fdab29b73e3abae2575cd563d393a
7
- data.tar.gz: 8d1bb2e5973ecee71daeb3b3259e2508f681a3f6523ebed2d1085b1b82549c83fa271e78b4f53f9cb3dac2f708a1b5725bd16e447e9b0bf27c8d38dc48d9f600
6
+ metadata.gz: 4a66838856489350680bdbc65b79222baf0f27f7ea886cd5243841c865e703706a87c0dd57489dbec806a7bebda5c9dfe55a819095cc9fbc97fd1b059f94a69c
7
+ data.tar.gz: 126c6b4e5daabf8d71665b0860e7f934a528b2c31ef263ceb548271d0f55d419920069b0750b57dfc85f23e7c9eef6a86161051d69702b8fdd3d3f7d0c2eab20
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.1.6
2
+ * Remove options when value is nil (fixes merging issues)
3
+ * Proxy options to Ui instance when building
4
+ * Rescue ScriptError explicitly as it's not within StandardError
5
+
1
6
  ## v0.1.4
2
7
  * Force passed options to Hash type and covert to Smash
3
8
  * Force passed options keys to snake case
@@ -20,11 +20,12 @@ module Bogo
20
20
  def initialize(opts, args)
21
21
  @options = opts.to_hash.to_smash(:snake)
22
22
  @arguments = args
23
- @ui = options.delete(:ui) || Ui.new(
23
+ ui_args = Smash.new(
24
24
  :app_name => options.fetch(:app_name,
25
25
  self.class.name.split('::').first
26
26
  )
27
- )
27
+ ).merge(@options)
28
+ @ui = options.delete(:ui) || Ui.new(ui_args)
28
29
  load_config!
29
30
  end
30
31
 
@@ -59,7 +60,7 @@ module Bogo
59
60
  config = Bogo::Config.new(path) if path
60
61
  end
61
62
  if(config)
62
- merge_opts = options.to_smash
63
+ merge_opts = Smash[options.to_smash.map{|k,v| [k,v] unless v.nil?}.compact]
63
64
  merge_opts.delete(:config)
64
65
  @options = config.to_smash.deep_merge(merge_opts)
65
66
  end
@@ -15,7 +15,7 @@ module Bogo
15
15
  Slop.parse(:help => true) do
16
16
  instance_exec(&block)
17
17
  end
18
- rescue => e
18
+ rescue StandardError, ScriptError => e
19
19
  if(ENV['DEBUG'])
20
20
  $stderr.puts "ERROR: #{e.class}: #{e}\n#{e.backtrace.join("\n")}"
21
21
  else
@@ -1,5 +1,5 @@
1
1
  module Bogo
2
2
  module Cli
3
- VERSION = Gem::Version.new('0.1.4')
3
+ VERSION = Gem::Version.new('0.1.6')
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-30 00:00:00.000000000 Z
11
+ date: 2015-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo