doing 2.1.12 → 2.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.irbrc +1 -0
  3. data/.yardoc/checksums +16 -14
  4. data/.yardoc/object_types +0 -0
  5. data/.yardoc/objects/root.dat +0 -0
  6. data/CHANGELOG.md +67 -0
  7. data/Gemfile.lock +9 -2
  8. data/README.md +56 -19
  9. data/bin/doing +317 -113
  10. data/docs/doc/Array.html +117 -3
  11. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  12. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  13. data/docs/doc/BooleanTermParser/Query.html +1 -1
  14. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  15. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  16. data/docs/doc/BooleanTermParser.html +1 -1
  17. data/docs/doc/Doing/Color.html +1 -1
  18. data/docs/doc/Doing/Completion.html +1 -1
  19. data/docs/doc/Doing/Configuration.html +7 -4
  20. data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
  21. data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
  22. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  23. data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
  24. data/docs/doc/Doing/Errors/NoResults.html +1 -1
  25. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  26. data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
  27. data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
  28. data/docs/doc/Doing/Errors.html +1 -1
  29. data/docs/doc/Doing/Hooks.html +1 -1
  30. data/docs/doc/Doing/Item.html +337 -14
  31. data/docs/doc/Doing/Items.html +66 -2
  32. data/docs/doc/Doing/LogAdapter.html +1 -1
  33. data/docs/doc/Doing/Note.html +2 -2
  34. data/docs/doc/Doing/Pager.html +1 -1
  35. data/docs/doc/Doing/Plugins.html +1 -1
  36. data/docs/doc/Doing/Prompt.html +103 -1
  37. data/docs/doc/Doing/Section.html +1 -1
  38. data/docs/doc/Doing/TemplateString.html +2 -2
  39. data/docs/doc/Doing/Util/Backup.html +84 -1
  40. data/docs/doc/Doing/Util.html +1 -1
  41. data/docs/doc/Doing/WWID.html +214 -35
  42. data/docs/doc/Doing.html +3 -3
  43. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  44. data/docs/doc/GLI/Commands.html +1 -1
  45. data/docs/doc/GLI.html +1 -1
  46. data/docs/doc/Hash.html +1 -1
  47. data/docs/doc/Numeric.html +279 -0
  48. data/docs/doc/PhraseParser/Operator.html +1 -1
  49. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  50. data/docs/doc/PhraseParser/Query.html +1 -1
  51. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  52. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  53. data/docs/doc/PhraseParser/TermClause.html +1 -1
  54. data/docs/doc/PhraseParser.html +1 -1
  55. data/docs/doc/Status.html +1 -1
  56. data/docs/doc/String.html +881 -138
  57. data/docs/doc/Symbol.html +1 -1
  58. data/docs/doc/Time.html +1 -1
  59. data/docs/doc/_index.html +14 -9
  60. data/docs/doc/class_list.html +1 -1
  61. data/docs/doc/file.README.html +41 -15
  62. data/docs/doc/index.html +41 -15
  63. data/docs/doc/method_list.html +408 -256
  64. data/docs/doc/top-level-namespace.html +2 -2
  65. data/docs/index.md +56 -19
  66. data/doing.gemspec +2 -0
  67. data/doing.rdoc +257 -48
  68. data/example_plugin.rb +2 -4
  69. data/lib/completion/_doing.zsh +31 -27
  70. data/lib/completion/doing.bash +50 -39
  71. data/lib/completion/doing.fish +37 -7
  72. data/lib/doing/array_chronify.rb +57 -0
  73. data/lib/doing/configuration.rb +4 -1
  74. data/lib/doing/item.rb +176 -0
  75. data/lib/doing/log_adapter.rb +1 -1
  76. data/lib/doing/numeric_chronify.rb +40 -0
  77. data/lib/doing/plugins/export/dayone_export.rb +1 -1
  78. data/lib/doing/plugins/export/json_export.rb +2 -2
  79. data/lib/doing/plugins/export/template_export.rb +47 -90
  80. data/lib/doing/plugins/import/calendar_import.rb +13 -1
  81. data/lib/doing/plugins/import/doing_import.rb +12 -1
  82. data/lib/doing/plugins/import/timing_import.rb +13 -1
  83. data/lib/doing/prompt.rb +54 -1
  84. data/lib/doing/string.rb +97 -33
  85. data/lib/doing/string_chronify.rb +112 -14
  86. data/lib/doing/template_string.rb +1 -1
  87. data/lib/doing/time.rb +6 -6
  88. data/lib/doing/util_backup.rb +1 -1
  89. data/lib/doing/version.rb +1 -1
  90. data/lib/doing/wwid.rb +128 -103
  91. data/lib/doing.rb +36 -31
  92. data/lib/examples/plugins/say_export.rb +1 -4
  93. metadata +46 -2
data/lib/doing.rb CHANGED
@@ -9,42 +9,47 @@ require 'csv'
9
9
  require 'tempfile'
10
10
  require 'zlib'
11
11
  require 'base64'
12
-
13
- require 'chronic'
14
- require 'tty-link'
15
- require 'tty-which'
16
- require 'tty-markdown'
17
12
  require 'plist'
18
- # require 'amatch'
13
+ require 'readline'
19
14
  require 'haml'
20
15
  require 'json'
21
16
  require 'logger'
22
17
  require 'safe_yaml/load'
23
- require 'doing/hash'
24
- require 'doing/colors'
25
- require 'doing/template_string'
26
- require 'doing/string'
27
- require 'doing/string_chronify'
28
- require 'doing/time'
29
- require 'doing/array'
30
- require 'doing/symbol'
31
- require 'doing/util'
32
- require 'doing/util_backup'
33
- require 'doing/configuration'
34
- require 'doing/section'
35
- require 'doing/items'
36
- require 'doing/note'
37
- require 'doing/item'
38
- require 'doing/wwid'
39
- require 'doing/log_adapter'
40
- require 'doing/prompt'
41
- require 'doing/errors'
42
- require 'doing/hooks'
43
- require 'doing/plugin_manager'
44
- require 'doing/pager'
45
- require 'doing/completion'
46
- require 'doing/boolean_term_parser'
47
- require 'doing/phrase_parser'
18
+
19
+ require 'chronic'
20
+ require 'tty-link'
21
+ require 'tty-which'
22
+ require 'tty-markdown'
23
+ require 'tty-reader'
24
+ require 'tty-screen'
25
+
26
+ require_relative 'doing/hash'
27
+ require_relative 'doing/colors'
28
+ require_relative 'doing/template_string'
29
+ require_relative 'doing/string'
30
+ require_relative 'doing/time'
31
+ require_relative 'doing/array'
32
+ require_relative 'doing/symbol'
33
+ require_relative 'doing/util'
34
+ require_relative 'doing/util_backup'
35
+ require_relative 'doing/configuration'
36
+ require_relative 'doing/section'
37
+ require_relative 'doing/items'
38
+ require_relative 'doing/note'
39
+ require_relative 'doing/item'
40
+ require_relative 'doing/wwid'
41
+ require_relative 'doing/log_adapter'
42
+ require_relative 'doing/prompt'
43
+ require_relative 'doing/errors'
44
+ require_relative 'doing/hooks'
45
+ require_relative 'doing/plugin_manager'
46
+ require_relative 'doing/pager'
47
+ require_relative 'doing/completion'
48
+ require_relative 'doing/boolean_term_parser'
49
+ require_relative 'doing/phrase_parser'
50
+ require_relative 'doing/array_chronify'
51
+ require_relative 'doing/numeric_chronify'
52
+ require_relative 'doing/string_chronify'
48
53
  # require 'doing/markdown_document_listener'
49
54
 
50
55
  # Main doing module
@@ -149,11 +149,8 @@ module Doing
149
149
  finished_at = i.end_date
150
150
  took += finished_at.strftime('%A %B %e at %I:%M%p')
151
151
 
152
- d, h, m = wwid.format_time(interval)
153
152
  took += ' and it took'
154
- took += " #{d.to_i} days" if d.to_i.positive?
155
- took += " #{h.to_i} hours" if h.to_i.positive?
156
- took += " #{m.to_i} minutes" if m.to_i.positive?
153
+ took += interval.time_string(format: :natural)
157
154
  end
158
155
  end
159
156
 
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.12
4
+ version: 2.1.16
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-01-12 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml
@@ -346,6 +346,46 @@ dependencies:
346
346
  - - ">="
347
347
  - !ruby/object:Gem::Version
348
348
  version: 0.7.0
349
+ - !ruby/object:Gem::Dependency
350
+ name: tty-reader
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - "~>"
354
+ - !ruby/object:Gem::Version
355
+ version: '0.9'
356
+ - - ">="
357
+ - !ruby/object:Gem::Version
358
+ version: 0.9.0
359
+ type: :runtime
360
+ prerelease: false
361
+ version_requirements: !ruby/object:Gem::Requirement
362
+ requirements:
363
+ - - "~>"
364
+ - !ruby/object:Gem::Version
365
+ version: '0.9'
366
+ - - ">="
367
+ - !ruby/object:Gem::Version
368
+ version: 0.9.0
369
+ - !ruby/object:Gem::Dependency
370
+ name: tty-screen
371
+ requirement: !ruby/object:Gem::Requirement
372
+ requirements:
373
+ - - "~>"
374
+ - !ruby/object:Gem::Version
375
+ version: '0.8'
376
+ - - ">="
377
+ - !ruby/object:Gem::Version
378
+ version: 0.8.1
379
+ type: :runtime
380
+ prerelease: false
381
+ version_requirements: !ruby/object:Gem::Requirement
382
+ requirements:
383
+ - - "~>"
384
+ - !ruby/object:Gem::Version
385
+ version: '0.8'
386
+ - - ">="
387
+ - !ruby/object:Gem::Version
388
+ version: 0.8.1
349
389
  - !ruby/object:Gem::Dependency
350
390
  name: parslet
351
391
  requirement: !ruby/object:Gem::Requirement
@@ -396,6 +436,7 @@ extensions: []
396
436
  extra_rdoc_files:
397
437
  - README.md
398
438
  files:
439
+ - ".irbrc"
399
440
  - ".yardoc/checksums"
400
441
  - ".yardoc/complete"
401
442
  - ".yardoc/object_types"
@@ -457,6 +498,7 @@ files:
457
498
  - docs/doc/GLI/Commands.html
458
499
  - docs/doc/GLI/Commands/MarkdownDocumentListener.html
459
500
  - docs/doc/Hash.html
501
+ - docs/doc/Numeric.html
460
502
  - docs/doc/PhraseParser.html
461
503
  - docs/doc/PhraseParser/Operator.html
462
504
  - docs/doc/PhraseParser/PhraseClause.html
@@ -495,6 +537,7 @@ files:
495
537
  - lib/completion/doing.fish
496
538
  - lib/doing.rb
497
539
  - lib/doing/array.rb
540
+ - lib/doing/array_chronify.rb
498
541
  - lib/doing/boolean_term_parser.rb
499
542
  - lib/doing/cli_status.rb
500
543
  - lib/doing/colors.rb
@@ -512,6 +555,7 @@ files:
512
555
  - lib/doing/log_adapter.rb
513
556
  - lib/doing/markdown_document_listener.rb
514
557
  - lib/doing/note.rb
558
+ - lib/doing/numeric_chronify.rb
515
559
  - lib/doing/pager.rb
516
560
  - lib/doing/phrase_parser.rb
517
561
  - lib/doing/plugin_manager.rb