howzit 1.2.16 → 1.2.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/CHANGELOG.md +25 -0
- data/bin/howzit +10 -10
- data/lib/howzit/buildnote.rb +2 -2
- data/lib/howzit/prompt.rb +2 -2
- data/lib/howzit/topic.rb +3 -1
- data/lib/howzit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8b16b06b6f594b321d2226b4985c51330b437cda97528e120b09e1bfa9d777c
|
4
|
+
data.tar.gz: fda79561390a39336c2bfe2aa94de7c6d81ce97b71e8721cf91066ec495d4080
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e20d289047b1824e0f882895b580703003514c09424dbd848a461d7ed1680b2368d5ac0f11143a0fdd21eaab80a23545c0e4ceb131964003b442c8f112654a1b
|
7
|
+
data.tar.gz: 4b5af891c82a9e1dcaec9177a025336d023873114e87ce906f1a0cdaa49845e02d113e60d90395fbbde2568a99b0766af3c889d4f8786e4f24e36d52a408c2a7
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
### 1.2.19
|
2
|
+
|
3
|
+
2022-08-03 12:18
|
4
|
+
|
5
|
+
#### FIXED
|
6
|
+
|
7
|
+
- --config-get returning non-default options
|
8
|
+
|
9
|
+
### 1.2.18
|
10
|
+
|
11
|
+
2022-08-03 12:13
|
12
|
+
|
13
|
+
#### FIXED
|
14
|
+
|
15
|
+
- Unwritable content property
|
16
|
+
|
17
|
+
### 1.2.17
|
18
|
+
|
19
|
+
2022-08-03 12:10
|
20
|
+
|
21
|
+
#### FIXED
|
22
|
+
|
23
|
+
- Variables in topics not being replaced with metadata
|
24
|
+
- Allow default response in yes/no prompt
|
25
|
+
|
1
26
|
### 1.2.16
|
2
27
|
|
3
28
|
2022-08-03 11:41
|
data/bin/howzit
CHANGED
@@ -95,9 +95,9 @@ OptionParser.new do |opts|
|
|
95
95
|
|
96
96
|
opts.on('--config-get [KEY]', 'Display the configuration settings or setting for a specific key') do |k|
|
97
97
|
if k.nil?
|
98
|
-
Howzit.
|
98
|
+
Howzit::Config::DEFAULTS.sort_by { |key, _| key }.each do |key, val|
|
99
99
|
print "#{key}: "
|
100
|
-
p
|
100
|
+
p Howzit.options[key]
|
101
101
|
end
|
102
102
|
else
|
103
103
|
k.sub!(/^:/, '')
|
@@ -126,7 +126,7 @@ OptionParser.new do |opts|
|
|
126
126
|
Process.exit 0
|
127
127
|
end
|
128
128
|
|
129
|
-
opts.on('--edit-config',
|
129
|
+
opts.on('--edit-config', 'Edit configuration file using default $EDITOR') do
|
130
130
|
Howzit.config.editor
|
131
131
|
Process.exit 0
|
132
132
|
end
|
@@ -141,20 +141,20 @@ OptionParser.new do |opts|
|
|
141
141
|
Dir.glob('*.md').each do |file|
|
142
142
|
template = File.basename(file, '.md')
|
143
143
|
puts Howzit::Color.template("{Mk}template:{Yk}#{template}{x}")
|
144
|
-
puts Howzit::Color.template(
|
144
|
+
puts Howzit::Color.template('{bk}[{bl}tasks{bk}]──────────────────────────────────────┐{x}')
|
145
145
|
metadata = file.extract_metadata
|
146
146
|
topics = Howzit.buildnote.read_file(file)
|
147
147
|
topics.each do |topic|
|
148
148
|
puts Howzit::Color.template(" {bk}│{bw}-{x} {bcK}#{template}:#{topic.title.sub(/^.*?:/, '')}{x}")
|
149
149
|
end
|
150
|
-
|
150
|
+
unless metadata.empty?
|
151
151
|
meta = []
|
152
|
-
meta << metadata['required'].split(/\s*,\s*/).map {|m| "*{bw}#{m}{xw}" } if metadata.key?('required')
|
153
|
-
meta << metadata['optional'].split(/\s*,\s*/).map
|
154
|
-
puts Howzit::Color.template(
|
155
|
-
puts Howzit::Color.template(" {bk}│ {xw}#{meta.join(
|
152
|
+
meta << metadata['required'].split(/\s*,\s*/).map { |m| "*{bw}#{m}{xw}" } if metadata.key?('required')
|
153
|
+
meta << metadata['optional'].split(/\s*,\s*/).map(&:to_s) if metadata.key?('optional')
|
154
|
+
puts Howzit::Color.template('{bk}[{bl}meta{bk}]───────────────────────────────────────┤{x}')
|
155
|
+
puts Howzit::Color.template(" {bk}│ {xw}#{meta.join(', ')}{x}")
|
156
156
|
end
|
157
|
-
puts Howzit::Color.template(
|
157
|
+
puts Howzit::Color.template(' {bk}└───────────────────────────────────────────┘{x}')
|
158
158
|
end
|
159
159
|
Process.exit 0
|
160
160
|
end
|
data/lib/howzit/buildnote.rb
CHANGED
@@ -9,7 +9,7 @@ module Howzit
|
|
9
9
|
|
10
10
|
def initialize(file: nil, args: [])
|
11
11
|
@topics = []
|
12
|
-
@metadata =
|
12
|
+
@metadata = IO.read(note_file).split(/^#/)[0].strip.get_metadata
|
13
13
|
|
14
14
|
read_help(file)
|
15
15
|
end
|
@@ -274,7 +274,6 @@ module Howzit
|
|
274
274
|
|
275
275
|
if leader.length > 0
|
276
276
|
data = leader.get_metadata
|
277
|
-
@metadata = @metadata.merge(data)
|
278
277
|
|
279
278
|
if data.key?('template')
|
280
279
|
templates = data['template'].strip.split(/\s*,\s*/)
|
@@ -380,6 +379,7 @@ module Howzit
|
|
380
379
|
title = "#{short_path}:#{title}"
|
381
380
|
end
|
382
381
|
topic = Topic.new(title, prefix + lines.join("\n").strip.render_template(@metadata))
|
382
|
+
|
383
383
|
topics.push(topic)
|
384
384
|
end
|
385
385
|
|
data/lib/howzit/prompt.rb
CHANGED
@@ -14,7 +14,7 @@ module Howzit
|
|
14
14
|
res.chomp!
|
15
15
|
puts
|
16
16
|
system 'stty cooked'
|
17
|
-
|
17
|
+
res.empty? ? default : res =~ /y/i
|
18
18
|
end
|
19
19
|
|
20
20
|
def color_single_options(choices = %w[y n])
|
@@ -46,7 +46,7 @@ module Howzit
|
|
46
46
|
'-0',
|
47
47
|
'-1',
|
48
48
|
'-m',
|
49
|
-
"--height=#{matches.count +
|
49
|
+
"--height=#{matches.count + 3}",
|
50
50
|
'--header="Use tab to mark multiple selections, enter to display/run"',
|
51
51
|
'--prompt="Select a section > "'
|
52
52
|
]
|
data/lib/howzit/topic.rb
CHANGED
data/lib/howzit/version.rb
CHANGED