kbsecret 0.6.4 → 0.6.5

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: ef3c6ce21470ae9c4b272d68120299f23eaba85d
4
- data.tar.gz: 0104f269fbd814723b3b9e482bdedc9636cb0872
3
+ metadata.gz: 061dc3ef77cf2be8317743c5c7a661dc906ccc66
4
+ data.tar.gz: f09cd15ecf6ca22c7660528002e131c44aa9cf82
5
5
  SHA512:
6
- metadata.gz: 022ab311dd0bc0d31214fa684f078425fb92fc8c54f8eb47103078655b0678deab27bb49b338691fe416e4b3ab66402f4e4c78cd625684d92c50035b94c396b3
7
- data.tar.gz: cf4b0df49500576fdf41d0fbf4c755510925208767670df105c6a1cbefec6fd1f5f3448c3069187be74aa3a92cc22b6582789019fccf07012a57c8f0e683bc43
6
+ metadata.gz: 5e18ecf145719006f1065ba076c079bbaaeec4adcaec38f881bb368c95f445c8992838e3017b88954fb3f86c66eaef52bac35916489a1285eeb8ed03f88fc030
7
+ data.tar.gz: b569a9c09826835a5e09dda8523960e6d062ef7c6e34ab22212345284cc259ce97c331da3910d479b70c5a41cafadefce4f3b4bc20c1ba860f5f035d0a874242
data/bin/kbsecret-list CHANGED
@@ -5,8 +5,8 @@ require "kbsecret"
5
5
 
6
6
  include KBSecret
7
7
 
8
- cmd = CLI.new do
9
- slop do |o|
8
+ cmd = CLI.create do |c|
9
+ c.slop do |o|
10
10
  o.banner = <<~EOS
11
11
  Usage:
12
12
  kbsecret list [options]
@@ -17,8 +17,8 @@ cmd = CLI.new do
17
17
  o.bool "-a", "--show-all", "show everything in each secret (i.e. metadata)"
18
18
  end
19
19
 
20
- ensure_type!
21
- ensure_session!
20
+ c.ensure_type! if c.opts[:type]
21
+ c.ensure_session!
22
22
  end
23
23
 
24
24
  records = cmd.session.records cmd.opts[:type]
data/lib/kbsecret/cli.rb CHANGED
@@ -107,6 +107,13 @@ module KBSecret
107
107
  @session = Session.new label: label
108
108
  end
109
109
 
110
+ # Ensure that a record type passed in as an option or argument is resolvable
111
+ # to a record class.
112
+ # @param where [Symbol] Where to look for the record type to test.
113
+ # If `:option` is passed, then the type is expected to be the value of the
114
+ # `--type` option. If `:argument` is passed, then the type is expected to
115
+ # be in the argument list labeled as `:type` by Dreck.
116
+ # @return [void]
110
117
  def ensure_type!(where = :option)
111
118
  type = where == :option ? @opts[:type] : @args[:type]
112
119
  Record.class_for type
data/lib/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module KBSecret
4
4
  # kbsecret's current version
5
- VERSION = "0.6.4"
5
+ VERSION = "0.6.5"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kbsecret
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff