doing 2.1.1pre → 2.1.5pre
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/.yardoc/checksums +19 -15
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/CHANGELOG.md +58 -8
- data/Gemfile.lock +25 -1
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/bin/doing +447 -149
- data/doc/Array.html +63 -1
- data/doc/BooleanTermParser/Clause.html +293 -0
- data/doc/BooleanTermParser/Operator.html +172 -0
- data/doc/BooleanTermParser/Query.html +417 -0
- data/doc/BooleanTermParser/QueryParser.html +135 -0
- data/doc/BooleanTermParser/QueryTransformer.html +124 -0
- data/doc/BooleanTermParser.html +115 -0
- data/doc/Doing/CLIFormat.html +131 -0
- data/doc/Doing/Color.html +2 -2
- data/doc/Doing/Completion.html +1 -1
- data/doc/Doing/Configuration.html +168 -73
- data/doc/Doing/Errors/DoingNoTraceError.html +1 -1
- data/doc/Doing/Errors/DoingRuntimeError.html +1 -1
- data/doc/Doing/Errors/DoingStandardError.html +1 -1
- data/doc/Doing/Errors/EmptyInput.html +1 -1
- data/doc/Doing/Errors/NoResults.html +1 -1
- data/doc/Doing/Errors/PluginException.html +1 -1
- data/doc/Doing/Errors/UserCancelled.html +1 -1
- data/doc/Doing/Errors/WrongCommand.html +1 -1
- data/doc/Doing/Errors.html +1 -1
- data/doc/Doing/Hooks.html +1 -1
- data/doc/Doing/Item.html +177 -86
- data/doc/Doing/Items.html +36 -2
- data/doc/Doing/LogAdapter.html +70 -1
- data/doc/Doing/Note.html +5 -134
- data/doc/Doing/Pager.html +1 -1
- data/doc/Doing/Plugins.html +380 -40
- data/doc/Doing/Prompt.html +70 -18
- data/doc/Doing/Section.html +1 -1
- data/doc/Doing/TemplateString.html +713 -0
- data/doc/Doing/Util/Backup.html +686 -0
- data/doc/Doing/Util.html +16 -4
- data/doc/Doing/WWID.html +133 -73
- data/doc/Doing.html +4 -4
- data/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/doc/GLI/Commands.html +1 -1
- data/doc/GLI.html +1 -1
- data/doc/Hash.html +1 -1
- data/doc/PhraseParser/Operator.html +172 -0
- data/doc/PhraseParser/PhraseClause.html +303 -0
- data/doc/PhraseParser/Query.html +495 -0
- data/doc/PhraseParser/QueryParser.html +136 -0
- data/doc/PhraseParser/QueryTransformer.html +124 -0
- data/doc/PhraseParser/TermClause.html +293 -0
- data/doc/PhraseParser.html +115 -0
- data/doc/Status.html +1 -1
- data/doc/String.html +319 -13
- data/doc/Symbol.html +35 -1
- data/doc/Time.html +70 -2
- data/doc/_index.html +132 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/method_list.html +648 -160
- data/doc/top-level-namespace.html +2 -2
- data/doing.gemspec +3 -0
- data/doing.rdoc +263 -82
- data/lib/completion/doing.bash +18 -18
- data/lib/doing/array.rb +9 -0
- data/lib/doing/boolean_term_parser.rb +86 -0
- data/lib/doing/configuration.rb +63 -24
- data/lib/doing/item.rb +112 -10
- data/lib/doing/items.rb +6 -0
- data/lib/doing/log_adapter.rb +28 -0
- data/lib/doing/note.rb +31 -30
- data/lib/doing/phrase_parser.rb +124 -0
- data/lib/doing/plugin_manager.rb +57 -13
- data/lib/doing/plugins/export/dayone_export.rb +209 -0
- data/lib/doing/plugins/export/template_export.rb +113 -81
- data/lib/doing/prompt.rb +26 -13
- data/lib/doing/string.rb +114 -29
- data/lib/doing/string_chronify.rb +5 -1
- data/lib/doing/symbol.rb +4 -0
- data/lib/doing/template_string.rb +197 -0
- data/lib/doing/time.rb +32 -0
- data/lib/doing/util.rb +6 -7
- data/lib/doing/util_backup.rb +287 -0
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +152 -55
- data/lib/doing.rb +9 -0
- data/lib/templates/doing-dayone-entry.erb +6 -0
- data/lib/templates/doing-dayone.erb +5 -0
- metadata +85 -2
data/lib/doing/wwid.rb
CHANGED
|
@@ -183,7 +183,25 @@ module Doing
|
|
|
183
183
|
|
|
184
184
|
date = nil
|
|
185
185
|
iso_rx = /\d{4}-\d\d-\d\d \d\d:\d\d/
|
|
186
|
-
|
|
186
|
+
watch_tags = [
|
|
187
|
+
'start(?:ed)?',
|
|
188
|
+
'beg[ia]n',
|
|
189
|
+
'done',
|
|
190
|
+
'finished',
|
|
191
|
+
'completed?',
|
|
192
|
+
'waiting',
|
|
193
|
+
'defer(?:red)?'
|
|
194
|
+
]
|
|
195
|
+
if @config['date_tags']
|
|
196
|
+
date_tags = @config['date_tags']
|
|
197
|
+
date_tags = date_tags.split(/ *, */) if date_tags.is_a?(String)
|
|
198
|
+
date_tags.map! do |tag|
|
|
199
|
+
tag.sub(/^@/, '').gsub(/\((?!\?:)(.*?)\)/, '(?:\1)').strip
|
|
200
|
+
end
|
|
201
|
+
watch_tags.concat(date_tags).uniq!
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
done_rx = /(?<=^| )@(?<tag>#{watch_tags.join('|')})\((?<date>.*?)\)/i
|
|
187
205
|
date_rx = /^(?:\s*- )?(?<date>.*?) \| (?=\S)/
|
|
188
206
|
|
|
189
207
|
title.gsub!(done_rx) do
|
|
@@ -244,7 +262,7 @@ module Doing
|
|
|
244
262
|
return frag.cap_first if @content.section?(frag)
|
|
245
263
|
|
|
246
264
|
section = nil
|
|
247
|
-
re = frag.
|
|
265
|
+
re = frag.to_rx(distance: 2, case_type: :ignore)
|
|
248
266
|
sections.each do |sect|
|
|
249
267
|
next unless sect =~ /#{re}/i
|
|
250
268
|
|
|
@@ -286,7 +304,7 @@ module Doing
|
|
|
286
304
|
def guess_view(frag, guessed: false, suggest: false)
|
|
287
305
|
views.each { |view| return view if frag.downcase == view.downcase }
|
|
288
306
|
view = false
|
|
289
|
-
re = frag.
|
|
307
|
+
re = frag.to_rx(distance: 2, case_type: :ignore)
|
|
290
308
|
views.each do |v|
|
|
291
309
|
next unless v =~ /#{re}/i
|
|
292
310
|
|
|
@@ -423,8 +441,9 @@ module Doing
|
|
|
423
441
|
# @param item [Item] the item to reset/resume
|
|
424
442
|
# @param resume [Boolean] removing @done tag if true
|
|
425
443
|
#
|
|
426
|
-
def reset_item(item, resume: false)
|
|
427
|
-
|
|
444
|
+
def reset_item(item, date: nil, resume: false)
|
|
445
|
+
date ||= Time.now
|
|
446
|
+
item.date = date
|
|
428
447
|
item.tag('done', remove: true) if resume
|
|
429
448
|
logger.info('Reset:', %(Reset #{resume ? 'and resumed ' : ''} "#{item.title}" in #{item.section}))
|
|
430
449
|
item
|
|
@@ -528,10 +547,25 @@ module Doing
|
|
|
528
547
|
last_entry
|
|
529
548
|
end
|
|
530
549
|
|
|
531
|
-
def all_tags(items, opt: {})
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
550
|
+
def all_tags(items, opt: {}, counts: false)
|
|
551
|
+
if counts
|
|
552
|
+
all_tags = {}
|
|
553
|
+
items.each do |item|
|
|
554
|
+
item.tags.each do |tag|
|
|
555
|
+
if all_tags.key?(tag.downcase)
|
|
556
|
+
all_tags[tag.downcase] += 1
|
|
557
|
+
else
|
|
558
|
+
all_tags[tag.downcase] = 1
|
|
559
|
+
end
|
|
560
|
+
end
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
all_tags.sort_by { |tag, count| count }
|
|
564
|
+
else
|
|
565
|
+
all_tags = []
|
|
566
|
+
items.each { |item| all_tags.concat(item.tags.map(&:downcase)).uniq! }
|
|
567
|
+
all_tags.sort
|
|
568
|
+
end
|
|
535
569
|
end
|
|
536
570
|
|
|
537
571
|
def tag_groups(items, opt: {})
|
|
@@ -656,6 +690,7 @@ module Doing
|
|
|
656
690
|
end
|
|
657
691
|
|
|
658
692
|
if keep && opt[:tag]
|
|
693
|
+
opt[:tag_bool] = opt[:bool].normalize_bool if opt[:bool]
|
|
659
694
|
opt[:tag_bool] ||= :and
|
|
660
695
|
tag_match = opt[:tag].nil? || opt[:tag].empty? ? true : item.tags?(opt[:tag], opt[:tag_bool])
|
|
661
696
|
keep = false unless tag_match
|
|
@@ -666,7 +701,7 @@ module Doing
|
|
|
666
701
|
search_match = if opt[:search].nil? || opt[:search].empty?
|
|
667
702
|
true
|
|
668
703
|
else
|
|
669
|
-
item.search(opt[:search], case_type: opt[:case].normalize_case
|
|
704
|
+
item.search(opt[:search], case_type: opt[:case].normalize_case)
|
|
670
705
|
end
|
|
671
706
|
|
|
672
707
|
keep = false unless search_match
|
|
@@ -708,7 +743,7 @@ module Doing
|
|
|
708
743
|
|
|
709
744
|
keep = false if keep && opt[:only_timed] && !item.interval
|
|
710
745
|
|
|
711
|
-
if keep && opt[:tag_filter]
|
|
746
|
+
if keep && opt[:tag_filter]
|
|
712
747
|
keep = item.tags?(opt[:tag_filter]['tags'], opt[:tag_filter]['bool'])
|
|
713
748
|
keep = opt[:not] ? !keep : keep
|
|
714
749
|
end
|
|
@@ -745,7 +780,7 @@ module Doing
|
|
|
745
780
|
|
|
746
781
|
keep
|
|
747
782
|
end
|
|
748
|
-
count = opt[:count]&.positive? ? opt[:count] : filtered_items.
|
|
783
|
+
count = opt[:count].to_i&.positive? ? opt[:count].to_i : filtered_items.count
|
|
749
784
|
|
|
750
785
|
output = Items.new
|
|
751
786
|
|
|
@@ -914,12 +949,19 @@ module Doing
|
|
|
914
949
|
if opt[:resume] && !opt[:reset]
|
|
915
950
|
repeat_item(item, { editor: opt[:editor] })
|
|
916
951
|
elsif opt[:reset]
|
|
952
|
+
res = Prompt.enter_text('Start date (blank for current time)', default_response: '')
|
|
953
|
+
if res =~ /^ *$/
|
|
954
|
+
date = Time.now
|
|
955
|
+
else
|
|
956
|
+
date = res.chronify(guess: :begin)
|
|
957
|
+
end
|
|
958
|
+
|
|
917
959
|
res = if item.tags?('done', :and) && !opt[:resume]
|
|
918
960
|
opt[:force] ? true : Prompt.yn('Remove @done tag?', default_response: 'y')
|
|
919
961
|
else
|
|
920
962
|
opt[:resume]
|
|
921
963
|
end
|
|
922
|
-
@content.update_item(item, reset_item(item, resume: res))
|
|
964
|
+
@content.update_item(item, reset_item(item, date: date, resume: res))
|
|
923
965
|
end
|
|
924
966
|
write(@doing_file)
|
|
925
967
|
|
|
@@ -1309,20 +1351,6 @@ module Doing
|
|
|
1309
1351
|
end
|
|
1310
1352
|
end
|
|
1311
1353
|
|
|
1312
|
-
##
|
|
1313
|
-
## Restore a backed up version of a file
|
|
1314
|
-
##
|
|
1315
|
-
## @param file [String] The filepath to restore
|
|
1316
|
-
##
|
|
1317
|
-
def restore_backup(file)
|
|
1318
|
-
if File.exist?("#{file}~")
|
|
1319
|
-
FileUtils.cp("#{file}~", file)
|
|
1320
|
-
logger.warn('File update:', "Restored #{file.sub(/^#{Util.user_home}/, '~')}")
|
|
1321
|
-
else
|
|
1322
|
-
logger.error('Restore error:', 'No backup file found')
|
|
1323
|
-
end
|
|
1324
|
-
end
|
|
1325
|
-
|
|
1326
1354
|
##
|
|
1327
1355
|
## Rename doing file with date and start fresh one
|
|
1328
1356
|
##
|
|
@@ -1387,8 +1415,35 @@ module Doing
|
|
|
1387
1415
|
##
|
|
1388
1416
|
## @return [String] The selected section name
|
|
1389
1417
|
##
|
|
1390
|
-
def choose_section
|
|
1391
|
-
|
|
1418
|
+
def choose_section(include_all: false)
|
|
1419
|
+
options = @content.section_titles.sort
|
|
1420
|
+
options.unshift('All') if include_all
|
|
1421
|
+
choice = Prompt.choose_from(options, prompt: 'Choose a section > ', fzf_args: ['--height=60%'])
|
|
1422
|
+
choice ? choice.strip : choice
|
|
1423
|
+
end
|
|
1424
|
+
|
|
1425
|
+
##
|
|
1426
|
+
## Generate a menu of tags and allow user selection
|
|
1427
|
+
##
|
|
1428
|
+
## @return [String] The selected tag name
|
|
1429
|
+
##
|
|
1430
|
+
def choose_tag(section = 'All', items: nil, include_all: false)
|
|
1431
|
+
items ||= @content.in_section(section)
|
|
1432
|
+
tags = all_tags(items, counts: true).map { |t, c| "@#{t} (#{c})" }
|
|
1433
|
+
tags.unshift('No tag filter') if include_all
|
|
1434
|
+
choice = Prompt.choose_from(tags, sorted: false, multiple: true, prompt: 'Choose tag(s) > ', fzf_args: ['--height=60%'])
|
|
1435
|
+
choice ? choice.split(/\n/).map { |t| t.strip.sub(/ \(.*?\)$/, '')}.join(' ') : choice
|
|
1436
|
+
end
|
|
1437
|
+
|
|
1438
|
+
##
|
|
1439
|
+
## Generate a menu of sections and tags and allow user selection
|
|
1440
|
+
##
|
|
1441
|
+
## @return [String] The selected section or tag name
|
|
1442
|
+
##
|
|
1443
|
+
def choose_section_tag
|
|
1444
|
+
options = @content.section_titles.sort
|
|
1445
|
+
options.concat(@content.all_tags.sort.map { |t| "@#{t}" })
|
|
1446
|
+
choice = Prompt.choose_from(options, prompt: 'Choose a section or tag > ', fzf_args: ['--height=60%'])
|
|
1392
1447
|
choice ? choice.strip : choice
|
|
1393
1448
|
end
|
|
1394
1449
|
|
|
@@ -1427,22 +1482,33 @@ module Doing
|
|
|
1427
1482
|
##
|
|
1428
1483
|
## @param opt [Hash] Additional Options
|
|
1429
1484
|
##
|
|
1430
|
-
def list_section(opt = {})
|
|
1485
|
+
def list_section(opt = {}, items: Items.new)
|
|
1431
1486
|
opt[:config_template] ||= 'default'
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1487
|
+
|
|
1488
|
+
tpl_cfg = @config.dig('templates', opt[:config_template])
|
|
1489
|
+
|
|
1490
|
+
cfg = if opt[:view_template]
|
|
1491
|
+
@config.dig('views', opt[:view_template]).deep_merge(tpl_cfg)
|
|
1492
|
+
else
|
|
1493
|
+
tpl_cfg
|
|
1494
|
+
end
|
|
1495
|
+
|
|
1496
|
+
cfg.deep_merge({
|
|
1497
|
+
'wrap_width' => @config['wrap_width'] || 0,
|
|
1498
|
+
'date_format' => @config['default_date_format'],
|
|
1499
|
+
'order' => @config['order'] || 'asc',
|
|
1500
|
+
'tags_color' => @config['tags_color'],
|
|
1501
|
+
'duration' => @config['duration'],
|
|
1502
|
+
'interval_format' => @config['interval_format']
|
|
1503
|
+
})
|
|
1504
|
+
opt[:duration] ||= cfg['duration'] || false
|
|
1505
|
+
opt[:interval_format] ||= cfg['interval_format'] || 'text'
|
|
1438
1506
|
opt[:count] ||= 0
|
|
1439
1507
|
opt[:age] ||= 'newest'
|
|
1440
1508
|
opt[:format] ||= cfg['date_format']
|
|
1441
1509
|
opt[:order] ||= cfg['order'] || 'asc'
|
|
1442
1510
|
opt[:tag_order] ||= 'asc'
|
|
1443
|
-
if opt[:tags_color].nil?
|
|
1444
|
-
opt[:tags_color] = cfg['tags_color'] || false
|
|
1445
|
-
end
|
|
1511
|
+
opt[:tags_color] = cfg['tags_color'] || false if opt[:tags_color].nil?
|
|
1446
1512
|
opt[:template] ||= cfg['template']
|
|
1447
1513
|
|
|
1448
1514
|
# opt[:highlight] ||= true
|
|
@@ -1452,22 +1518,22 @@ module Doing
|
|
|
1452
1518
|
opt[:section] = choose_section
|
|
1453
1519
|
title = opt[:section]
|
|
1454
1520
|
elsif opt[:section].instance_of?(String)
|
|
1455
|
-
if opt[:section] =~ /^all$/i
|
|
1456
|
-
|
|
1521
|
+
title = if opt[:section] =~ /^all$/i
|
|
1522
|
+
if opt[:page_title]
|
|
1457
1523
|
opt[:page_title]
|
|
1458
1524
|
elsif opt[:tag_filter] && opt[:tag_filter]['bool'].normalize_bool != :not
|
|
1459
1525
|
opt[:tag_filter]['tags'].map { |tag| "@#{tag}" }.join(' + ')
|
|
1460
1526
|
else
|
|
1461
1527
|
'doing'
|
|
1462
1528
|
end
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1529
|
+
else
|
|
1530
|
+
guess_section(opt[:section])
|
|
1531
|
+
end
|
|
1466
1532
|
end
|
|
1467
1533
|
|
|
1468
|
-
items = filter_items(
|
|
1534
|
+
items = filter_items(items, opt: opt)
|
|
1469
1535
|
|
|
1470
|
-
items.reverse!
|
|
1536
|
+
items.reverse! unless opt[:order] =~ /^d/i
|
|
1471
1537
|
|
|
1472
1538
|
if opt[:interactive]
|
|
1473
1539
|
opt[:menu] = !opt[:force]
|
|
@@ -1531,15 +1597,22 @@ module Doing
|
|
|
1531
1597
|
'wrap_width' => @config['wrap_width'] || 0,
|
|
1532
1598
|
'date_format' => @config['default_date_format'],
|
|
1533
1599
|
'order' => @config['order'] || 'asc',
|
|
1534
|
-
'tags_color' => @config['tags_color']
|
|
1600
|
+
'tags_color' => @config['tags_color'],
|
|
1601
|
+
'duration' => @config['duration'],
|
|
1602
|
+
'interval_format' => @config['interval_format']
|
|
1535
1603
|
})
|
|
1536
1604
|
|
|
1605
|
+
opt[:duration] ||= cfg['duration'] || false
|
|
1606
|
+
opt[:interval_format] ||= cfg['interval_format'] || 'text'
|
|
1607
|
+
|
|
1537
1608
|
options = {
|
|
1538
1609
|
after: opt[:after],
|
|
1539
1610
|
before: opt[:before],
|
|
1540
1611
|
count: 0,
|
|
1612
|
+
duration: opt[:duration],
|
|
1541
1613
|
from: opt[:from],
|
|
1542
1614
|
format: cfg['date_format'],
|
|
1615
|
+
interval_format: opt[:interval_format],
|
|
1543
1616
|
order: cfg['order'] || 'asc',
|
|
1544
1617
|
output: output,
|
|
1545
1618
|
section: opt[:section],
|
|
@@ -1571,8 +1644,18 @@ module Doing
|
|
|
1571
1644
|
# :date_filter expects an array with start and end date
|
|
1572
1645
|
dates = [dates, dates] if dates.instance_of?(String)
|
|
1573
1646
|
|
|
1574
|
-
list_section({
|
|
1575
|
-
|
|
1647
|
+
list_section({
|
|
1648
|
+
section: section,
|
|
1649
|
+
count: 0,
|
|
1650
|
+
order: 'asc',
|
|
1651
|
+
date_filter: dates,
|
|
1652
|
+
times: times,
|
|
1653
|
+
output: output,
|
|
1654
|
+
totals: opt[:totals],
|
|
1655
|
+
duration: opt[:duration],
|
|
1656
|
+
sort_tags: opt[:sort_tags],
|
|
1657
|
+
config_template: 'default'
|
|
1658
|
+
})
|
|
1576
1659
|
end
|
|
1577
1660
|
|
|
1578
1661
|
##
|
|
@@ -1595,6 +1678,7 @@ module Doing
|
|
|
1595
1678
|
after: opt[:after],
|
|
1596
1679
|
before: opt[:before],
|
|
1597
1680
|
count: 0,
|
|
1681
|
+
duration: opt[:duration],
|
|
1598
1682
|
from: opt[:from],
|
|
1599
1683
|
order: opt[:order],
|
|
1600
1684
|
output: output,
|
|
@@ -1626,8 +1710,13 @@ module Doing
|
|
|
1626
1710
|
'wrap_width' => @config['wrap_width'] || 0,
|
|
1627
1711
|
'date_format' => @config['default_date_format'],
|
|
1628
1712
|
'order' => @config['order'] || 'asc',
|
|
1629
|
-
'tags_color' => @config['tags_color']
|
|
1713
|
+
'tags_color' => @config['tags_color'],
|
|
1714
|
+
'duration' => @config['duration'],
|
|
1715
|
+
'interval_format' => @config['interval_format']
|
|
1630
1716
|
})
|
|
1717
|
+
opt[:duration] ||= cfg['duration'] || false
|
|
1718
|
+
opt[:interval_format] ||= cfg['interval_format'] || 'text'
|
|
1719
|
+
|
|
1631
1720
|
section ||= @config['current_section']
|
|
1632
1721
|
section = guess_section(section)
|
|
1633
1722
|
|
|
@@ -1649,8 +1738,12 @@ module Doing
|
|
|
1649
1738
|
'wrap_width' => @config['wrap_width'] || 0,
|
|
1650
1739
|
'date_format' => @config['default_date_format'],
|
|
1651
1740
|
'order' => @config['order'] || 'asc',
|
|
1652
|
-
'tags_color' => @config['tags_color']
|
|
1741
|
+
'tags_color' => @config['tags_color'],
|
|
1742
|
+
'duration' => @config['duration'],
|
|
1743
|
+
'interval_format' => @config['interval_format']
|
|
1653
1744
|
})
|
|
1745
|
+
options[:duration] ||= cfg['duration'] || false
|
|
1746
|
+
options[:interval_format] ||= cfg['interval_format'] || 'text'
|
|
1654
1747
|
|
|
1655
1748
|
opts = {
|
|
1656
1749
|
section: section,
|
|
@@ -1658,7 +1751,12 @@ module Doing
|
|
|
1658
1751
|
count: 1,
|
|
1659
1752
|
format: cfg['date_format'],
|
|
1660
1753
|
template: cfg['template'],
|
|
1661
|
-
times: times
|
|
1754
|
+
times: times,
|
|
1755
|
+
duration: options[:duration],
|
|
1756
|
+
interval_format: options[:interval_format],
|
|
1757
|
+
case: options[:case],
|
|
1758
|
+
not: options[:negate],
|
|
1759
|
+
config_template: 'last'
|
|
1662
1760
|
}
|
|
1663
1761
|
|
|
1664
1762
|
if options[:tag]
|
|
@@ -1669,9 +1767,7 @@ module Doing
|
|
|
1669
1767
|
end
|
|
1670
1768
|
|
|
1671
1769
|
opts[:search] = options[:search] if options[:search]
|
|
1672
|
-
|
|
1673
|
-
opts[:not] = options[:negate]
|
|
1674
|
-
opts[:config_template] = 'last'
|
|
1770
|
+
|
|
1675
1771
|
list_section(opts)
|
|
1676
1772
|
end
|
|
1677
1773
|
|
|
@@ -1836,6 +1932,7 @@ EOS
|
|
|
1836
1932
|
output + tail
|
|
1837
1933
|
when :markdown
|
|
1838
1934
|
pad = sorted_tags_data.map {|k, v| k }.group_by(&:size).max.last[0].length
|
|
1935
|
+
pad = 7 if pad < 7
|
|
1839
1936
|
output = <<~EOS
|
|
1840
1937
|
| #{' ' * (pad - 7) }project | time |
|
|
1841
1938
|
| #{'-' * (pad - 1)}: | :------- |
|
data/lib/doing.rb
CHANGED
|
@@ -6,9 +6,14 @@ require 'yaml'
|
|
|
6
6
|
require 'pp'
|
|
7
7
|
require 'csv'
|
|
8
8
|
require 'tempfile'
|
|
9
|
+
require 'zlib'
|
|
10
|
+
require 'base64'
|
|
11
|
+
|
|
9
12
|
require 'chronic'
|
|
10
13
|
require 'tty-link'
|
|
11
14
|
require 'tty-which'
|
|
15
|
+
require 'tty-markdown'
|
|
16
|
+
require 'plist'
|
|
12
17
|
# require 'amatch'
|
|
13
18
|
require 'haml'
|
|
14
19
|
require 'json'
|
|
@@ -16,12 +21,14 @@ require 'logger'
|
|
|
16
21
|
require 'safe_yaml/load'
|
|
17
22
|
require 'doing/hash'
|
|
18
23
|
require 'doing/colors'
|
|
24
|
+
require 'doing/template_string'
|
|
19
25
|
require 'doing/string'
|
|
20
26
|
require 'doing/string_chronify'
|
|
21
27
|
require 'doing/time'
|
|
22
28
|
require 'doing/array'
|
|
23
29
|
require 'doing/symbol'
|
|
24
30
|
require 'doing/util'
|
|
31
|
+
require 'doing/util_backup'
|
|
25
32
|
require 'doing/configuration'
|
|
26
33
|
require 'doing/section'
|
|
27
34
|
require 'doing/items'
|
|
@@ -35,6 +42,8 @@ require 'doing/hooks'
|
|
|
35
42
|
require 'doing/plugin_manager'
|
|
36
43
|
require 'doing/pager'
|
|
37
44
|
require 'doing/completion'
|
|
45
|
+
require 'doing/boolean_term_parser'
|
|
46
|
+
require 'doing/phrase_parser'
|
|
38
47
|
# require 'doing/markdown_document_listener'
|
|
39
48
|
|
|
40
49
|
# Main doing module
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<% @items.each do |i| %>Doing on <%= i[:date_object].strftime('%A %m/%d/%y') %>
|
|
2
|
+
|
|
3
|
+
<%= i[:title] %><% if i[:note].length.positive? %><%= "\n\n" + i[:note].map{|n| n.strip }.join("\n ") %><% end %>
|
|
4
|
+
|
|
5
|
+
<% if i[:human_time] && i[:time] != "00:00:00" %>_Took <%= i[:human_time] %>._<% end %>
|
|
6
|
+
<% end %>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# <%= @page_title %>
|
|
2
|
+
<% @items.each do |i| %>
|
|
3
|
+
- [<%= i[:done] %>] <%= i[:date] %> <%= i[:title] %> <% if i[:time] && i[:time] != "00:00:00" %>[**<%= i[:time] %>**]<% end %><% if i[:note].length.positive? %><%= "\n\n " + i[:note].map{|n| n.strip }.join("\n ") %><% end %><% end %>
|
|
4
|
+
|
|
5
|
+
<%= @totals %>
|
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.5pre
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-12-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: safe_yaml
|
|
@@ -326,6 +326,66 @@ dependencies:
|
|
|
326
326
|
- - ">="
|
|
327
327
|
- !ruby/object:Gem::Version
|
|
328
328
|
version: 0.5.0
|
|
329
|
+
- !ruby/object:Gem::Dependency
|
|
330
|
+
name: tty-markdown
|
|
331
|
+
requirement: !ruby/object:Gem::Requirement
|
|
332
|
+
requirements:
|
|
333
|
+
- - "~>"
|
|
334
|
+
- !ruby/object:Gem::Version
|
|
335
|
+
version: '0.7'
|
|
336
|
+
- - ">="
|
|
337
|
+
- !ruby/object:Gem::Version
|
|
338
|
+
version: 0.7.0
|
|
339
|
+
type: :runtime
|
|
340
|
+
prerelease: false
|
|
341
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
342
|
+
requirements:
|
|
343
|
+
- - "~>"
|
|
344
|
+
- !ruby/object:Gem::Version
|
|
345
|
+
version: '0.7'
|
|
346
|
+
- - ">="
|
|
347
|
+
- !ruby/object:Gem::Version
|
|
348
|
+
version: 0.7.0
|
|
349
|
+
- !ruby/object:Gem::Dependency
|
|
350
|
+
name: parslet
|
|
351
|
+
requirement: !ruby/object:Gem::Requirement
|
|
352
|
+
requirements:
|
|
353
|
+
- - "~>"
|
|
354
|
+
- !ruby/object:Gem::Version
|
|
355
|
+
version: '2.0'
|
|
356
|
+
- - ">="
|
|
357
|
+
- !ruby/object:Gem::Version
|
|
358
|
+
version: 2.0.0
|
|
359
|
+
type: :runtime
|
|
360
|
+
prerelease: false
|
|
361
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
362
|
+
requirements:
|
|
363
|
+
- - "~>"
|
|
364
|
+
- !ruby/object:Gem::Version
|
|
365
|
+
version: '2.0'
|
|
366
|
+
- - ">="
|
|
367
|
+
- !ruby/object:Gem::Version
|
|
368
|
+
version: 2.0.0
|
|
369
|
+
- !ruby/object:Gem::Dependency
|
|
370
|
+
name: plist
|
|
371
|
+
requirement: !ruby/object:Gem::Requirement
|
|
372
|
+
requirements:
|
|
373
|
+
- - "~>"
|
|
374
|
+
- !ruby/object:Gem::Version
|
|
375
|
+
version: '3.6'
|
|
376
|
+
- - ">="
|
|
377
|
+
- !ruby/object:Gem::Version
|
|
378
|
+
version: 3.6.0
|
|
379
|
+
type: :runtime
|
|
380
|
+
prerelease: false
|
|
381
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
382
|
+
requirements:
|
|
383
|
+
- - "~>"
|
|
384
|
+
- !ruby/object:Gem::Version
|
|
385
|
+
version: '3.6'
|
|
386
|
+
- - ">="
|
|
387
|
+
- !ruby/object:Gem::Version
|
|
388
|
+
version: 3.6.0
|
|
329
389
|
description: A tool for managing a TaskPaper-like file of recent activites. Perfect
|
|
330
390
|
for the late-night hacker on too much caffeine to remember what they accomplished
|
|
331
391
|
at 2 in the morning.
|
|
@@ -353,7 +413,14 @@ files:
|
|
|
353
413
|
- _config.yml
|
|
354
414
|
- bin/doing
|
|
355
415
|
- doc/Array.html
|
|
416
|
+
- doc/BooleanTermParser.html
|
|
417
|
+
- doc/BooleanTermParser/Clause.html
|
|
418
|
+
- doc/BooleanTermParser/Operator.html
|
|
419
|
+
- doc/BooleanTermParser/Query.html
|
|
420
|
+
- doc/BooleanTermParser/QueryParser.html
|
|
421
|
+
- doc/BooleanTermParser/QueryTransformer.html
|
|
356
422
|
- doc/Doing.html
|
|
423
|
+
- doc/Doing/CLIFormat.html
|
|
357
424
|
- doc/Doing/Color.html
|
|
358
425
|
- doc/Doing/Completion.html
|
|
359
426
|
- doc/Doing/Configuration.html
|
|
@@ -376,13 +443,22 @@ files:
|
|
|
376
443
|
- doc/Doing/Plugins.html
|
|
377
444
|
- doc/Doing/Prompt.html
|
|
378
445
|
- doc/Doing/Section.html
|
|
446
|
+
- doc/Doing/TemplateString.html
|
|
379
447
|
- doc/Doing/Util.html
|
|
448
|
+
- doc/Doing/Util/Backup.html
|
|
380
449
|
- doc/Doing/WWID.html
|
|
381
450
|
- doc/Doing/WWIDFile.html
|
|
382
451
|
- doc/GLI.html
|
|
383
452
|
- doc/GLI/Commands.html
|
|
384
453
|
- doc/GLI/Commands/MarkdownDocumentListener.html
|
|
385
454
|
- doc/Hash.html
|
|
455
|
+
- doc/PhraseParser.html
|
|
456
|
+
- doc/PhraseParser/Operator.html
|
|
457
|
+
- doc/PhraseParser/PhraseClause.html
|
|
458
|
+
- doc/PhraseParser/Query.html
|
|
459
|
+
- doc/PhraseParser/QueryParser.html
|
|
460
|
+
- doc/PhraseParser/QueryTransformer.html
|
|
461
|
+
- doc/PhraseParser/TermClause.html
|
|
386
462
|
- doc/Status.html
|
|
387
463
|
- doc/String.html
|
|
388
464
|
- doc/Symbol.html
|
|
@@ -413,6 +489,7 @@ files:
|
|
|
413
489
|
- lib/completion/doing.fish
|
|
414
490
|
- lib/doing.rb
|
|
415
491
|
- lib/doing/array.rb
|
|
492
|
+
- lib/doing/boolean_term_parser.rb
|
|
416
493
|
- lib/doing/cli_status.rb
|
|
417
494
|
- lib/doing/colors.rb
|
|
418
495
|
- lib/doing/completion.rb
|
|
@@ -430,8 +507,10 @@ files:
|
|
|
430
507
|
- lib/doing/markdown_document_listener.rb
|
|
431
508
|
- lib/doing/note.rb
|
|
432
509
|
- lib/doing/pager.rb
|
|
510
|
+
- lib/doing/phrase_parser.rb
|
|
433
511
|
- lib/doing/plugin_manager.rb
|
|
434
512
|
- lib/doing/plugins/export/csv_export.rb
|
|
513
|
+
- lib/doing/plugins/export/dayone_export.rb
|
|
435
514
|
- lib/doing/plugins/export/html_export.rb
|
|
436
515
|
- lib/doing/plugins/export/json_export.rb
|
|
437
516
|
- lib/doing/plugins/export/markdown_export.rb
|
|
@@ -446,8 +525,10 @@ files:
|
|
|
446
525
|
- lib/doing/string.rb
|
|
447
526
|
- lib/doing/string_chronify.rb
|
|
448
527
|
- lib/doing/symbol.rb
|
|
528
|
+
- lib/doing/template_string.rb
|
|
449
529
|
- lib/doing/time.rb
|
|
450
530
|
- lib/doing/util.rb
|
|
531
|
+
- lib/doing/util_backup.rb
|
|
451
532
|
- lib/doing/version.rb
|
|
452
533
|
- lib/doing/wwid.rb
|
|
453
534
|
- lib/examples/commands/autotag.rb
|
|
@@ -546,6 +627,8 @@ files:
|
|
|
546
627
|
- lib/helpers/fzf/test/fzf.vader
|
|
547
628
|
- lib/helpers/fzf/test/test_go.rb
|
|
548
629
|
- lib/helpers/fzf/uninstall
|
|
630
|
+
- lib/templates/doing-dayone-entry.erb
|
|
631
|
+
- lib/templates/doing-dayone.erb
|
|
549
632
|
- lib/templates/doing-markdown.erb
|
|
550
633
|
- lib/templates/doing.css
|
|
551
634
|
- lib/templates/doing.haml
|