bogo-cli 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: c3d995cac00e17670f4b08c185c248f79a5bc4da9dfd99f5cd3ee38740c37045
4
- data.tar.gz: c381604451c5b15fc8d2d521ed4dee69e52b73684895f8c94827d3f30db71ca1
3
+ metadata.gz: d4899068cfae5c27459a405ce500100febf1c43918ab3541b3a35d47b55f769a
4
+ data.tar.gz: 17c47fda512f339c3add1f6da24b5ab469e366f3f92f41159882c7f37be5bf00
5
5
  SHA512:
6
- metadata.gz: b27998591ca5eeef1eacb675d53232028328b11d28164eb93563c0fe37ec1464333d3ad002a13a8304e602b02e3d6eecf5a3e463ae0232f7744e780af5158293
7
- data.tar.gz: 1c2faafec7efb8f6cc1f17f188b903ee2ebca11ba30ce040244e1c292cc0dc07474cf5a53d9b794cc078c4d6685a0d383282614c95b6dfdfcbc0713eed2f0350
6
+ metadata.gz: fe2e5e9e5383aae4cec18487f747b5103e4d149c9d86b605efe875fa34dbd0704a6d0474168988a2754bdae45b3768181860309078b039f0602dc2cc4d45cfce
7
+ data.tar.gz: 5757757b97cf2c0a28c5bbb97fd2320bfc2718998147fca391b3876d8eda7fe58b016a004f36dccf6817653b0a37e0bd91331c306a9a17f07e6bdb47f0f8e1af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.3.2
2
+ * Format option keys for long flags with dashes (#16)
3
+
1
4
  # v0.3.1
2
5
  * Add context for option parsing (#15)
3
6
 
@@ -181,9 +181,8 @@ module Bogo
181
181
  ui.puts result
182
182
  end
183
183
  end
184
- rescue => e
184
+ rescue
185
185
  ui.puts ui.color("error!", :red, :bold)
186
- ui.error "Reason - #{e}"
187
186
  raise
188
187
  end
189
188
  true
@@ -1,3 +1,4 @@
1
+ require 'bogo'
1
2
  require 'forwardable'
2
3
  require 'optparse'
3
4
  require 'ostruct'
@@ -29,11 +30,13 @@ module Bogo
29
30
  end
30
31
 
31
32
  def assign(key, value)
33
+ key = key.to_s.gsub("-", "_").to_sym
32
34
  @sets[key] = value
33
35
  self
34
36
  end
35
37
 
36
38
  def set_default(key, value)
39
+ key = key.to_s.gsub("-", "_").to_sym
37
40
  @defaults[key] = value
38
41
  self
39
42
  end
@@ -39,7 +39,7 @@ module Bogo
39
39
  err_msg << "\n#{err.original.message}"
40
40
  end
41
41
  output_error err_msg
42
- if ENV["DEBUG"]
42
+ if ENV["DEBUG"] || (Command.ui && Command.ui.options[:debug])
43
43
  output_debug "Stacktrace: #{err.class}: " \
44
44
  "#{err.message}\n#{err.backtrace.join("\n")}"
45
45
  if err.respond_to?(:original) && err.original
@@ -1,6 +1,6 @@
1
1
  module Bogo
2
2
  module Cli
3
3
  # Current library version
4
- VERSION = Gem::Version.new("0.3.1")
4
+ VERSION = Gem::Version.new("0.3.2")
5
5
  end
6
6
  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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2023-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.4.0.dev
130
+ rubygems_version: 3.5.0.dev
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: CLI Helper libraries