kbsecret 1.3.1 → 1.4.0

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: f5096766df8cb40aca59c626cfb079b60a1fde19912466cfee3a9d1ec0e9ae7d
4
- data.tar.gz: 870442aec6217f0038f767f4fdedb80d82315dff1f9b4a4435d36b1f1db6ba70
3
+ metadata.gz: d36c466b014040ccc18ae97f0ca8f999a7942af80a34abfbe6fcecdb249b9f56
4
+ data.tar.gz: 913153e1e2eb46a226fac687f60b950a8ce5203f4cf7176bde429f8d2319e3d2
5
5
  SHA512:
6
- metadata.gz: 3c3123a44c9b93ee97061f3b46af3e06f4f7b3c3088575c3b77a7422a6ad46bac97b051e80717b7e213de3da97a409d3c7188dd55ae01f7b733387b1de1380cc
7
- data.tar.gz: a945c491b63aeabe485f7532a11d5ae924ced16737730015f098a0ccfab2a0ee4ef1997cbb96d4a503d0377713f83dd2509f078189666c40628c71673761e717
6
+ metadata.gz: e74758e57e82932978a3f1cc99a253201e8cd656cdf2f7701ea80f160f0d4bd09285743a71ba4002661319bbf74b3bcb3a24634151ee4111519833f183660f37
7
+ data.tar.gz: 0f9086c6ef1d798c4db789f8cc4639ffaccaf42eb4a009fd44c15e21e5ad873c2614c9bde7eecfba7b256e187176d26f6be2ead3ed6caa84eef0927601f109cc
data/bin/kbsecret CHANGED
@@ -20,10 +20,6 @@ def migrate_configs
20
20
  FileUtils.rm_rf old_conf_dir
21
21
  end
22
22
 
23
- def flag?(cmd)
24
- FLAG_ALIASES.keys.include?(cmd)
25
- end
26
-
27
23
  def normalize(cmd)
28
24
  KBSecret::Config.unalias_command(FLAG_ALIASES[cmd])
29
25
  end
@@ -51,6 +51,7 @@ module KBSecret
51
51
 
52
52
  # Starts the todo associated with the current invocation, unless already started.
53
53
  # @return [void]
54
+ # @api private
54
55
  def start_todo
55
56
  cli.die "That task is already started!" if @todo.started?
56
57
  @todo.start!
@@ -59,6 +60,7 @@ module KBSecret
59
60
 
60
61
  # Suspends the todo associated with the current invocation, unless already suspended.
61
62
  # @return [void]
63
+ # @api private
62
64
  def suspend_todo
63
65
  cli.die "That task is already suspended!" if @todo.suspended?
64
66
  @todo.suspend!
@@ -67,6 +69,7 @@ module KBSecret
67
69
 
68
70
  # Completes the todo associated with the current invocation, unless already completed.
69
71
  # @return [void]
72
+ # @api private
70
73
  def complete_todo
71
74
  cli.die "That task is already completed!" if @todo.completed?
72
75
  @todo.complete!
data/lib/kbsecret/cli.rb CHANGED
@@ -159,7 +159,8 @@ module KBSecret
159
159
  # @param msg [String] the message to print
160
160
  # @return [void]
161
161
  def info(msg)
162
- self.class.stderr.puts "#{GREEN["Info"]}: #{msg}"
162
+ info = ENV["NO_COLOR"] ? "Info" : GREEN["Info"]
163
+ self.class.stderr.puts "#{info}: #{msg}"
163
164
  end
164
165
 
165
166
  # Print an information message, but only if verbose output has been enabled.
@@ -184,7 +185,8 @@ module KBSecret
184
185
  # @return [void]
185
186
  def warn(msg)
186
187
  return if @opts.no_warn?
187
- self.class.stderr.puts "#{YELLOW["Warning"]}: #{msg}"
188
+ warning = ENV["NO_COLOR"] ? "Warning" : YELLOW["Warning"]
189
+ self.class.stderr.puts "#{warning}: #{msg}"
188
190
  end
189
191
 
190
192
  # Print an error message and terminate.
@@ -192,8 +194,8 @@ module KBSecret
192
194
  # @return [void]
193
195
  # @note This method does not return!
194
196
  def die(msg)
195
- pretty = "#{RED["Fatal"]}: #{msg}"
196
- abort pretty
197
+ fatal = ENV["NO_COLOR"] ? "Fatal" : RED["Fatal"]
198
+ abort "#{fatal}: #{msg}"
197
199
  end
198
200
 
199
201
  # Print an error message and terminate.
@@ -201,8 +203,8 @@ module KBSecret
201
203
  # @return [void]
202
204
  # @note This method does not return!
203
205
  def self.die(msg)
204
- pretty = "#{RED["Fatal"]}: #{msg}"
205
- abort pretty
206
+ fatal = ENV["NO_COLOR"] ? "Fatal" : RED["Fatal"]
207
+ abort "#{fatal}: #{msg}"
206
208
  end
207
209
 
208
210
  # Finds a reasonable default field separator by checking the environment first
@@ -2,5 +2,5 @@
2
2
 
3
3
  module KBSecret
4
4
  # kbsecret's current version
5
- VERSION = "1.3.1"
5
+ VERSION = "1.4.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kbsecret
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-04 00:00:00.000000000 Z
11
+ date: 2018-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  requirements: []
267
267
  rubyforge_project:
268
- rubygems_version: 2.7.3
268
+ rubygems_version: 2.7.6
269
269
  signing_key:
270
270
  specification_version: 4
271
271
  summary: kbsecret - A KBFS (Keybase) backed secret manager.