doing 2.1.42 → 2.1.45

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +1 -1
  5. data/bin/commands/changes.rb +11 -1
  6. data/bin/commands/flag.rb +1 -1
  7. data/bin/commands/grep.rb +12 -2
  8. data/bin/commands/last.rb +2 -0
  9. data/bin/commands/on.rb +13 -1
  10. data/bin/commands/recent.rb +4 -1
  11. data/bin/commands/show.rb +8 -0
  12. data/bin/commands/since.rb +6 -2
  13. data/bin/commands/template.rb +14 -25
  14. data/bin/commands/today.rb +4 -1
  15. data/bin/commands/view.rb +36 -73
  16. data/bin/commands/views.rb +102 -5
  17. data/bin/commands/yesterday.rb +3 -1
  18. data/bin/doing +31 -4
  19. data/docs/doc/Array.html +12 -2
  20. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  21. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  22. data/docs/doc/BooleanTermParser/Query.html +1 -1
  23. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  24. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  25. data/docs/doc/BooleanTermParser.html +1 -1
  26. data/docs/doc/Doing/ArrayCleanup.html +316 -0
  27. data/docs/doc/Doing/ArrayNestedHash.html +1 -1
  28. data/docs/doc/Doing/ArrayTags.html +1 -1
  29. data/docs/doc/Doing/CSVExport.html +1 -1
  30. data/docs/doc/Doing/CalendarImport.html +1 -1
  31. data/docs/doc/Doing/Change.html +74 -3
  32. data/docs/doc/Doing/Changes.html +3 -3
  33. data/docs/doc/Doing/ChronifyArray.html +1 -1
  34. data/docs/doc/Doing/ChronifyNumeric.html +1 -1
  35. data/docs/doc/Doing/ChronifyString.html +1 -1
  36. data/docs/doc/Doing/Color.html +1 -1
  37. data/docs/doc/Doing/Completion/BashCompletions.html +1 -1
  38. data/docs/doc/Doing/Completion/FishCompletions.html +1 -1
  39. data/docs/doc/Doing/Completion/StringUtils.html +1 -1
  40. data/docs/doc/Doing/Completion/ZshCompletions.html +1 -1
  41. data/docs/doc/Doing/Completion.html +1 -1
  42. data/docs/doc/Doing/Configuration.html +80 -1
  43. data/docs/doc/Doing/DayOneRenderer.html +1 -1
  44. data/docs/doc/Doing/DayoneExport.html +1 -1
  45. data/docs/doc/Doing/DoingImport.html +1 -1
  46. data/docs/doc/Doing/Entry.html +109 -4
  47. data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
  48. data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
  49. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  50. data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
  51. data/docs/doc/Doing/Errors/HistoryLimitError.html +1 -1
  52. data/docs/doc/Doing/Errors/InvalidPlugin.html +1 -1
  53. data/docs/doc/Doing/Errors/MissingBackupFile.html +1 -1
  54. data/docs/doc/Doing/Errors/NoResults.html +1 -1
  55. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  56. data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
  57. data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
  58. data/docs/doc/Doing/Errors.html +1 -1
  59. data/docs/doc/Doing/HTMLExport.html +1 -1
  60. data/docs/doc/Doing/Hooks.html +1 -1
  61. data/docs/doc/Doing/Item.html +1 -1
  62. data/docs/doc/Doing/ItemDates.html +1 -1
  63. data/docs/doc/Doing/ItemQuery.html +1 -1
  64. data/docs/doc/Doing/ItemState.html +1 -1
  65. data/docs/doc/Doing/ItemTags.html +1 -1
  66. data/docs/doc/Doing/Items.html +1 -1
  67. data/docs/doc/Doing/JSONExport.html +1 -1
  68. data/docs/doc/Doing/Logger.html +1 -1
  69. data/docs/doc/Doing/MarkdownExport.html +1 -1
  70. data/docs/doc/Doing/Note.html +1 -1
  71. data/docs/doc/Doing/Pager.html +1 -1
  72. data/docs/doc/Doing/Plugins.html +1 -1
  73. data/docs/doc/Doing/Prompt.html +1 -1
  74. data/docs/doc/Doing/PromptChoose.html +1 -1
  75. data/docs/doc/Doing/PromptFZF.html +1 -1
  76. data/docs/doc/Doing/PromptInput.html +1 -1
  77. data/docs/doc/Doing/PromptSTD.html +1 -1
  78. data/docs/doc/Doing/PromptYN.html +1 -1
  79. data/docs/doc/Doing/Section.html +1 -1
  80. data/docs/doc/Doing/StringHighlight.html +1 -1
  81. data/docs/doc/Doing/StringNormalize.html +35 -1
  82. data/docs/doc/Doing/StringQuery.html +1 -1
  83. data/docs/doc/Doing/StringTags.html +1 -1
  84. data/docs/doc/Doing/StringTransform.html +1 -1
  85. data/docs/doc/Doing/StringTruncate.html +1 -1
  86. data/docs/doc/Doing/StringURL.html +1 -1
  87. data/docs/doc/Doing/SymbolNormalize.html +1 -1
  88. data/docs/doc/Doing/TaskPaperExport.html +1 -1
  89. data/docs/doc/Doing/TemplateExport.html +1 -1
  90. data/docs/doc/Doing/TemplateString.html +2 -2
  91. data/docs/doc/Doing/TimingImport.html +1 -1
  92. data/docs/doc/Doing/Types.html +23 -18
  93. data/docs/doc/Doing/Util/Backup.html +1 -1
  94. data/docs/doc/Doing/Util.html +1 -1
  95. data/docs/doc/Doing/Version.html +1 -1
  96. data/docs/doc/Doing/WWID.html +71 -3
  97. data/docs/doc/Doing.html +2 -2
  98. data/docs/doc/FalseClass.html +11 -1
  99. data/docs/doc/GLI/Commands/Help.html +1 -1
  100. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  101. data/docs/doc/GLI/Commands.html +1 -1
  102. data/docs/doc/GLI.html +1 -1
  103. data/docs/doc/Hash.html +461 -6
  104. data/docs/doc/Numeric.html +1 -1
  105. data/docs/doc/Object.html +1 -1
  106. data/docs/doc/PhraseParser/Operator.html +1 -1
  107. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  108. data/docs/doc/PhraseParser/Query.html +1 -1
  109. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  110. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  111. data/docs/doc/PhraseParser/TermClause.html +1 -1
  112. data/docs/doc/PhraseParser.html +1 -1
  113. data/docs/doc/Status.html +1 -1
  114. data/docs/doc/String.html +4 -4
  115. data/docs/doc/Symbol.html +1 -1
  116. data/docs/doc/Time.html +68 -3
  117. data/docs/doc/TrueClass.html +11 -1
  118. data/docs/doc/_index.html +1 -1
  119. data/docs/doc/file.README.html +2 -2
  120. data/docs/doc/index.html +2 -2
  121. data/docs/doc/method_list.html +511 -407
  122. data/docs/doc/top-level-namespace.html +3 -1
  123. data/doing.rdoc +163 -7
  124. data/lib/completion/_doing.zsh +13 -13
  125. data/lib/completion/doing.bash +22 -22
  126. data/lib/completion/doing.fish +24 -1
  127. data/lib/doing/add_options.rb +40 -1
  128. data/lib/doing/changelog/change.rb +13 -5
  129. data/lib/doing/changelog/changes.rb +11 -2
  130. data/lib/doing/changelog/entry.rb +9 -2
  131. data/lib/doing/configuration.rb +21 -0
  132. data/lib/doing/good.rb +18 -1
  133. data/lib/doing/hash.rb +126 -22
  134. data/lib/doing/normalize.rb +13 -0
  135. data/lib/doing/pager.rb +1 -1
  136. data/lib/doing/types.rb +9 -8
  137. data/lib/doing/version.rb +1 -1
  138. data/lib/doing/wwid/display.rb +4 -1
  139. data/lib/doing/wwid/filter.rb +6 -3
  140. data/lib/doing/wwid/wwid.rb +21 -3
  141. data/lib/doing.rb +9 -0
  142. metadata +3 -2
@@ -61,9 +61,9 @@ _doing_cancel() {
61
61
  _doing_changes() {
62
62
 
63
63
  if [[ "$token" == --* ]]; then
64
- COMPREPLY=( $( compgen -W '--changes --all --interactive --lookup --markdown --render --search --sort' -- $token ) )
64
+ COMPREPLY=( $( compgen -W '--changes --all --interactive --lookup --markdown --only --prefix --render --search --sort' -- $token ) )
65
65
  elif [[ "$token" == -* ]]; then
66
- COMPREPLY=( $( compgen -W '-C -a -i -l -s --changes --all --interactive --lookup --markdown --render --search --sort' -- $token ) )
66
+ COMPREPLY=( $( compgen -W '-C -a -i -l -p -s --changes --all --interactive --lookup --markdown --only --prefix --render --search --sort' -- $token ) )
67
67
 
68
68
  fi
69
69
  }
@@ -111,9 +111,9 @@ _doing_finish() {
111
111
  _doing_grep() {
112
112
 
113
113
  if [[ "$token" == --* ]]; then
114
- COMPREPLY=( $( compgen -W '--after --before --bool --case --config_template --delete --duration --editor --from --hilite --interactive --not --output --only_timed --section --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
114
+ COMPREPLY=( $( compgen -W '--after --before --bool --case --config_template --delete --duration --editor --from --hilite --interactive --not --output --only_timed --section --save --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
115
115
  elif [[ "$token" == -* ]]; then
116
- COMPREPLY=( $( compgen -W '-d -e -h -i -o -s -t -x --after --before --bool --case --config_template --delete --duration --editor --from --hilite --interactive --not --output --only_timed --section --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
116
+ COMPREPLY=( $( compgen -W '-d -e -h -i -o -s -t -x --after --before --bool --case --config_template --delete --duration --editor --from --hilite --interactive --not --output --only_timed --section --save --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
117
117
 
118
118
  fi
119
119
  }
@@ -141,9 +141,9 @@ _doing_import() {
141
141
  _doing_last() {
142
142
 
143
143
  if [[ "$token" == --* ]]; then
144
- COMPREPLY=( $( compgen -W '--bool --case --config_template --delete --duration --editor --hilite --not --output --section --search --tag --template --val --exact' -- $token ) )
144
+ COMPREPLY=( $( compgen -W '--bool --case --config_template --delete --duration --editor --hilite --not --output --section --save --search --tag --template --title --val --exact' -- $token ) )
145
145
  elif [[ "$token" == -* ]]; then
146
- COMPREPLY=( $( compgen -W '-d -e -h -o -s -x --bool --case --config_template --delete --duration --editor --hilite --not --output --section --search --tag --template --val --exact' -- $token ) )
146
+ COMPREPLY=( $( compgen -W '-d -e -h -o -s -x --bool --case --config_template --delete --duration --editor --hilite --not --output --section --save --search --tag --template --title --val --exact' -- $token ) )
147
147
 
148
148
  fi
149
149
  }
@@ -191,9 +191,9 @@ _doing_now() {
191
191
  _doing_on() {
192
192
 
193
193
  if [[ "$token" == --* ]]; then
194
- COMPREPLY=( $( compgen -W '--after --before --bool --case --config_template --duration --from --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
194
+ COMPREPLY=( $( compgen -W '--after --before --bool --case --config_template --duration --from --not --output --only_timed --section --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
195
195
  elif [[ "$token" == -* ]]; then
196
- COMPREPLY=( $( compgen -W '-o -s -t -x --after --before --bool --case --config_template --duration --from --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
196
+ COMPREPLY=( $( compgen -W '-o -s -t -x --after --before --bool --case --config_template --duration --from --not --output --only_timed --section --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
197
197
 
198
198
  fi
199
199
  }
@@ -221,9 +221,9 @@ _doing_plugins() {
221
221
  _doing_recent() {
222
222
 
223
223
  if [[ "$token" == --* ]]; then
224
- COMPREPLY=( $( compgen -W '--config_template --duration --interactive --output --only_timed --section --times --tag_order --tag_sort --template --totals' -- $token ) )
224
+ COMPREPLY=( $( compgen -W '--config_template --duration --interactive --output --only_timed --section --save --times --tag_order --tag_sort --template --title --totals' -- $token ) )
225
225
  elif [[ "$token" == -* ]]; then
226
- COMPREPLY=( $( compgen -W '-i -o -s -t --config_template --duration --interactive --output --only_timed --section --times --tag_order --tag_sort --template --totals' -- $token ) )
226
+ COMPREPLY=( $( compgen -W '-i -o -s -t --config_template --duration --interactive --output --only_timed --section --save --times --tag_order --tag_sort --template --title --totals' -- $token ) )
227
227
 
228
228
  fi
229
229
  }
@@ -276,9 +276,9 @@ local words=$(doing sections)
276
276
  IFS="$OLD_IFS"
277
277
 
278
278
  if [[ "$token" == --* ]]; then
279
- COMPREPLY=( $( compgen -W '--age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --sort --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
279
+ COMPREPLY=( $( compgen -W '--age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --sort --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
280
280
  elif [[ "$token" == -* ]]; then
281
- COMPREPLY=( $( compgen -W '-a -c -e -h -i -m -o -s -t -x --age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --sort --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
281
+ COMPREPLY=( $( compgen -W '-a -c -e -h -i -m -o -s -t -x --age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --sort --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
282
282
  else
283
283
  local nocasematchWasOff=0
284
284
  shopt nocasematch >/dev/null || nocasematchWasOff=1
@@ -301,9 +301,9 @@ IFS="$OLD_IFS"
301
301
  _doing_since() {
302
302
 
303
303
  if [[ "$token" == --* ]]; then
304
- COMPREPLY=( $( compgen -W '--bool --case --config_template --duration --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
304
+ COMPREPLY=( $( compgen -W '--bool --case --config_template --duration --not --output --only_timed --section --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
305
305
  elif [[ "$token" == -* ]]; then
306
- COMPREPLY=( $( compgen -W '-o -s -t -x --bool --case --config_template --duration --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
306
+ COMPREPLY=( $( compgen -W '-o -s -t -x --bool --case --config_template --duration --not --output --only_timed --section --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
307
307
 
308
308
  fi
309
309
  }
@@ -351,9 +351,9 @@ _doing_template() {
351
351
  _doing_today() {
352
352
 
353
353
  if [[ "$token" == --* ]]; then
354
- COMPREPLY=( $( compgen -W '--after --before --config_template --duration --from --output --only_timed --section --times --tag_order --tag_sort --template --totals' -- $token ) )
354
+ COMPREPLY=( $( compgen -W '--after --before --config_template --duration --from --output --only_timed --section --save --times --tag_order --tag_sort --template --title --totals' -- $token ) )
355
355
  elif [[ "$token" == -* ]]; then
356
- COMPREPLY=( $( compgen -W '-o -s -t --after --before --config_template --duration --from --output --only_timed --section --times --tag_order --tag_sort --template --totals' -- $token ) )
356
+ COMPREPLY=( $( compgen -W '-o -s -t --after --before --config_template --duration --from --output --only_timed --section --save --times --tag_order --tag_sort --template --title --totals' -- $token ) )
357
357
 
358
358
  fi
359
359
  }
@@ -376,9 +376,9 @@ local words=$(doing views)
376
376
  IFS="$OLD_IFS"
377
377
 
378
378
  if [[ "$token" == --* ]]; then
379
- COMPREPLY=( $( compgen -W '--after --age --before --bool --count --case --color --duration --from --hilite --interactive --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --totals --val --exact' -- $token ) )
379
+ COMPREPLY=( $( compgen -W '--after --age --before --bool --count --case --color --config_template --duration --from --hilite --interactive --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
380
380
  elif [[ "$token" == -* ]]; then
381
- COMPREPLY=( $( compgen -W '-c -h -i -o -s -t -x --after --age --before --bool --count --case --color --duration --from --hilite --interactive --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --totals --val --exact' -- $token ) )
381
+ COMPREPLY=( $( compgen -W '-c -h -i -o -s -t -x --after --age --before --bool --count --case --color --config_template --duration --from --hilite --interactive --not --output --only_timed --section --search --times --tag --tag_order --tag_sort --template --totals --val --exact' -- $token ) )
382
382
  else
383
383
  local nocasematchWasOff=0
384
384
  shopt nocasematch >/dev/null || nocasematchWasOff=1
@@ -401,9 +401,9 @@ IFS="$OLD_IFS"
401
401
  _doing_views() {
402
402
 
403
403
  if [[ "$token" == --* ]]; then
404
- COMPREPLY=( $( compgen -W '--column' -- $token ) )
404
+ COMPREPLY=( $( compgen -W '--column --editor --output --remove' -- $token ) )
405
405
  elif [[ "$token" == -* ]]; then
406
- COMPREPLY=( $( compgen -W '-c --column' -- $token ) )
406
+ COMPREPLY=( $( compgen -W '-c -e -o -r --column --editor --output --remove' -- $token ) )
407
407
 
408
408
  fi
409
409
  }
@@ -421,9 +421,9 @@ _doing_wiki() {
421
421
  _doing_yesterday() {
422
422
 
423
423
  if [[ "$token" == --* ]]; then
424
- COMPREPLY=( $( compgen -W '--after --before --config_template --duration --from --output --only_timed --section --times --tag_order --tag_sort --template --totals' -- $token ) )
424
+ COMPREPLY=( $( compgen -W '--after --before --config_template --duration --from --output --only_timed --section --save --times --tag_order --tag_sort --template --title --totals' -- $token ) )
425
425
  elif [[ "$token" == -* ]]; then
426
- COMPREPLY=( $( compgen -W '-o -s -t --after --before --config_template --duration --from --output --only_timed --section --times --tag_order --tag_sort --template --totals' -- $token ) )
426
+ COMPREPLY=( $( compgen -W '-o -s -t --after --before --config_template --duration --from --output --only_timed --section --save --times --tag_order --tag_sort --template --title --totals' -- $token ) )
427
427
 
428
428
  fi
429
429
  }
@@ -228,6 +228,8 @@ complete -c doing -l all -s a -f -n '__fish_doing_using_command changes changel
228
228
  complete -c doing -l interactive -s i -f -n '__fish_doing_using_command changes changelog' -d Open\ changelog\ in\ interactive\ viewer
229
229
  complete -c doing -l lookup -s l -f -r -n '__fish_doing_using_command changes changelog' -d Look\ up\ a\ specific\ version
230
230
  complete -c doing -l markdown -f -n '__fish_doing_using_command changes changelog' -d Output\ raw\ Markdown
231
+ complete -c doing -l only -f -r -n '__fish_doing_using_command changes changelog' -d Only\ show\ changes\ of\ type\(s\)
232
+ complete -c doing -l prefix -s p -f -n '__fish_doing_using_command changes changelog' -d Include
231
233
  complete -c doing -l render -f -n '__fish_doing_using_command changes changelog' -d Force\ rendered\ output
232
234
  complete -c doing -l search -s s -f -r -n '__fish_doing_using_command changes changelog' -d Show\ changelogs\ matching\ search\ terms
233
235
  complete -c doing -l sort -f -r -n '__fish_doing_using_command changes changelog' -d Sort\ order
@@ -281,11 +283,13 @@ complete -c doing -l not -f -n '__fish_doing_using_command grep search' -d Sea
281
283
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command grep search' -d Output\ to\ export\ format
282
284
  complete -c doing -l only_timed -f -n '__fish_doing_using_command grep search' -d Only\ show\ items\ with\ recorded\ time\ intervals
283
285
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command grep search' -d Section
286
+ complete -c doing -l save -f -r -n '__fish_doing_using_command grep search' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
284
287
  complete -c doing -l times -s t -f -n '__fish_doing_using_command grep search' -d Show\ time\ intervals\ on\ @done\ tasks
285
288
  complete -c doing -l tag -f -r -n '__fish_doing_using_command grep search' -d Filter\ entries\ by\ tag
286
289
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command grep search' -d Tag\ sort\ direction
287
290
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command grep search' -d Sort\ tags\ by
288
291
  complete -c doing -l template -f -r -n '__fish_doing_using_command grep search' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
292
+ complete -c doing -l title -f -r -n '__fish_doing_using_command grep search' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
289
293
  complete -c doing -l totals -f -n '__fish_doing_using_command grep search' -d Show\ time\ totals\ at\ the\ end\ of\ output
290
294
  complete -c doing -l val -f -r -n '__fish_doing_using_command grep search' -d Perform\ a\ tag\ value\ query
291
295
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command grep search' -d Force\ exact\ string\ matching
@@ -314,9 +318,11 @@ complete -c doing -l hilite -s h -f -n '__fish_doing_using_command last' -d Hig
314
318
  complete -c doing -l not -f -n '__fish_doing_using_command last' -d Show\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
315
319
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command last' -d Output\ to\ export\ format
316
320
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command last' -d Specify\ a\ section
321
+ complete -c doing -l save -f -r -n '__fish_doing_using_command last' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
317
322
  complete -c doing -l search -f -r -n '__fish_doing_using_command last' -d Filter\ entries\ using\ a\ search\ query
318
323
  complete -c doing -l tag -f -r -n '__fish_doing_using_command last' -d Filter\ entries\ by\ tag
319
324
  complete -c doing -l template -f -r -n '__fish_doing_using_command last' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
325
+ complete -c doing -l title -f -r -n '__fish_doing_using_command last' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
320
326
  complete -c doing -l val -f -r -n '__fish_doing_using_command last' -d Perform\ a\ tag\ value\ query
321
327
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command last' -d Force\ exact\ search\ string\ matching
322
328
  complete -c doing -l bool -f -r -n '__fish_doing_using_command mark flag' -d Boolean\ used\ to\ combine\ multiple\ tags
@@ -371,12 +377,14 @@ complete -c doing -l not -f -n '__fish_doing_using_command on' -d Show\ items\
371
377
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command on' -d Output\ to\ export\ format
372
378
  complete -c doing -l only_timed -f -n '__fish_doing_using_command on' -d Only\ show\ items\ with\ recorded\ time\ intervals
373
379
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command on' -d Section
380
+ complete -c doing -l save -f -r -n '__fish_doing_using_command on' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
374
381
  complete -c doing -l search -f -r -n '__fish_doing_using_command on' -d Filter\ entries\ using\ a\ search\ query
375
382
  complete -c doing -l times -s t -f -n '__fish_doing_using_command on' -d Show\ time\ intervals\ on\ @done\ tasks
376
383
  complete -c doing -l tag -f -r -n '__fish_doing_using_command on' -d Filter\ entries\ by\ tag
377
384
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command on' -d Tag\ sort\ direction
378
385
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command on' -d Sort\ tags\ by
379
386
  complete -c doing -l template -f -r -n '__fish_doing_using_command on' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
387
+ complete -c doing -l title -f -r -n '__fish_doing_using_command on' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
380
388
  complete -c doing -l totals -f -n '__fish_doing_using_command on' -d Show\ time\ totals\ at\ the\ end\ of\ output
381
389
  complete -c doing -l val -f -r -n '__fish_doing_using_command on' -d Perform\ a\ tag\ value\ query
382
390
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command on' -d Force\ exact\ search\ string\ matching
@@ -391,10 +399,12 @@ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command recent'
391
399
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command recent' -d Output\ to\ export\ format
392
400
  complete -c doing -l only_timed -f -n '__fish_doing_using_command recent' -d Only\ show\ items\ with\ recorded\ time\ intervals
393
401
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command recent' -d Section
402
+ complete -c doing -l save -f -r -n '__fish_doing_using_command recent' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
394
403
  complete -c doing -l times -s t -f -n '__fish_doing_using_command recent' -d Show\ time\ intervals\ on\ @done\ tasks
395
404
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command recent' -d Tag\ sort\ direction
396
405
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command recent' -d Sort\ tags\ by
397
406
  complete -c doing -l template -f -r -n '__fish_doing_using_command recent' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
407
+ complete -c doing -l title -f -r -n '__fish_doing_using_command recent' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
398
408
  complete -c doing -l totals -f -n '__fish_doing_using_command recent' -d Show\ time\ totals\ at\ the\ end\ of\ output
399
409
  complete -c doing -l file -s f -f -r -n '__fish_doing_using_command redo' -d Specify\ alternate\ doing\ file
400
410
  complete -c doing -l interactive -s i -f -n '__fish_doing_using_command redo' -d Select\ from\ an\ interactive\ menu
@@ -461,12 +471,14 @@ complete -c doing -l not -f -n '__fish_doing_using_command show' -d Show\ item
461
471
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command show' -d Output\ to\ export\ format
462
472
  complete -c doing -l only_timed -f -n '__fish_doing_using_command show' -d Only\ show\ items\ with\ recorded\ time\ intervals
463
473
  complete -c doing -l sort -s s -f -r -n '__fish_doing_using_command show' -d Sort\ order
474
+ complete -c doing -l save -f -r -n '__fish_doing_using_command show' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
464
475
  complete -c doing -l search -f -r -n '__fish_doing_using_command show' -d Filter\ entries\ using\ a\ search\ query
465
476
  complete -c doing -l times -s t -f -n '__fish_doing_using_command show' -d Show\ time\ intervals\ on\ @done\ tasks
466
477
  complete -c doing -l tag -f -r -n '__fish_doing_using_command show' -d Filter\ entries\ by\ tag
467
478
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command show' -d Tag\ sort\ direction
468
479
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command show' -d Sort\ tags\ by
469
480
  complete -c doing -l template -f -r -n '__fish_doing_using_command show' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
481
+ complete -c doing -l title -f -r -n '__fish_doing_using_command show' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
470
482
  complete -c doing -l totals -f -n '__fish_doing_using_command show' -d Show\ time\ totals\ at\ the\ end\ of\ output
471
483
  complete -c doing -l val -f -r -n '__fish_doing_using_command show' -d Perform\ a\ tag\ value\ query
472
484
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command show' -d Force\ exact\ search\ string\ matching
@@ -478,12 +490,14 @@ complete -c doing -l not -f -n '__fish_doing_using_command since' -d Since\ it
478
490
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command since' -d Output\ to\ export\ format
479
491
  complete -c doing -l only_timed -f -n '__fish_doing_using_command since' -d Only\ show\ items\ with\ recorded\ time\ intervals
480
492
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command since' -d Section
493
+ complete -c doing -l save -f -r -n '__fish_doing_using_command since' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
481
494
  complete -c doing -l search -f -r -n '__fish_doing_using_command since' -d Filter\ entries\ using\ a\ search\ query
482
495
  complete -c doing -l times -s t -f -n '__fish_doing_using_command since' -d Show\ time\ intervals\ on\ @done\ tasks
483
496
  complete -c doing -l tag -f -r -n '__fish_doing_using_command since' -d Filter\ entries\ by\ tag
484
497
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command since' -d Tag\ sort\ direction
485
498
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command since' -d Sort\ tags\ by
486
499
  complete -c doing -l template -f -r -n '__fish_doing_using_command since' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
500
+ complete -c doing -l title -f -r -n '__fish_doing_using_command since' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
487
501
  complete -c doing -l totals -f -n '__fish_doing_using_command since' -d Show\ time\ totals\ at\ the\ end\ of\ output
488
502
  complete -c doing -l val -f -r -n '__fish_doing_using_command since' -d Perform\ a\ tag\ value\ query
489
503
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command since' -d Force\ exact\ search\ string\ matching
@@ -533,10 +547,12 @@ complete -c doing -l from -f -r -n '__fish_doing_using_command today' -d Time\
533
547
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command today' -d Output\ to\ export\ format
534
548
  complete -c doing -l only_timed -f -n '__fish_doing_using_command today' -d Only\ show\ items\ with\ recorded\ time\ intervals
535
549
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command today' -d Specify\ a\ section
550
+ complete -c doing -l save -f -r -n '__fish_doing_using_command today' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
536
551
  complete -c doing -l times -s t -f -n '__fish_doing_using_command today' -d Show\ time\ intervals\ on\ @done\ tasks
537
552
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command today' -d Tag\ sort\ direction
538
553
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command today' -d Sort\ tags\ by
539
554
  complete -c doing -l template -f -r -n '__fish_doing_using_command today' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
555
+ complete -c doing -l title -f -r -n '__fish_doing_using_command today' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
540
556
  complete -c doing -l totals -f -n '__fish_doing_using_command today' -d Show\ time\ totals\ at\ the\ end\ of\ output
541
557
  complete -c doing -l file -s f -f -r -n '__fish_doing_using_command undo' -d Specify\ alternate\ doing\ file
542
558
  complete -c doing -l interactive -s i -f -n '__fish_doing_using_command undo' -d Select\ from\ recent\ backups
@@ -549,6 +565,7 @@ complete -c doing -l bool -f -r -n '__fish_doing_using_command view' -d Boolean
549
565
  complete -c doing -l count -s c -f -r -n '__fish_doing_using_command view' -d Count\ to\ display
550
566
  complete -c doing -l case -f -r -n '__fish_doing_using_command view' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
551
567
  complete -c doing -l color -f -n '__fish_doing_using_command view' -d Include\ colors\ in\ output
568
+ complete -c doing -l config_template -f -r -n '__fish_doing_using_command view' -d Output\ using\ a\ template\ from\ configuration
552
569
  complete -c doing -l duration -f -n '__fish_doing_using_command view' -d Show\ elapsed\ time\ on\ entries\ without\ @done\ tag
553
570
  complete -c doing -l from -f -r -n '__fish_doing_using_command view' -d Date\ range
554
571
  complete -c doing -l hilite -s h -f -n '__fish_doing_using_command view' -d Highlight\ search\ matches\ in\ output
@@ -562,10 +579,14 @@ complete -c doing -l times -s t -f -n '__fish_doing_using_command view' -d Show
562
579
  complete -c doing -l tag -f -r -n '__fish_doing_using_command view' -d Filter\ entries\ by\ tag
563
580
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command view' -d Tag\ sort\ direction
564
581
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command view' -d Sort\ tags\ by
582
+ complete -c doing -l template -f -r -n '__fish_doing_using_command view' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
565
583
  complete -c doing -l totals -f -n '__fish_doing_using_command view' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
566
584
  complete -c doing -l val -f -r -n '__fish_doing_using_command view' -d Perform\ a\ tag\ value\ query
567
585
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command view' -d Force\ exact\ search\ string\ matching
568
586
  complete -c doing -l column -s c -f -n '__fish_doing_using_command views' -d List\ in\ single\ column
587
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command views' -d Open\ YAML\ for\ view\ in\ editor
588
+ complete -c doing -l output -s o -f -r -n '__fish_doing_using_command views' -d Output/edit\ view\ in\ alternative\ format
589
+ complete -c doing -l remove -s r -f -n '__fish_doing_using_command views' -d Delete\ view\ config
569
590
  complete -c doing -l after -f -r -n '__fish_doing_using_command wiki' -d Include\ entries\ newer\ than\ date
570
591
  complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command wiki' -d Tag\ boolean
571
592
  complete -c doing -l before -f -r -n '__fish_doing_using_command wiki' -d Include\ entries\ older\ than\ date
@@ -582,12 +603,14 @@ complete -c doing -l from -f -r -n '__fish_doing_using_command yesterday' -d Ti
582
603
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command yesterday' -d Output\ to\ export\ format
583
604
  complete -c doing -l only_timed -f -n '__fish_doing_using_command yesterday' -d Only\ show\ items\ with\ recorded\ time\ intervals
584
605
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command yesterday' -d Specify\ a\ section
606
+ complete -c doing -l save -f -r -n '__fish_doing_using_command yesterday' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
585
607
  complete -c doing -l times -s t -f -n '__fish_doing_using_command yesterday' -d Show\ time\ intervals\ on\ @done\ tasks
586
608
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command yesterday' -d Tag\ sort\ direction
587
609
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command yesterday' -d Sort\ tags\ by
588
610
  complete -c doing -l template -f -r -n '__fish_doing_using_command yesterday' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
611
+ complete -c doing -l title -f -r -n '__fish_doing_using_command yesterday' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
589
612
  complete -c doing -l totals -f -n '__fish_doing_using_command yesterday' -d Show\ time\ totals\ at\ the\ end\ of\ output
590
- complete -f -c doing -s o -l output -x -n '__fish_doing_using_command grep search last on recent select show since today view yesterday' -a '(__fish_doing_export_plugin)'
613
+ complete -f -c doing -s o -l output -x -n '__fish_doing_using_command grep search last on recent select show since today view views yesterday' -a '(__fish_doing_export_plugin)'
591
614
  complete -f -c doing -s b -l bool -x -n '__fish_doing_using_command again resume archive move autotag cancel finish grep search last mark flag note on reset begin rotate show since tag tags view wiki' -a 'and or not pattern'
592
615
  complete -f -c doing -l case -x -n '__fish_doing_using_command again resume archive move cancel finish grep search import last mark flag note on reset begin rotate select show since tag tags view' -a 'case-sensitive ignore smart'
593
616
  complete -f -c doing -l sort -x -n '__fish_doing_using_command changes changelog show tags' -a 'asc desc'
@@ -19,6 +19,8 @@
19
19
  ##
20
20
  ## :date_filter => --before, --after, --from
21
21
  ##
22
+ ## :save => --save
23
+ ##
22
24
  ## @param type [Symbol] The type
23
25
  ## @param cmd The GLI command to which the options will be added
24
26
  ##
@@ -41,12 +43,24 @@ def add_options(type, cmd, default_template: 'default')
41
43
  when :output_template
42
44
  cmd.desc "Output to export format (#{Doing::Plugins.plugin_names(type: :export)})"
43
45
  cmd.arg_name 'FORMAT'
44
- cmd.flag %i[o output]
46
+ cmd.flag %i[o output], type: ExportTemplate
45
47
 
46
48
  cmd.desc "Output using a template from configuration"
47
49
  cmd.arg_name 'TEMPLATE_KEY'
48
50
  cmd.flag [:config_template], type: TemplateName, default_value: default_template
49
51
 
52
+ cmd.desc 'Override output format with a template string containing %placeholders'
53
+ cmd.arg_name 'TEMPLATE_STRING'
54
+ cmd.flag [:template]
55
+ when :output_template_no_defaults
56
+ cmd.desc "Output to export format (#{Doing::Plugins.plugin_names(type: :export)})"
57
+ cmd.arg_name 'FORMAT'
58
+ cmd.flag %i[o output]
59
+
60
+ cmd.desc "Output using a template from configuration"
61
+ cmd.arg_name 'TEMPLATE_KEY'
62
+ cmd.flag [:config_template], type: TemplateName
63
+
50
64
  cmd.desc 'Override output format with a template string containing %placeholders'
51
65
  cmd.arg_name 'TEMPLATE_STRING'
52
66
  cmd.flag [:template]
@@ -138,6 +152,23 @@ def add_options(type, cmd, default_template: 'default')
138
152
  cmd.flag [:bool], must_match: REGEX_BOOL,
139
153
  default_value: :pattern,
140
154
  type: BooleanSymbol
155
+ when :tag_filter_no_defaults
156
+ cmd.desc 'Filter entries by tag. Combine multiple tags with a comma. Wildcards allowed (*, ?)'
157
+ cmd.arg_name 'TAG'
158
+ cmd.flag [:tag], type: TagArray
159
+
160
+ cmd.desc 'Perform a tag value query ("@done > two hours ago" or "@progress < 50").
161
+ May be used multiple times, combined with --bool'
162
+ cmd.arg_name 'QUERY'
163
+ cmd.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY
164
+
165
+ cmd.desc "#{action} items that *don't* match search/tag filters"
166
+ cmd.switch [:not], negatable: false
167
+
168
+ cmd.desc 'Boolean used to combine multiple tags. Use PATTERN to parse + and - as booleans'
169
+ cmd.arg_name 'BOOLEAN'
170
+ cmd.flag [:bool], must_match: REGEX_BOOL,
171
+ type: BooleanSymbol
141
172
  when :time_filter
142
173
  cmd.desc 'View entries before specified time (e.g. 8am, 12:30pm, 15:00)'
143
174
  cmd.arg_name 'TIME_STRING'
@@ -186,5 +217,13 @@ def add_options(type, cmd, default_template: 'default')
186
217
  end
187
218
  cmd.arg_name 'DATE_OR_RANGE'
188
219
  cmd.flag [:from], type: DateRangeString
220
+ when :save
221
+ cmd.desc 'Save all current command line options as a new view'
222
+ cmd.arg_name 'VIEW_NAME'
223
+ cmd.flag %i[save], type: String
224
+
225
+ cmd.desc 'Title string to be used for output formats that require it'
226
+ cmd.arg_name 'TITLE'
227
+ cmd.flag %i[title], type: String
189
228
  end
190
229
  end
@@ -7,9 +7,13 @@ module Doing
7
7
 
8
8
  attr_accessor :entries, :change_date
9
9
 
10
- def initialize(version, content)
10
+ attr_writer :prefix
11
+
12
+ def initialize(version, content, prefix: false, only: %i[changed new improved fixed])
11
13
  @version = Version.new(version)
12
14
  @content = content
15
+ @prefix = prefix
16
+ @only = only
13
17
  parse_entries
14
18
  end
15
19
 
@@ -18,10 +22,10 @@ module Doing
18
22
  @change_date = Time.parse(date[0]) if date
19
23
 
20
24
  @entries = []
21
- types = @content.scan(/(?<=\n|\A)#### (NEW|IMPROVED|FIXED)(.*?)(?=\n####|\Z)/m)
25
+ types = @content.scan(/(?<=\n|\A)#### (CHANGED|NEW|IMPROVED|FIXED)(.*?)(?=\n####|\Z)/m)
22
26
  types.each do |type|
23
27
  type[1].scan(/\s*- +(.*?)$/).each do |entry|
24
- @entries << Entry.new(entry[0].strip, type[0])
28
+ @entries << Entry.new(entry[0].strip, type[0], prefix: @prefix)
25
29
  end
26
30
  end
27
31
  end
@@ -57,7 +61,7 @@ module Doing
57
61
  end
58
62
 
59
63
  def split_items
60
- items = { new: [], improved: [], fixed: [], other: [] }
64
+ items = { changed: [], new: [], improved: [], fixed: [], other: [] }
61
65
 
62
66
  @entries.each do |e|
63
67
  type = e.type.downcase.to_sym
@@ -76,6 +80,8 @@ module Doing
76
80
  out = ["### __#{@version}__#{date}"]
77
81
 
78
82
  split_items.each do |type, members|
83
+ next unless @only.include?(type)
84
+
79
85
  if members.count.positive?
80
86
  out << "#### #{type.to_s.capitalize}"
81
87
  out << members.map(&:to_s).join("\n")
@@ -88,7 +94,9 @@ module Doing
88
94
  def changes_only
89
95
  out = []
90
96
 
91
- split_items.each do |_, members|
97
+ split_items.each do |type, members|
98
+ next unless @only.include?(type)
99
+
92
100
  out << members.map(&:to_s).join("\n")
93
101
  end
94
102
 
@@ -6,8 +6,10 @@ module Doing
6
6
  attr_reader :changes
7
7
  attr_writer :changes_only
8
8
 
9
- def initialize(lookup: nil, search: nil, changes: false, sort: :desc)
9
+ def initialize(lookup: nil, search: nil, changes: false, sort: :desc, prefix: false, only: %i[changed new improved fixed])
10
10
  @changes_only = changes
11
+ @prefix = prefix
12
+ @only = only
11
13
  changelog = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'CHANGELOG.md'))
12
14
  raise 'Error locating changelog' unless File.exist?(changelog)
13
15
 
@@ -56,9 +58,10 @@ module Doing
56
58
  @changes = @content.scan(change_rx).each_with_object([]) do |m, a|
57
59
  next if m[0].nil? || m[1].nil?
58
60
 
59
- a << Change.new(m[0], m[1].strip)
61
+ a << Change.new(m[0], m[1].strip, prefix: @prefix)
60
62
  end
61
63
 
64
+ select_type
62
65
  lookup(lookup) unless lookup.nil?
63
66
  search(search) unless search.nil?
64
67
  end
@@ -98,5 +101,11 @@ module Doing
98
101
 
99
102
  @changes.delete_if { |c| c.nil? || c.entries.nil? }
100
103
  end
104
+
105
+ def select_type
106
+ @changes.map do |c|
107
+ c.entries.delete_if { |e| !@only.include?(e.type.normalize_change_type) }
108
+ end
109
+ end
101
110
  end
102
111
  end
@@ -5,17 +5,24 @@ module Doing
5
5
  class Entry
6
6
  attr_reader :type, :string
7
7
 
8
- def initialize(string, type)
8
+ attr_writer :prefix
9
+
10
+ def initialize(string, type, prefix: false)
9
11
  @string = string
10
12
  @type = type
13
+ @prefix = prefix
11
14
  end
12
15
 
13
16
  def clean(string)
14
17
  string.gsub(/\|/, '\|')
15
18
  end
16
19
 
20
+ def print_prefix
21
+ @prefix ? "#{@type}: " : ''
22
+ end
23
+
17
24
  def to_s
18
- "- #{clean(@string)}"
25
+ "- #{print_prefix}#{clean(@string)}"
19
26
  end
20
27
  end
21
28
  end
@@ -361,6 +361,27 @@ module Doing
361
361
  config
362
362
  end
363
363
 
364
+ ##
365
+ ## Save a set of options to the `views` configuration
366
+ ##
367
+ ## @param view [Hash] view options
368
+ ## @param title [String] view title
369
+ ##
370
+ def save_view(view, title)
371
+ title.downcase!
372
+ default_template = Doing.setting('templates.default')
373
+ user_config = Util.safe_load_file(config_file)
374
+ user_config['views'] = {} unless user_config.key?('views')
375
+
376
+ view.delete_if { |k, v| v == default_template[k] }
377
+
378
+ user_config['views'][title] = view
379
+ Util.write_to_file(config_file, YAML.dump(user_config), backup: true)
380
+ Doing.logger.warn('Config:', %(View "#{title}" saved to #{config_file}))
381
+ Doing.logger.info('Config:', %(to use, run `doing view #{title}`))
382
+ Hooks.trigger :post_config, self
383
+ end
384
+
364
385
  # @private
365
386
  def inspect
366
387
  %(<Doing::Configuration #{@settings.hash}>)
data/lib/doing/good.rb CHANGED
@@ -18,10 +18,24 @@ module Doing
18
18
  ## has content
19
19
  ##
20
20
  def good?
21
- !nil? && !empty?
21
+ !nil? && !self&.empty? || false
22
+ end
23
+ end
24
+
25
+ # Time helpers
26
+ class ::Time
27
+ ##
28
+ ## Tests if object is nil
29
+ ##
30
+ ## @return [Boolean] true if object is defined and
31
+ ## has content
32
+ ##
33
+ def good?
34
+ !nil?
22
35
  end
23
36
  end
24
37
 
38
+ # String helpers
25
39
  class ::String
26
40
  ##
27
41
  ## Tests if object is nil or empty
@@ -34,6 +48,7 @@ module Doing
34
48
  end
35
49
  end
36
50
 
51
+ # Array helpers
37
52
  class ::Array
38
53
  ##
39
54
  ## Tests if object is nil or empty
@@ -46,6 +61,7 @@ module Doing
46
61
  end
47
62
  end
48
63
 
64
+ # Boolean helpers
49
65
  class ::FalseClass
50
66
  ##
51
67
  ## Tests if object is nil or empty
@@ -62,6 +78,7 @@ module Doing
62
78
  end
63
79
  end
64
80
 
81
+ # Boolean helpers
65
82
  class ::TrueClass
66
83
  ##
67
84
  ## Tests if object is nil or empty