doing 2.1.39 → 2.1.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/CHANGELOG.md +67 -0
  4. data/Gemfile.lock +1 -1
  5. data/README.md +1 -1
  6. data/Rakefile +4 -4
  7. data/bin/commands/again.rb +1 -3
  8. data/bin/commands/changes.rb +50 -34
  9. data/bin/commands/commands.rb +77 -52
  10. data/bin/commands/commands_accepting.rb +57 -53
  11. data/bin/commands/config.rb +45 -36
  12. data/bin/commands/done.rb +1 -18
  13. data/bin/commands/finish.rb +90 -59
  14. data/bin/commands/flag.rb +5 -1
  15. data/bin/commands/grep.rb +3 -14
  16. data/bin/commands/last.rb +2 -8
  17. data/bin/commands/meanwhile.rb +13 -6
  18. data/bin/commands/now.rb +151 -107
  19. data/bin/commands/on.rb +8 -18
  20. data/bin/commands/recent.rb +2 -8
  21. data/bin/commands/reset.rb +24 -1
  22. data/bin/commands/select.rb +1 -1
  23. data/bin/commands/show.rb +6 -17
  24. data/bin/commands/since.rb +1 -12
  25. data/bin/commands/tag_dir.rb +49 -15
  26. data/bin/commands/today.rb +2 -13
  27. data/bin/commands/undo.rb +4 -6
  28. data/bin/commands/view.rb +1 -1
  29. data/bin/commands/yesterday.rb +2 -13
  30. data/bin/doing +15 -8
  31. data/{Dockerfile → docker/Dockerfile} +3 -1
  32. data/{Dockerfile-2.6 → docker/Dockerfile-2.6} +2 -2
  33. data/{Dockerfile-2.7 → docker/Dockerfile-2.7} +2 -2
  34. data/{Dockerfile-3.0 → docker/Dockerfile-3.0} +2 -2
  35. data/{bash_profile → docker/bash_profile} +0 -0
  36. data/{inputrc → docker/inputrc} +0 -0
  37. data/docs/doc/Array.html +85 -2
  38. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  39. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  40. data/docs/doc/BooleanTermParser/Query.html +1 -1
  41. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  42. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  43. data/docs/doc/BooleanTermParser.html +1 -1
  44. data/docs/doc/Doing/ArrayNestedHash.html +198 -0
  45. data/docs/doc/Doing/ArrayTags.html +424 -0
  46. data/docs/doc/Doing/CSVExport.html +266 -0
  47. data/docs/doc/Doing/CalendarImport.html +232 -0
  48. data/docs/doc/Doing/Change.html +617 -0
  49. data/docs/doc/Doing/Changes.html +468 -0
  50. data/docs/doc/Doing/ChronifyArray.html +347 -0
  51. data/docs/doc/Doing/ChronifyNumeric.html +271 -0
  52. data/docs/doc/Doing/ChronifyString.html +682 -0
  53. data/docs/doc/Doing/Color.html +167 -21
  54. data/docs/doc/Doing/Completion/BashCompletions.html +445 -0
  55. data/docs/doc/Doing/Completion/FishCompletions.html +445 -0
  56. data/docs/doc/Doing/Completion/StringUtils.html +229 -0
  57. data/docs/doc/Doing/Completion/ZshCompletions.html +445 -0
  58. data/docs/doc/Doing/Completion.html +17 -3
  59. data/docs/doc/Doing/Configuration.html +3 -2
  60. data/docs/doc/Doing/DayOneRenderer.html +383 -0
  61. data/docs/doc/Doing/DayoneExport.html +290 -0
  62. data/docs/doc/Doing/DoingImport.html +391 -0
  63. data/docs/doc/Doing/Entry.html +381 -0
  64. data/docs/doc/Doing/Errors/DoingNoTraceError.html +7 -3
  65. data/docs/doc/Doing/Errors/DoingRuntimeError.html +7 -3
  66. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  67. data/docs/doc/Doing/Errors/EmptyInput.html +10 -2
  68. data/docs/doc/Doing/Errors/HistoryLimitError.html +194 -0
  69. data/docs/doc/Doing/Errors/InvalidPlugin.html +194 -0
  70. data/docs/doc/Doing/Errors/MissingBackupFile.html +194 -0
  71. data/docs/doc/Doing/Errors/NoResults.html +10 -2
  72. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  73. data/docs/doc/Doing/Errors/UserCancelled.html +10 -2
  74. data/docs/doc/Doing/Errors/WrongCommand.html +10 -2
  75. data/docs/doc/Doing/Errors.html +9 -9
  76. data/docs/doc/Doing/HTMLExport.html +256 -0
  77. data/docs/doc/Doing/Hooks.html +1 -1
  78. data/docs/doc/Doing/Item.html +179 -1660
  79. data/docs/doc/Doing/ItemDates.html +564 -0
  80. data/docs/doc/Doing/ItemQuery.html +614 -0
  81. data/docs/doc/Doing/ItemState.html +387 -0
  82. data/docs/doc/Doing/ItemTags.html +498 -0
  83. data/docs/doc/Doing/Items.html +581 -15
  84. data/docs/doc/Doing/JSONExport.html +222 -0
  85. data/docs/doc/Doing/Logger.html +1 -1
  86. data/docs/doc/Doing/MarkdownExport.html +266 -0
  87. data/docs/doc/Doing/MarkdownRenderer.html +383 -0
  88. data/docs/doc/Doing/Note.html +18 -4
  89. data/docs/doc/Doing/Pager.html +1 -1
  90. data/docs/doc/Doing/Plugins.html +181 -76
  91. data/docs/doc/Doing/Prompt.html +32 -683
  92. data/docs/doc/Doing/PromptChoose.html +484 -0
  93. data/docs/doc/Doing/PromptFZF.html +391 -0
  94. data/docs/doc/Doing/PromptInput.html +572 -0
  95. data/docs/doc/Doing/PromptSTD.html +293 -0
  96. data/docs/doc/Doing/PromptYN.html +237 -0
  97. data/docs/doc/Doing/Section.html +58 -2
  98. data/docs/doc/Doing/StringHighlight.html +533 -0
  99. data/docs/doc/Doing/StringNormalize.html +929 -0
  100. data/docs/doc/Doing/StringQuery.html +725 -0
  101. data/docs/doc/Doing/StringTags.html +884 -0
  102. data/docs/doc/Doing/StringTransform.html +599 -0
  103. data/docs/doc/Doing/StringTruncate.html +448 -0
  104. data/docs/doc/Doing/StringURL.html +409 -0
  105. data/docs/doc/Doing/SymbolNormalize.html +341 -0
  106. data/docs/doc/Doing/TaskPaperExport.html +222 -0
  107. data/docs/doc/Doing/TemplateExport.html +249 -0
  108. data/docs/doc/Doing/TemplateString.html +102 -3
  109. data/docs/doc/Doing/TimingImport.html +285 -0
  110. data/docs/doc/Doing/Types.html +1 -1
  111. data/docs/doc/Doing/Util/Backup.html +11 -163
  112. data/docs/doc/Doing/Util.html +67 -10
  113. data/docs/doc/Doing/Version.html +523 -0
  114. data/docs/doc/Doing/WWID/WWIDUtil.html +510 -0
  115. data/docs/doc/Doing/WWID.html +476 -139
  116. data/docs/doc/Doing/WWIDDisplay.html +865 -0
  117. data/docs/doc/Doing/WWIDEditor.html +466 -0
  118. data/docs/doc/Doing/WWIDFileTools.html +359 -0
  119. data/docs/doc/Doing/WWIDFilter.html +466 -0
  120. data/docs/doc/Doing/WWIDGuess.html +299 -0
  121. data/docs/doc/Doing/WWIDInteractive.html +752 -0
  122. data/docs/doc/Doing/WWIDModify.html +1078 -0
  123. data/docs/doc/Doing/WWIDTags.html +302 -0
  124. data/docs/doc/Doing/WWIDTimers.html +359 -0
  125. data/docs/doc/Doing/WWIDUtil.html +510 -0
  126. data/docs/doc/Doing.html +9 -6
  127. data/docs/doc/FalseClass.html +1 -1
  128. data/docs/doc/GLI/Commands/Help.html +1 -1
  129. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  130. data/docs/doc/GLI/Commands.html +1 -1
  131. data/docs/doc/GLI.html +1 -1
  132. data/docs/doc/Hash.html +1 -1
  133. data/docs/doc/Numeric.html +23 -78
  134. data/docs/doc/Object.html +1 -1
  135. data/docs/doc/PhraseParser/Operator.html +1 -1
  136. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  137. data/docs/doc/PhraseParser/Query.html +1 -1
  138. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  139. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  140. data/docs/doc/PhraseParser/TermClause.html +1 -1
  141. data/docs/doc/PhraseParser.html +1 -1
  142. data/docs/doc/Status.html +1 -1
  143. data/docs/doc/String.html +58 -633
  144. data/docs/doc/Symbol.html +9 -224
  145. data/docs/doc/Time.html +119 -13
  146. data/docs/doc/TrueClass.html +1 -1
  147. data/docs/doc/_index.html +348 -4
  148. data/docs/doc/class_list.html +1 -1
  149. data/docs/doc/file.README.html +2 -2
  150. data/docs/doc/index.html +2 -2
  151. data/docs/doc/method_list.html +1904 -592
  152. data/docs/doc/top-level-namespace.html +12 -4
  153. data/docs/index.md +1 -1
  154. data/doing.rdoc +67 -15
  155. data/lib/completion/_doing.zsh +6 -6
  156. data/lib/completion/doing.bash +10 -10
  157. data/lib/completion/doing.fish +10 -3
  158. data/lib/doing/add_options.rb +39 -1
  159. data/lib/doing/array/array.rb +18 -12
  160. data/lib/doing/array/cleanup.rb +31 -0
  161. data/lib/doing/array/nested_hash.rb +1 -1
  162. data/lib/doing/array/tags.rb +6 -5
  163. data/lib/doing/changelog/changelog.rb +6 -0
  164. data/lib/doing/chronify/array.rb +65 -25
  165. data/lib/doing/chronify/chronify.rb +12 -0
  166. data/lib/doing/chronify/numeric.rb +3 -2
  167. data/lib/doing/chronify/string.rb +1 -1
  168. data/lib/doing/colors.rb +77 -30
  169. data/lib/doing/completion/completion_string.rb +25 -0
  170. data/lib/doing/completion.rb +4 -5
  171. data/lib/doing/configuration.rb +7 -3
  172. data/lib/doing/errors.rb +51 -35
  173. data/lib/doing/good.rb +8 -0
  174. data/lib/doing/hooks.rb +3 -3
  175. data/lib/doing/item/dates.rb +112 -0
  176. data/lib/doing/item/item.rb +128 -0
  177. data/lib/doing/{item.rb → item/query.rb} +2 -353
  178. data/lib/doing/item/state.rb +59 -0
  179. data/lib/doing/item/tags.rb +87 -0
  180. data/lib/doing/items/filter.rb +67 -0
  181. data/lib/doing/items/items.rb +57 -0
  182. data/lib/doing/items/modify.rb +36 -0
  183. data/lib/doing/items/sections.rb +83 -0
  184. data/lib/doing/items/util.rb +74 -0
  185. data/lib/doing/normalize.rb +10 -2
  186. data/lib/doing/note.rb +1 -1
  187. data/lib/doing/pager.rb +9 -3
  188. data/lib/doing/plugin_manager.rb +33 -8
  189. data/lib/doing/plugins/export/markdown_export.rb +4 -2
  190. data/lib/doing/plugins/export/template_export.rb +4 -4
  191. data/lib/doing/plugins/import/cal_to_json.scpt +0 -0
  192. data/lib/doing/plugins/import/doing_import.rb +1 -1
  193. data/lib/doing/prompt/choose.rb +118 -0
  194. data/lib/doing/prompt/fzf.rb +84 -0
  195. data/lib/doing/prompt/input.rb +129 -0
  196. data/lib/doing/prompt/prompt.rb +41 -0
  197. data/lib/doing/prompt/std.rb +32 -0
  198. data/lib/doing/prompt/yn.rb +64 -0
  199. data/lib/doing/section.rb +4 -0
  200. data/lib/doing/string/highlight.rb +1 -1
  201. data/lib/doing/string/query.rb +1 -1
  202. data/lib/doing/string/string.rb +18 -7
  203. data/lib/doing/string/tags.rb +14 -3
  204. data/lib/doing/string/transform.rb +7 -1
  205. data/lib/doing/string/truncate.rb +1 -1
  206. data/lib/doing/string/url.rb +1 -1
  207. data/lib/doing/time.rb +19 -1
  208. data/lib/doing/util.rb +12 -6
  209. data/lib/doing/util_backup.rb +62 -57
  210. data/lib/doing/version.rb +1 -1
  211. data/lib/doing/wwid/display.rb +396 -0
  212. data/lib/doing/wwid/editor.rb +214 -0
  213. data/lib/doing/wwid/filetools.rb +183 -0
  214. data/lib/doing/wwid/filter.rb +226 -0
  215. data/lib/doing/wwid/guess.rb +85 -0
  216. data/lib/doing/wwid/interactive.rb +377 -0
  217. data/lib/doing/wwid/modify.rb +617 -0
  218. data/lib/doing/wwid/tags.rb +51 -0
  219. data/lib/doing/wwid/timers.rb +342 -0
  220. data/lib/doing/wwid/wwid.rb +121 -0
  221. data/lib/doing/wwid/wwidutil.rb +101 -0
  222. data/lib/doing.rb +7 -7
  223. data/lib/helpers/threaded_tests.rb +1 -0
  224. metadata +94 -14
  225. data/lib/doing/changelog.rb +0 -6
  226. data/lib/doing/completion/string.rb +0 -17
  227. data/lib/doing/items.rb +0 -196
  228. data/lib/doing/prompt.rb +0 -330
  229. data/lib/doing/wwid.rb +0 -2398
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.39
4
+ version: 2.1.42
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-03-13 00:00:00.000000000 Z
11
+ date: 2022-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-markup
@@ -427,17 +427,12 @@ files:
427
427
  - AUTHORS
428
428
  - CHANGELOG.md
429
429
  - COMMANDS.md
430
- - Dockerfile
431
- - Dockerfile-2.6
432
- - Dockerfile-2.7
433
- - Dockerfile-3.0
434
430
  - Gemfile
435
431
  - Gemfile.lock
436
432
  - LICENSE
437
433
  - README.md
438
434
  - Rakefile
439
435
  - _config.yml
440
- - bash_profile
441
436
  - bin/commands/again.rb
442
437
  - bin/commands/archive.rb
443
438
  - bin/commands/cancel.rb
@@ -479,6 +474,12 @@ files:
479
474
  - bin/commands/views.rb
480
475
  - bin/commands/yesterday.rb
481
476
  - bin/doing
477
+ - docker/Dockerfile
478
+ - docker/Dockerfile-2.6
479
+ - docker/Dockerfile-2.7
480
+ - docker/Dockerfile-3.0
481
+ - docker/bash_profile
482
+ - docker/inputrc
482
483
  - docs/_config.yml
483
484
  - docs/doc/Array.html
484
485
  - docs/doc/BooleanTermParser.html
@@ -488,36 +489,92 @@ files:
488
489
  - docs/doc/BooleanTermParser/QueryParser.html
489
490
  - docs/doc/BooleanTermParser/QueryTransformer.html
490
491
  - docs/doc/Doing.html
492
+ - docs/doc/Doing/ArrayNestedHash.html
493
+ - docs/doc/Doing/ArrayTags.html
491
494
  - docs/doc/Doing/CLIFormat.html
495
+ - docs/doc/Doing/CSVExport.html
496
+ - docs/doc/Doing/CalendarImport.html
497
+ - docs/doc/Doing/Change.html
498
+ - docs/doc/Doing/Changes.html
499
+ - docs/doc/Doing/ChronifyArray.html
500
+ - docs/doc/Doing/ChronifyNumeric.html
501
+ - docs/doc/Doing/ChronifyString.html
492
502
  - docs/doc/Doing/Color.html
493
503
  - docs/doc/Doing/Completion.html
504
+ - docs/doc/Doing/Completion/BashCompletions.html
505
+ - docs/doc/Doing/Completion/FishCompletions.html
506
+ - docs/doc/Doing/Completion/StringUtils.html
507
+ - docs/doc/Doing/Completion/ZshCompletions.html
494
508
  - docs/doc/Doing/Configuration.html
495
509
  - docs/doc/Doing/Content.html
510
+ - docs/doc/Doing/DayOneRenderer.html
511
+ - docs/doc/Doing/DayoneExport.html
512
+ - docs/doc/Doing/DoingImport.html
513
+ - docs/doc/Doing/Entry.html
496
514
  - docs/doc/Doing/Errors.html
497
515
  - docs/doc/Doing/Errors/DoingNoTraceError.html
498
516
  - docs/doc/Doing/Errors/DoingRuntimeError.html
499
517
  - docs/doc/Doing/Errors/DoingStandardError.html
500
518
  - docs/doc/Doing/Errors/EmptyInput.html
519
+ - docs/doc/Doing/Errors/HistoryLimitError.html
520
+ - docs/doc/Doing/Errors/InvalidPlugin.html
521
+ - docs/doc/Doing/Errors/MissingBackupFile.html
501
522
  - docs/doc/Doing/Errors/NoResults.html
502
523
  - docs/doc/Doing/Errors/PluginException.html
503
524
  - docs/doc/Doing/Errors/UserCancelled.html
504
525
  - docs/doc/Doing/Errors/WrongCommand.html
526
+ - docs/doc/Doing/HTMLExport.html
505
527
  - docs/doc/Doing/Hooks.html
506
528
  - docs/doc/Doing/Item.html
529
+ - docs/doc/Doing/ItemDates.html
530
+ - docs/doc/Doing/ItemQuery.html
531
+ - docs/doc/Doing/ItemState.html
532
+ - docs/doc/Doing/ItemTags.html
507
533
  - docs/doc/Doing/Items.html
534
+ - docs/doc/Doing/JSONExport.html
508
535
  - docs/doc/Doing/LogAdapter.html
509
536
  - docs/doc/Doing/Logger.html
537
+ - docs/doc/Doing/MarkdownExport.html
538
+ - docs/doc/Doing/MarkdownRenderer.html
510
539
  - docs/doc/Doing/Note.html
511
540
  - docs/doc/Doing/Pager.html
512
541
  - docs/doc/Doing/Plugins.html
513
542
  - docs/doc/Doing/Prompt.html
543
+ - docs/doc/Doing/PromptChoose.html
544
+ - docs/doc/Doing/PromptFZF.html
545
+ - docs/doc/Doing/PromptInput.html
546
+ - docs/doc/Doing/PromptSTD.html
547
+ - docs/doc/Doing/PromptYN.html
514
548
  - docs/doc/Doing/Section.html
549
+ - docs/doc/Doing/StringHighlight.html
550
+ - docs/doc/Doing/StringNormalize.html
551
+ - docs/doc/Doing/StringQuery.html
552
+ - docs/doc/Doing/StringTags.html
553
+ - docs/doc/Doing/StringTransform.html
554
+ - docs/doc/Doing/StringTruncate.html
555
+ - docs/doc/Doing/StringURL.html
556
+ - docs/doc/Doing/SymbolNormalize.html
557
+ - docs/doc/Doing/TaskPaperExport.html
558
+ - docs/doc/Doing/TemplateExport.html
515
559
  - docs/doc/Doing/TemplateString.html
560
+ - docs/doc/Doing/TimingImport.html
516
561
  - docs/doc/Doing/Types.html
517
562
  - docs/doc/Doing/Util.html
518
563
  - docs/doc/Doing/Util/Backup.html
564
+ - docs/doc/Doing/Version.html
519
565
  - docs/doc/Doing/WWID.html
566
+ - docs/doc/Doing/WWID/WWIDUtil.html
567
+ - docs/doc/Doing/WWIDDisplay.html
568
+ - docs/doc/Doing/WWIDEditor.html
520
569
  - docs/doc/Doing/WWIDFile.html
570
+ - docs/doc/Doing/WWIDFileTools.html
571
+ - docs/doc/Doing/WWIDFilter.html
572
+ - docs/doc/Doing/WWIDGuess.html
573
+ - docs/doc/Doing/WWIDInteractive.html
574
+ - docs/doc/Doing/WWIDModify.html
575
+ - docs/doc/Doing/WWIDTags.html
576
+ - docs/doc/Doing/WWIDTimers.html
577
+ - docs/doc/Doing/WWIDUtil.html
521
578
  - docs/doc/FalseClass.html
522
579
  - docs/doc/GLI.html
523
580
  - docs/doc/GLI/Commands.html
@@ -560,18 +617,18 @@ files:
560
617
  - img/doing-colors.jpg
561
618
  - img/doing-printf-wrap-800.jpg
562
619
  - img/doing-show-note-formatting-800.jpg
563
- - inputrc
564
620
  - lib/completion/_doing.zsh
565
621
  - lib/completion/doing.bash
566
622
  - lib/completion/doing.fish
567
623
  - lib/doing.rb
568
624
  - lib/doing/add_options.rb
569
625
  - lib/doing/array/array.rb
626
+ - lib/doing/array/cleanup.rb
570
627
  - lib/doing/array/nested_hash.rb
571
628
  - lib/doing/array/tags.rb
572
629
  - lib/doing/boolean_term_parser.rb
573
- - lib/doing/changelog.rb
574
630
  - lib/doing/changelog/change.rb
631
+ - lib/doing/changelog/changelog.rb
575
632
  - lib/doing/changelog/changes.rb
576
633
  - lib/doing/changelog/entry.rb
577
634
  - lib/doing/changelog/version.rb
@@ -583,8 +640,8 @@ files:
583
640
  - lib/doing/colors.rb
584
641
  - lib/doing/completion.rb
585
642
  - lib/doing/completion/bash_completion.rb
643
+ - lib/doing/completion/completion_string.rb
586
644
  - lib/doing/completion/fish_completion.rb
587
- - lib/doing/completion/string.rb
588
645
  - lib/doing/completion/zsh_completion.rb
589
646
  - lib/doing/configuration.rb
590
647
  - lib/doing/errors.rb
@@ -592,8 +649,16 @@ files:
592
649
  - lib/doing/hash.rb
593
650
  - lib/doing/help_monkey_patch.rb
594
651
  - lib/doing/hooks.rb
595
- - lib/doing/item.rb
596
- - lib/doing/items.rb
652
+ - lib/doing/item/dates.rb
653
+ - lib/doing/item/item.rb
654
+ - lib/doing/item/query.rb
655
+ - lib/doing/item/state.rb
656
+ - lib/doing/item/tags.rb
657
+ - lib/doing/items/filter.rb
658
+ - lib/doing/items/items.rb
659
+ - lib/doing/items/modify.rb
660
+ - lib/doing/items/sections.rb
661
+ - lib/doing/items/util.rb
597
662
  - lib/doing/logger.rb
598
663
  - lib/doing/markdown_document_listener.rb
599
664
  - lib/doing/normalize.rb
@@ -612,7 +677,12 @@ files:
612
677
  - lib/doing/plugins/import/calendar_import.rb
613
678
  - lib/doing/plugins/import/doing_import.rb
614
679
  - lib/doing/plugins/import/timing_import.rb
615
- - lib/doing/prompt.rb
680
+ - lib/doing/prompt/choose.rb
681
+ - lib/doing/prompt/fzf.rb
682
+ - lib/doing/prompt/input.rb
683
+ - lib/doing/prompt/prompt.rb
684
+ - lib/doing/prompt/std.rb
685
+ - lib/doing/prompt/yn.rb
616
686
  - lib/doing/section.rb
617
687
  - lib/doing/string/highlight.rb
618
688
  - lib/doing/string/query.rb
@@ -627,7 +697,17 @@ files:
627
697
  - lib/doing/util.rb
628
698
  - lib/doing/util_backup.rb
629
699
  - lib/doing/version.rb
630
- - lib/doing/wwid.rb
700
+ - lib/doing/wwid/display.rb
701
+ - lib/doing/wwid/editor.rb
702
+ - lib/doing/wwid/filetools.rb
703
+ - lib/doing/wwid/filter.rb
704
+ - lib/doing/wwid/guess.rb
705
+ - lib/doing/wwid/interactive.rb
706
+ - lib/doing/wwid/modify.rb
707
+ - lib/doing/wwid/tags.rb
708
+ - lib/doing/wwid/timers.rb
709
+ - lib/doing/wwid/wwid.rb
710
+ - lib/doing/wwid/wwidutil.rb
631
711
  - lib/examples/commands/autotag.rb
632
712
  - lib/examples/commands/later.rb
633
713
  - lib/examples/commands/wiki.rb
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'changelog/version'
4
- require_relative 'changelog/entry'
5
- require_relative 'changelog/change'
6
- require_relative 'changelog/changes'
@@ -1,17 +0,0 @@
1
- class ::String
2
- def short_desc
3
- split(/[,.]/)[0].sub(/ \(.*?\)?$/, '').strip
4
- end
5
-
6
- def ltrunc(max)
7
- if length > max
8
- sub(/^.*?(.{#{max - 3}})$/, '...\1')
9
- else
10
- self
11
- end
12
- end
13
-
14
- def ltrunc!(max)
15
- replace ltrunc(max)
16
- end
17
- end
data/lib/doing/items.rb DELETED
@@ -1,196 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Doing
4
- # Items Array
5
- class Items < Array
6
- attr_accessor :sections
7
-
8
- def initialize
9
- super
10
- @sections = []
11
- end
12
-
13
- # List sections, title only
14
- #
15
- # @return [Array] section titles
16
- #
17
- def section_titles
18
- @sections.map(&:title)
19
- end
20
-
21
- # Test if section already exists
22
- #
23
- # @param section [String] section title
24
- #
25
- # @return [Boolean] true if section exists
26
- #
27
- def section?(section)
28
- has_section = false
29
- section = section.is_a?(Section) ? section.title.downcase : section.downcase
30
- @sections.each do |s|
31
- if s.title.downcase == section
32
- has_section = true
33
- break
34
- end
35
- end
36
- has_section
37
- end
38
-
39
- # Add a new section to the sections array. Accepts
40
- # either a Section object, or a title string that will
41
- # be converted into a Section.
42
- #
43
- # @param section [Section] The section to add. A
44
- # String value will be converted to
45
- # Section automatically.
46
- # @param log [Boolean] Add a log message
47
- # notifying the user about the
48
- # creation of the section.
49
- #
50
- # @return nothing
51
- #
52
- def add_section(section, log: false)
53
- section = section.is_a?(Section) ? section : Section.new(section.cap_first)
54
-
55
- return if section?(section)
56
-
57
- @sections.push(section)
58
- Doing.logger.info('New section:', %("#{section}" added)) if log
59
- end
60
-
61
- def delete_section(section, log: false)
62
- return unless section?(section)
63
-
64
- raise DoingRuntimeError, 'Section not empty' if in_section(section).count > 0
65
-
66
- deleted = false
67
-
68
- @sections.each do |sect|
69
- if sect.title == section && in_section(sect).count.zero?
70
- @sections.delete(sect)
71
- Doing.logger.info('Removed section:', %("#{section}" removed)) if log
72
- return
73
- end
74
- end
75
-
76
- Doing.logger.error('Not found:', %("#{section}" not found))
77
- end
78
-
79
- # Get a new Items object containing only items in a
80
- # specified section
81
- #
82
- # @param section [String] section title
83
- #
84
- # @return [Items] Array of items
85
- #
86
- def in_section(section)
87
- if section =~ /^all$/i
88
- dup
89
- else
90
- items = Items.new.concat(select { |item| !item.nil? && item.section == section })
91
- items.add_section(section, log: false)
92
- items
93
- end
94
- end
95
-
96
- ##
97
- ## Delete an item from the index
98
- ##
99
- ## @param item The item
100
- ##
101
- def delete_item(item, single: false)
102
- deleted = delete(item)
103
- Doing.logger.count(:deleted)
104
- Doing.logger.info('Entry deleted:', deleted.title) if single
105
- deleted
106
- end
107
-
108
- ##
109
- ## Update an item in the index with a modified item
110
- ##
111
- ## @param old_item The old item
112
- ## @param new_item The new item
113
- ##
114
- def update_item(old_item, new_item)
115
- s_idx = index { |item| item.equal?(old_item) }
116
-
117
- raise ItemNotFound, 'Unable to find item in index, did it mutate?' unless s_idx
118
-
119
- return if fetch(s_idx).equal?(new_item)
120
-
121
- self[s_idx] = new_item
122
- Doing.logger.count(:updated)
123
- Doing.logger.info('Entry updated:', self[s_idx].title.trunc(60))
124
- new_item
125
- end
126
-
127
- def all_tags
128
- each_with_object([]) do |entry, tags|
129
- tags.concat(entry.tags).sort!.uniq!
130
- end
131
- end
132
-
133
- ##
134
- ## Return Items containing items that don't exist in receiver
135
- ##
136
- ## @param items [Items] Receiver
137
- ##
138
- def diff(items)
139
- diff = Items.new
140
- each do |item|
141
- res = items.select { |i| i.equal?(item) }
142
- diff.push(item) unless res.count.positive?
143
- end
144
- diff
145
- end
146
-
147
- ##
148
- ## Remove duplicated entries. Duplicate entries must have matching start date, title, note, and section
149
- ##
150
- ## @return [Items] Items array with duplicate entries removed
151
- ##
152
- def dedup(match_section: true)
153
- unique = Items.new
154
- each do |item|
155
- unique.push(item) unless unique.include?(item, match_section: match_section)
156
- end
157
-
158
- unique
159
- end
160
-
161
- def dedup!(match_section: true)
162
- replace dedup(match_section: match_section)
163
- end
164
-
165
- def include?(item, match_section: true)
166
- includes = false
167
- each do |other_item|
168
- if other_item.equal?(item, match_section: match_section)
169
- includes = true
170
- break
171
- end
172
- end
173
-
174
- includes
175
- end
176
-
177
- # Output sections and items in Doing file format
178
- def to_s
179
- out = []
180
- @sections.each do |section|
181
- out.push(section.original)
182
- items = in_section(section.title).sort_by { |i| [i.date, i.title] }
183
- items.reverse! if Doing.setting('doing_file_sort').normalize_order == :desc
184
- items.each { |item| out.push(item.to_s) }
185
- end
186
-
187
- out.join("\n")
188
- end
189
-
190
- # @private
191
- def inspect
192
- sections = @sections.map { |s| "<Section:#{s.title} #{in_section(s.title).count} items>" }.join(', ')
193
- "#<Doing::Items #{count} items, #{@sections.count} sections: #{sections}>"
194
- end
195
- end
196
- end