doing 2.1.82 → 2.1.84
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 +16 -0
- data/Gemfile.lock +1 -1
- data/README.md +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/ByDayExport.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 +1 -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 +12 -3
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- data/docs/doc/Doing/TemplateString.html +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/top-level-namespace.html +1 -1
- data/doing.rdoc +1 -1
- data/lib/doing/configuration.rb +15 -2
- data/lib/doing/hash.rb +1 -1
- data/lib/doing/template_string.rb +2 -1
- data/lib/doing/time.rb +4 -4
- data/lib/doing/version.rb +1 -1
- data/lib/doing.rb +2 -2
- metadata +2 -2
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.84
|
|
9
9
|
|
|
10
10
|
=== Global Options
|
|
11
11
|
=== --config_file arg
|
data/lib/doing/configuration.rb
CHANGED
|
@@ -44,6 +44,15 @@ module Doing
|
|
|
44
44
|
'timer_format' => 'text',
|
|
45
45
|
'interval_format' => 'text',
|
|
46
46
|
|
|
47
|
+
'order' => 'asc',
|
|
48
|
+
|
|
49
|
+
'shortdate_format' => {
|
|
50
|
+
'today' => '%_I:%M%P',
|
|
51
|
+
'this_week' => '%a %_I:%M%P',
|
|
52
|
+
'this_month' => '%m/%d %_I:%M%P',
|
|
53
|
+
'older' => '%m/%d/%y %_I:%M%P'
|
|
54
|
+
},
|
|
55
|
+
|
|
47
56
|
'templates' => {
|
|
48
57
|
'default' => {
|
|
49
58
|
'date_format' => '%Y-%m-%d %H:%M',
|
|
@@ -200,7 +209,7 @@ module Doing
|
|
|
200
209
|
## matched, first match wins)
|
|
201
210
|
## @return [Array] ordered array of resolved keys
|
|
202
211
|
##
|
|
203
|
-
def resolve_key_path(keypath, create: false, distance: 2)
|
|
212
|
+
def resolve_key_path(keypath, create: false, distance: 2, exact: false)
|
|
204
213
|
cfg = @settings
|
|
205
214
|
real_path = []
|
|
206
215
|
unless keypath =~ /^[.*]?$/
|
|
@@ -211,7 +220,11 @@ module Doing
|
|
|
211
220
|
new_cfg = nil
|
|
212
221
|
|
|
213
222
|
if cfg.is_a?(Hash)
|
|
214
|
-
matches =
|
|
223
|
+
matches = if exact
|
|
224
|
+
cfg.select { |key, _| key == path }
|
|
225
|
+
else
|
|
226
|
+
cfg.select { |key, _| key =~ path.to_rx(distance: distance) }
|
|
227
|
+
end
|
|
215
228
|
if matches.count.positive?
|
|
216
229
|
shortest = matches.keys.group_by(&:length).min.last[0]
|
|
217
230
|
real_path << shortest
|
data/lib/doing/hash.rb
CHANGED
|
@@ -99,7 +99,7 @@ module Doing
|
|
|
99
99
|
#
|
|
100
100
|
def deep_set(path, value)
|
|
101
101
|
if path.count == 1
|
|
102
|
-
if value.nil? || value =~ /^ *$/
|
|
102
|
+
if value.nil? || (value.is_a?(String) && value =~ /^ *$/) || (value.is_a?(Array) && value.empty?)
|
|
103
103
|
delete(path[0])
|
|
104
104
|
else
|
|
105
105
|
self[path[0]] = value
|
|
@@ -116,7 +116,8 @@ module Doing
|
|
|
116
116
|
pad = m['width'].to_i
|
|
117
117
|
mark = m['mchar'] || ''
|
|
118
118
|
if placeholder == 'shortdate' && m['width'].nil?
|
|
119
|
-
|
|
119
|
+
fmt_string = Doing.setting('shortdate_format.older', '%m/%d/%y %_I:%M%P', exact: true)
|
|
120
|
+
pad = Date.today.strftime(fmt_string).length
|
|
120
121
|
end
|
|
121
122
|
indent = nil
|
|
122
123
|
if m['ichar']
|
data/lib/doing/time.rb
CHANGED
|
@@ -12,13 +12,13 @@ module Doing
|
|
|
12
12
|
#
|
|
13
13
|
def relative_date
|
|
14
14
|
if self > Date.today.to_time
|
|
15
|
-
strftime('%_I:%M%P')
|
|
15
|
+
strftime(Doing.setting('shortdate_format.today', '%_I:%M%P', exact: true))
|
|
16
16
|
elsif self > (Date.today - 6).to_time
|
|
17
|
-
strftime('%a %_I:%M%P')
|
|
17
|
+
strftime(Doing.setting('shortdate_format.this_week', '%a %_I:%M%P', exact: true))
|
|
18
18
|
elsif year == Date.today.year || (year + 1 == Date.today.year && month > Date.today.month)
|
|
19
|
-
strftime('%m/%d %_I:%M%P')
|
|
19
|
+
strftime(Doing.setting('shortdate_format.this_month', '%m/%d %_I:%M%P', exact: true))
|
|
20
20
|
else
|
|
21
|
-
strftime('%m/%d/%y %_I:%M%P')
|
|
21
|
+
strftime(Doing.setting('shortdate_format.older', '%m/%d/%y %_I:%M%P', exact: true))
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
data/lib/doing/version.rb
CHANGED
data/lib/doing.rb
CHANGED
|
@@ -106,14 +106,14 @@ module Doing
|
|
|
106
106
|
## @param default A default value to return if the
|
|
107
107
|
## provided path returns nil result
|
|
108
108
|
##
|
|
109
|
-
def setting(keypath, default = nil)
|
|
109
|
+
def setting(keypath, default = nil, exact: false)
|
|
110
110
|
cfg = config.settings
|
|
111
111
|
case keypath
|
|
112
112
|
when Array
|
|
113
113
|
cfg.dig(*keypath) || default
|
|
114
114
|
when String
|
|
115
115
|
unless keypath =~ /^[.*]?$/
|
|
116
|
-
real_path = config.resolve_key_path(keypath, create: false)
|
|
116
|
+
real_path = config.resolve_key_path(keypath, create: false, distance: 0, exact: exact)
|
|
117
117
|
return default unless real_path&.count&.positive?
|
|
118
118
|
|
|
119
119
|
cfg = cfg.dig(*real_path)
|
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.84
|
|
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-
|
|
11
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: github-markup
|