howzit 2.0.21 → 2.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/bin/howzit +9 -7
- data/lib/howzit/buildnote.rb +6 -4
- 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: 7e00517a83b13075c8af7884b3a5afd683f62008f6ccc8b50015044e7625a6b7
|
4
|
+
data.tar.gz: 1918ceb4965f7a5fe127581c1dd602dfa387d8e310654f5ac7ca643ab5dd4c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 549952e3e175d9fcd5df9d85400a8abc3279ff76862e172029e974920ba85aa8ef1dfb84fcdbaff94a260a5630f49c462cd58d5a97f359735978c074b9742c2d
|
7
|
+
data.tar.gz: acb315d65c7cb1f9cf3e1ee6ef9044a1f7584b23f4bc1a7d58b39acda4851a62e58d55fe53fa227807c84f01093f3f07c6ad18070ceffda92ba05fe72f137573
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
### 2.0.22
|
2
|
+
|
3
|
+
2022-08-08 13:49
|
4
|
+
|
5
|
+
#### IMPROVED
|
6
|
+
|
7
|
+
- Paginate output of --templates
|
8
|
+
|
9
|
+
#### FIXED
|
10
|
+
|
11
|
+
- --templates attempting to create new build note
|
12
|
+
- Fix handling of paths when the same as note_file
|
13
|
+
|
1
14
|
### 2.0.21
|
2
15
|
|
3
16
|
2022-08-08 13:16
|
data/bin/howzit
CHANGED
@@ -64,25 +64,27 @@ OptionParser.new do |opts|
|
|
64
64
|
end
|
65
65
|
|
66
66
|
opts.on('--templates', 'List available templates') do
|
67
|
+
out = []
|
67
68
|
Dir.chdir(Howzit.config.template_folder)
|
68
69
|
Dir.glob('*.md').each do |file|
|
69
70
|
template = File.basename(file, '.md')
|
70
|
-
|
71
|
-
|
71
|
+
out.push(Howzit::Color.template("{Mk}template:{Yk}#{template}{x}"))
|
72
|
+
out.push(Howzit::Color.template('{bk}[{bl}tasks{bk}]──────────────────────────────────────┐{x}'))
|
72
73
|
metadata = file.extract_metadata
|
73
|
-
topics = Howzit.
|
74
|
+
topics = Howzit::BuildNote.new(file: file).topics
|
74
75
|
topics.each do |topic|
|
75
|
-
|
76
|
+
out.push(Howzit::Color.template(" {bk}│{bw}-{x} {bcK}#{template}:#{topic.title.sub(/^.*?:/, '')}{x}"))
|
76
77
|
end
|
77
78
|
unless metadata.empty?
|
78
79
|
meta = []
|
79
80
|
meta << metadata['required'].split(/\s*,\s*/).map { |m| "*{bw}#{m}{xw}" } if metadata.key?('required')
|
80
81
|
meta << metadata['optional'].split(/\s*,\s*/).map(&:to_s) if metadata.key?('optional')
|
81
|
-
|
82
|
-
|
82
|
+
out.push(Howzit::Color.template('{bk}[{bl}meta{bk}]───────────────────────────────────────┤{x}'))
|
83
|
+
out.push(Howzit::Color.template(" {bk}│ {xw}#{meta.join(', ')}{x}"))
|
83
84
|
end
|
84
|
-
|
85
|
+
out.push(Howzit::Color.template(' {bk}└───────────────────────────────────────────┘{x}'))
|
85
86
|
end
|
87
|
+
Howzit::Util.page out.join("\n")
|
86
88
|
Process.exit 0
|
87
89
|
end
|
88
90
|
|
data/lib/howzit/buildnote.rb
CHANGED
@@ -13,11 +13,13 @@ module Howzit
|
|
13
13
|
## @param file [String] The path to the build note file
|
14
14
|
##
|
15
15
|
def initialize(file: nil)
|
16
|
+
file ||= note_file
|
17
|
+
|
16
18
|
@topics = []
|
17
|
-
create_note(prompt: true) if
|
19
|
+
create_note(prompt: true) if file.nil?
|
18
20
|
|
19
|
-
content = Util.read_file(
|
20
|
-
raise "{br}No content found in build note (#{
|
21
|
+
content = Util.read_file(file)
|
22
|
+
raise "{br}No content found in build note (#{file}){x}".c if content.nil? || content.empty?
|
21
23
|
|
22
24
|
@metadata = content.split(/^#/)[0].strip.get_metadata
|
23
25
|
|
@@ -596,7 +598,7 @@ module Howzit
|
|
596
598
|
lines = sect.split(/\n/)
|
597
599
|
title = lines.slice!(0).strip
|
598
600
|
prefix = ''
|
599
|
-
if path
|
601
|
+
if path && path != note_file
|
600
602
|
if path =~ /#{Howzit.config.template_folder}/
|
601
603
|
short_path = File.basename(path, '.md')
|
602
604
|
else
|
data/lib/howzit/version.rb
CHANGED