howzit 2.1.9 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c25e3552f96db88171b65049959d0088fb2b536448cba283d5727a455932e167
4
- data.tar.gz: 22e3df773da7a22977d6959d84ed9f7ff86157dd3739163294fa9804e0571cb5
3
+ metadata.gz: 67377505c45973e38c5cc2430f2d9428ace8a5680a2bce0cfc26af369a1a98b2
4
+ data.tar.gz: bd6e00ccaf0484f486c965b0136fbd7a0cbb4af6cd7cf21c777b029c316ff13b
5
5
  SHA512:
6
- metadata.gz: 6aa7dbbb7b1ab3edad84a5b4ad99c3b4c42d396a3dc92c1f761d5717af9aa19316f5fa319ff2b1a73b94de0598302faa25dc2810229d996c8281184856084233
7
- data.tar.gz: 992349253bf9d0c89454a1bfb9601702b84fe5bda8500b54ee96ea131144568941d7c33a14ad18de22223e8aa08fae599b666466cd50ebdf00e0fd4f543f7f41
6
+ metadata.gz: 9fc93201a2080344c7ea080697ccd6a38a0c6a4a7473d98c9bbe2b18f4685ada0799cc9013358d01b7e29696e3a63d074c0e6421dbbf9db55fe69e0586efeae8
7
+ data.tar.gz: 1a627938a04104298a13ee667876f7c7559707e08a1fdecc136837af26e1c9e0130ab34fd4be1f5b1a3b79172c3d7844cec4c43d147aa1308ce8d21c2c4251ad
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 2.1.10
2
+
3
+ 2024-04-09 14:59
4
+
5
+ #### NEW
6
+
7
+ - --no option (opposite of --yes) to answer no to all yes/no prompts
8
+
1
9
  ### 2.1.9
2
10
 
3
11
  2023-09-07 11:02
data/bin/howzit CHANGED
@@ -24,7 +24,7 @@ OptionParser.new do |opts|
24
24
  opts.on('--ask', 'Request confirmation for all tasks when running a topic') { Howzit.options[:ask] = true }
25
25
 
26
26
  opts.on('--default', 'Answer all prompts with default response') do
27
- raise '--default cannot be used with --yes' if Howzit.options[:yes]
27
+ raise '--default cannot be used with --yes or --no' if Howzit.options[:yes] || Howzit.options[:no]
28
28
 
29
29
  Howzit.options[:default] = true
30
30
  end
@@ -51,6 +51,12 @@ OptionParser.new do |opts|
51
51
  Howzit.options[:yes] = true
52
52
  end
53
53
 
54
+ opts.on('-n', '--no', 'Answer no to all prompts') do
55
+ raise '--default cannot be used with --no' if Howzit.options[:default]
56
+
57
+ Howzit.options[:no] = true
58
+ end
59
+
54
60
  opts.separator "\n Listing:\n\n" #=================================================================== LISTING
55
61
 
56
62
  opts.on('-L', '--list-completions', 'List topics (completion-compatible)') do
data/lib/howzit/prompt.rb CHANGED
@@ -4,7 +4,6 @@ module Howzit
4
4
  # Command line prompt utils
5
5
  module Prompt
6
6
  class << self
7
-
8
7
  ##
9
8
  ## Display and read a Yes/No prompt
10
9
  ##
@@ -20,6 +19,8 @@ module Howzit
20
19
 
21
20
  return true if Howzit.options[:yes]
22
21
 
22
+ return false if Howzit.options[:no]
23
+
23
24
  return default if Howzit.options[:default]
24
25
 
25
26
  tty_state = `stty -g`
@@ -3,5 +3,5 @@
3
3
  # Primary module for this gem.
4
4
  module Howzit
5
5
  # Current Howzit version.
6
- VERSION = '2.1.9'
6
+ VERSION = '2.1.10'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2024-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler