doing 2.1.61 → 2.1.62
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/commands/view.rb +1 -1
- data/docs/doc/Array.html +1 -1
- data/docs/doc/BooleanTermParser/Clause.html +1 -1
- data/docs/doc/BooleanTermParser/Operator.html +1 -1
- data/docs/doc/BooleanTermParser/Query.html +1 -1
- data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
- data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
- data/docs/doc/BooleanTermParser.html +1 -1
- data/docs/doc/Doing/ArrayCleanup.html +1 -1
- data/docs/doc/Doing/ArrayNestedHash.html +1 -1
- data/docs/doc/Doing/ArrayTags.html +1 -1
- data/docs/doc/Doing/CSVExport.html +1 -1
- data/docs/doc/Doing/CalendarImport.html +1 -1
- data/docs/doc/Doing/Change.html +1 -1
- data/docs/doc/Doing/Changes.html +1 -1
- data/docs/doc/Doing/ChronifyArray.html +1 -1
- data/docs/doc/Doing/ChronifyNumeric.html +1 -1
- data/docs/doc/Doing/ChronifyString.html +1 -1
- data/docs/doc/Doing/Color.html +6 -1
- data/docs/doc/Doing/Completion/BashCompletions.html +1 -1
- data/docs/doc/Doing/Completion/FigCompletions.html +1 -1
- data/docs/doc/Doing/Completion/FishCompletions.html +1 -1
- data/docs/doc/Doing/Completion/StringUtils.html +1 -1
- data/docs/doc/Doing/Completion/ZshCompletions.html +1 -1
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +1 -1
- data/docs/doc/Doing/DayOneRenderer.html +1 -1
- data/docs/doc/Doing/DayoneExport.html +1 -1
- data/docs/doc/Doing/DoingExport.html +1 -1
- data/docs/doc/Doing/DoingImport.html +1 -1
- data/docs/doc/Doing/Entry.html +1 -1
- data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
- data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
- data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
- data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
- data/docs/doc/Doing/Errors/HistoryLimitError.html +1 -1
- data/docs/doc/Doing/Errors/InvalidPlugin.html +1 -1
- data/docs/doc/Doing/Errors/MissingBackupFile.html +1 -1
- data/docs/doc/Doing/Errors/NoResults.html +1 -1
- data/docs/doc/Doing/Errors/PluginException.html +1 -1
- data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
- data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
- data/docs/doc/Doing/Errors.html +1 -1
- data/docs/doc/Doing/HTMLExport.html +1 -1
- data/docs/doc/Doing/Hooks.html +1 -1
- data/docs/doc/Doing/Item.html +2 -2
- data/docs/doc/Doing/ItemDates.html +1 -1
- data/docs/doc/Doing/ItemQuery.html +1 -1
- data/docs/doc/Doing/ItemState.html +1 -1
- data/docs/doc/Doing/ItemTags.html +1 -1
- data/docs/doc/Doing/Items.html +1 -1
- data/docs/doc/Doing/JSONExport.html +1 -1
- data/docs/doc/Doing/JSONImport.html +1 -1
- data/docs/doc/Doing/Logger.html +1 -1
- data/docs/doc/Doing/MarkdownExport.html +1 -1
- data/docs/doc/Doing/Note.html +1 -1
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +1 -1
- data/docs/doc/Doing/Prompt.html +2 -2
- data/docs/doc/Doing/PromptChoose.html +1 -1
- data/docs/doc/Doing/PromptFZF.html +1 -1
- data/docs/doc/Doing/PromptInput.html +1 -1
- data/docs/doc/Doing/PromptSTD.html +1 -1
- data/docs/doc/Doing/PromptYN.html +1 -1
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/StringHighlight.html +1 -1
- data/docs/doc/Doing/StringNormalize.html +1 -1
- data/docs/doc/Doing/StringQuery.html +1 -1
- data/docs/doc/Doing/StringTags.html +1 -1
- data/docs/doc/Doing/StringTransform.html +1 -1
- data/docs/doc/Doing/StringTruncate.html +1 -1
- data/docs/doc/Doing/StringURL.html +1 -1
- data/docs/doc/Doing/SymbolNormalize.html +1 -1
- data/docs/doc/Doing/TaskPaperExport.html +1 -1
- data/docs/doc/Doing/TemplateExport.html +2 -2
- data/docs/doc/Doing/TemplateString.html +3 -3
- data/docs/doc/Doing/TimingImport.html +1 -1
- data/docs/doc/Doing/Types.html +1 -1
- data/docs/doc/Doing/Util/Backup.html +1 -1
- data/docs/doc/Doing/Util.html +1 -1
- data/docs/doc/Doing/Version.html +1 -1
- data/docs/doc/Doing/WWID.html +2 -2
- data/docs/doc/Doing.html +2 -2
- data/docs/doc/FalseClass.html +1 -1
- data/docs/doc/GLI/Commands/Help.html +1 -1
- data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/docs/doc/GLI/Commands.html +1 -1
- data/docs/doc/GLI.html +1 -1
- data/docs/doc/Hash.html +1 -1
- data/docs/doc/Numeric.html +1 -1
- data/docs/doc/Object.html +1 -1
- data/docs/doc/PhraseParser/Operator.html +1 -1
- data/docs/doc/PhraseParser/PhraseClause.html +1 -1
- data/docs/doc/PhraseParser/Query.html +1 -1
- data/docs/doc/PhraseParser/QueryParser.html +1 -1
- data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
- data/docs/doc/PhraseParser/TermClause.html +1 -1
- data/docs/doc/PhraseParser.html +1 -1
- data/docs/doc/Status.html +1 -1
- data/docs/doc/String.html +65 -2
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +1 -1
- data/docs/doc/TrueClass.html +1 -1
- data/docs/doc/_index.html +1 -1
- data/docs/doc/file.README.html +2 -2
- data/docs/doc/index.html +2 -2
- data/docs/doc/method_list.html +554 -546
- data/docs/doc/top-level-namespace.html +1 -1
- data/doing.rdoc +1 -1
- data/lib/doing/colors.rb +57 -0
- data/lib/doing/string/highlight.rb +6 -7
- data/lib/doing/version.rb +1 -1
- metadata +2 -2
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
</div>
|
|
217
217
|
|
|
218
218
|
<div id="footer">
|
|
219
|
-
Generated on
|
|
219
|
+
Generated on Fri Jul 1 10:30:16 2022 by
|
|
220
220
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
221
221
|
0.9.27 (ruby-3.0.1).
|
|
222
222
|
</div>
|
data/doing.rdoc
CHANGED
|
@@ -5,7 +5,7 @@ record of what you've been doing, complete with tag-based time tracking. The
|
|
|
5
5
|
command line tool allows you to add entries, annotate with tags and notes, and
|
|
6
6
|
view your entries with myriad options, with a focus on a "natural" language syntax.
|
|
7
7
|
|
|
8
|
-
v2.1.
|
|
8
|
+
v2.1.62
|
|
9
9
|
|
|
10
10
|
=== Global Options
|
|
11
11
|
=== --config_file arg
|
data/lib/doing/colors.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
module Doing
|
|
5
5
|
# Terminal output color functions.
|
|
6
6
|
module Color
|
|
7
|
+
ESCAPE_REGEX = /(?<=\[)(?:(?:(?:[349]|10)[0-9]|[0-9])?;?)+(?=m)/.freeze
|
|
7
8
|
# All available color names. Available as methods and string extensions.
|
|
8
9
|
#
|
|
9
10
|
# @example Use a color as a method. Color reset will be added to end of string.
|
|
@@ -125,6 +126,62 @@ module Doing
|
|
|
125
126
|
def normalize_color
|
|
126
127
|
gsub(/_/, '').sub(/bright/i, 'bold').sub(/bgbold/, 'boldbg')
|
|
127
128
|
end
|
|
129
|
+
|
|
130
|
+
# Get the calculated ANSI color at the end of the
|
|
131
|
+
# string
|
|
132
|
+
#
|
|
133
|
+
# @return ANSI escape sequence to match color
|
|
134
|
+
#
|
|
135
|
+
def last_color_code
|
|
136
|
+
m = scan(ESCAPE_REGEX)
|
|
137
|
+
|
|
138
|
+
em = ['0']
|
|
139
|
+
fg = nil
|
|
140
|
+
bg = nil
|
|
141
|
+
rgbf = nil
|
|
142
|
+
rgbb = nil
|
|
143
|
+
|
|
144
|
+
m.each do |c|
|
|
145
|
+
case c
|
|
146
|
+
when '0'
|
|
147
|
+
em = ['0']
|
|
148
|
+
fg, bg, rgbf, rgbb = nil
|
|
149
|
+
when /^[34]8/
|
|
150
|
+
case c
|
|
151
|
+
when /^3/
|
|
152
|
+
fg = nil
|
|
153
|
+
rgbf = c
|
|
154
|
+
when /^4/
|
|
155
|
+
bg = nil
|
|
156
|
+
rgbb = c
|
|
157
|
+
end
|
|
158
|
+
else
|
|
159
|
+
c.split(/;/).each do |i|
|
|
160
|
+
x = i.to_i
|
|
161
|
+
if x <= 9
|
|
162
|
+
em << x
|
|
163
|
+
elsif x >= 30 && x <= 39
|
|
164
|
+
rgbf = nil
|
|
165
|
+
fg = x
|
|
166
|
+
elsif x >= 40 && x <= 49
|
|
167
|
+
rgbb = nil
|
|
168
|
+
bg = x
|
|
169
|
+
elsif x >= 90 && x <= 97
|
|
170
|
+
rgbf = nil
|
|
171
|
+
fg = x
|
|
172
|
+
elsif x >= 100 && x <= 107
|
|
173
|
+
rgbb = nil
|
|
174
|
+
bg = x
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
escape = "\e[#{em.join(';')}m"
|
|
181
|
+
escape += "\e[#{rgbb}m" if rgbb
|
|
182
|
+
escape += "\e[#{rgbf}m" if rgbf
|
|
183
|
+
escape + "\e[#{[fg, bg].delete_if(&:nil?).join(';')}m"
|
|
184
|
+
end
|
|
128
185
|
end
|
|
129
186
|
|
|
130
187
|
class << self
|
|
@@ -17,14 +17,9 @@ module Doing
|
|
|
17
17
|
##
|
|
18
18
|
def highlight_tags(color = 'yellow', last_color: nil)
|
|
19
19
|
unless last_color
|
|
20
|
-
escapes = scan(/(\e\[[\d;]+m)[^\e]+@/)
|
|
21
20
|
color = color.split(' ') unless color.is_a?(Array)
|
|
22
21
|
tag_color = color.each_with_object([]) { |c, arr| arr << Doing::Color.send(c) }.join('')
|
|
23
|
-
last_color =
|
|
24
|
-
(escapes.count > 1 ? escapes[-2..-1] : [escapes[-1]]).map { |v| v[0] }.join('')
|
|
25
|
-
else
|
|
26
|
-
Doing::Color.default
|
|
27
|
-
end
|
|
22
|
+
last_color = last_color_code
|
|
28
23
|
end
|
|
29
24
|
gsub(/(\s|m)(@[^ ("']+)/, "\\1#{tag_color}\\2#{last_color}")
|
|
30
25
|
end
|
|
@@ -54,7 +49,11 @@ module Doing
|
|
|
54
49
|
qs.concat(query[:should]) if query[:should]
|
|
55
50
|
qs.each do |s|
|
|
56
51
|
rx = Regexp.new(s.wildcard_to_rx, ignore_case(s, case_type))
|
|
57
|
-
out.gsub!(rx)
|
|
52
|
+
out.gsub!(rx) do
|
|
53
|
+
m = Regexp.last_match
|
|
54
|
+
last = m.pre_match.last_color_code
|
|
55
|
+
"#{m[0].bgyellow.black}#{last}"
|
|
56
|
+
end
|
|
58
57
|
end
|
|
59
58
|
end
|
|
60
59
|
out
|
data/lib/doing/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: doing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.62
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: github-markup
|