doing 2.1.26 → 2.1.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +15 -20
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/CHANGELOG.md +52 -0
  6. data/Dockerfile +5 -5
  7. data/Dockerfile-2.6 +5 -5
  8. data/Dockerfile-2.7 +5 -4
  9. data/Dockerfile-3.0 +5 -4
  10. data/Gemfile.lock +2 -1
  11. data/README.md +1 -1
  12. data/Rakefile +2 -3
  13. data/bin/commands/add_section.rb +2 -0
  14. data/bin/commands/again.rb +23 -65
  15. data/bin/commands/archive.rb +20 -61
  16. data/bin/commands/cancel.rb +27 -69
  17. data/bin/commands/changes.rb +53 -12
  18. data/bin/commands/colors.rb +4 -2
  19. data/bin/commands/commands.rb +4 -2
  20. data/bin/commands/commands_accepting.rb +62 -11
  21. data/bin/commands/completion.rb +10 -7
  22. data/bin/commands/config.rb +8 -8
  23. data/bin/commands/done.rb +3 -17
  24. data/bin/commands/finish.rb +7 -30
  25. data/bin/commands/flag.rb +15 -51
  26. data/bin/commands/grep.rb +12 -28
  27. data/bin/commands/import.rb +3 -33
  28. data/bin/commands/last.rb +3 -36
  29. data/bin/commands/meanwhile.rb +3 -13
  30. data/bin/commands/note.rb +13 -52
  31. data/bin/commands/now.rb +15 -21
  32. data/bin/commands/on.rb +3 -4
  33. data/bin/commands/open.rb +3 -3
  34. data/bin/commands/recent.rb +3 -4
  35. data/bin/commands/redo.rb +6 -2
  36. data/bin/commands/reset.rb +19 -52
  37. data/bin/commands/rotate.rb +5 -36
  38. data/bin/commands/select.rb +23 -41
  39. data/bin/commands/show.rb +28 -74
  40. data/bin/commands/since.rb +3 -4
  41. data/bin/commands/tag.rb +4 -34
  42. data/bin/commands/tags.rb +5 -32
  43. data/bin/commands/today.rb +3 -4
  44. data/bin/commands/view.rb +36 -73
  45. data/bin/commands/yesterday.rb +4 -5
  46. data/bin/doing +150 -13
  47. data/docs/doc/Array.html +3 -502
  48. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  49. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  50. data/docs/doc/BooleanTermParser/Query.html +1 -1
  51. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  52. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  53. data/docs/doc/BooleanTermParser.html +1 -1
  54. data/docs/doc/Doing/Color.html +62 -56
  55. data/docs/doc/Doing/Completion.html +1 -1
  56. data/docs/doc/Doing/Configuration.html +35 -1
  57. data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
  58. data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
  59. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  60. data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
  61. data/docs/doc/Doing/Errors/NoResults.html +1 -1
  62. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  63. data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
  64. data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
  65. data/docs/doc/Doing/Errors.html +1 -1
  66. data/docs/doc/Doing/Hooks.html +1 -1
  67. data/docs/doc/Doing/Item.html +1 -1
  68. data/docs/doc/Doing/Items.html +2 -2
  69. data/docs/doc/Doing/LogAdapter.html +1 -1
  70. data/docs/doc/Doing/Note.html +2 -2
  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/Section.html +1 -1
  75. data/docs/doc/Doing/TemplateString.html +2 -2
  76. data/docs/doc/Doing/Types.html +41 -1
  77. data/docs/doc/Doing/Util/Backup.html +1 -1
  78. data/docs/doc/Doing/Util.html +1 -1
  79. data/docs/doc/Doing/WWID.html +10 -10
  80. data/docs/doc/Doing.html +3 -3
  81. data/docs/doc/FalseClass.html +35 -1
  82. data/docs/doc/GLI/Commands/Help.html +1 -1
  83. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  84. data/docs/doc/GLI/Commands.html +1 -1
  85. data/docs/doc/GLI.html +1 -1
  86. data/docs/doc/Hash.html +1 -1
  87. data/docs/doc/Object.html +1 -1
  88. data/docs/doc/PhraseParser/Operator.html +1 -1
  89. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  90. data/docs/doc/PhraseParser/Query.html +1 -1
  91. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  92. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  93. data/docs/doc/PhraseParser/TermClause.html +1 -1
  94. data/docs/doc/PhraseParser.html +1 -1
  95. data/docs/doc/Status.html +1 -1
  96. data/docs/doc/String.html +287 -3155
  97. data/docs/doc/Symbol.html +40 -6
  98. data/docs/doc/Time.html +1 -1
  99. data/docs/doc/TrueClass.html +35 -1
  100. data/docs/doc/_index.html +5 -10
  101. data/docs/doc/class_list.html +1 -1
  102. data/docs/doc/file.README.html +2 -2
  103. data/docs/doc/index.html +2 -2
  104. data/docs/doc/method_list.html +278 -678
  105. data/docs/doc/top-level-namespace.html +2 -2
  106. data/doing.gemspec +1 -0
  107. data/doing.rdoc +297 -206
  108. data/lib/completion/_doing.zsh +32 -32
  109. data/lib/completion/doing.bash +30 -30
  110. data/lib/completion/doing.fish +87 -77
  111. data/lib/doing/array/array.rb +4 -0
  112. data/lib/doing/array/nested_hash.rb +17 -0
  113. data/lib/doing/{array.rb → array/tags.rb} +7 -25
  114. data/lib/doing/changelog/change.rb +26 -11
  115. data/lib/doing/changelog/changes.rb +37 -8
  116. data/lib/doing/changelog/version.rb +11 -3
  117. data/lib/doing/{array_chronify.rb → chronify/array.rb} +0 -0
  118. data/lib/doing/chronify/chronify.rb +5 -0
  119. data/lib/doing/{numeric_chronify.rb → chronify/numeric.rb} +0 -0
  120. data/lib/doing/{string_chronify.rb → chronify/string.rb} +0 -0
  121. data/lib/doing/colors.rb +115 -54
  122. data/lib/doing/completion/zsh_completion.rb +5 -0
  123. data/lib/doing/configuration.rb +9 -5
  124. data/lib/doing/good.rb +8 -0
  125. data/lib/doing/help_monkey_patch.rb +6 -5
  126. data/lib/doing/item.rb +5 -5
  127. data/lib/doing/items.rb +2 -2
  128. data/lib/doing/log_adapter.rb +35 -2
  129. data/lib/doing/normalize.rb +188 -0
  130. data/lib/doing/plugins/export/dayone_export.rb +1 -1
  131. data/lib/doing/plugins/export/html_export.rb +1 -1
  132. data/lib/doing/plugins/export/json_export.rb +1 -1
  133. data/lib/doing/plugins/export/markdown_export.rb +1 -1
  134. data/lib/doing/plugins/export/template_export.rb +3 -1
  135. data/lib/doing/prompt.rb +1 -3
  136. data/lib/doing/section.rb +1 -1
  137. data/lib/doing/string/highlight.rb +95 -0
  138. data/lib/doing/string/query.rb +129 -0
  139. data/lib/doing/string/string.rb +12 -0
  140. data/lib/doing/string/tags.rb +164 -0
  141. data/lib/doing/string/transform.rb +168 -0
  142. data/lib/doing/string/truncate.rb +75 -0
  143. data/lib/doing/string/url.rb +82 -0
  144. data/lib/doing/template_string.rb +0 -22
  145. data/lib/doing/types.rb +8 -0
  146. data/lib/doing/util.rb +13 -9
  147. data/lib/doing/version.rb +1 -1
  148. data/lib/doing/wwid.rb +54 -36
  149. data/lib/doing.rb +5 -6
  150. data/lib/examples/plugins/wiki_export/wiki_export.rb +1 -1
  151. data/lib/helpers/threaded_tests.rb +15 -2
  152. data/scripts/deploy.rb +107 -0
  153. data/scripts/runtests.sh +4 -0
  154. metadata +39 -8
  155. data/lib/doing/string.rb +0 -765
  156. data/lib/doing/symbol.rb +0 -28
data/lib/doing.rb CHANGED
@@ -22,17 +22,18 @@ require 'tty-which'
22
22
  require 'tty-markdown'
23
23
  require 'tty-reader'
24
24
  require 'tty-screen'
25
+ require 'sys-uname'
25
26
 
26
27
  require_relative 'doing/changelog'
27
28
  require_relative 'doing/hash'
28
29
  require_relative 'doing/types'
29
30
  require_relative 'doing/colors'
30
31
  require_relative 'doing/template_string'
31
- require_relative 'doing/string'
32
+ require_relative 'doing/string/string'
32
33
  require_relative 'doing/time'
33
- require_relative 'doing/array'
34
+ require_relative 'doing/array/array'
34
35
  require_relative 'doing/good'
35
- require_relative 'doing/symbol'
36
+ require_relative 'doing/normalize'
36
37
  require_relative 'doing/util'
37
38
  require_relative 'doing/util_backup'
38
39
  require_relative 'doing/configuration'
@@ -50,9 +51,7 @@ require_relative 'doing/pager'
50
51
  require_relative 'doing/completion'
51
52
  require_relative 'doing/boolean_term_parser'
52
53
  require_relative 'doing/phrase_parser'
53
- require_relative 'doing/array_chronify'
54
- require_relative 'doing/numeric_chronify'
55
- require_relative 'doing/string_chronify'
54
+ require_relative 'doing/chronify/chronify'
56
55
  # require 'doing/markdown_document_listener'
57
56
 
58
57
  # Main doing module
@@ -74,7 +74,7 @@ module Doing
74
74
  self.template('wiki_css')
75
75
  end
76
76
 
77
- totals = opt[:totals] ? wwid.tag_times(format: :html, sort_by_name: opt[:sort_tags], sort_order: opt[:tag_order]) : ''
77
+ totals = opt[:totals] ? wwid.tag_times(format: :html, sort_by: opt[:sort_tags], sort_order: opt[:tag_order]) : ''
78
78
  engine = Haml::Engine.new(template)
79
79
  Doing.logger.debug('Wiki Export:', "#{items_out.count} items output to #{variables[:page_title]} wiki page")
80
80
  @out = engine.render(Object.new,
@@ -23,10 +23,19 @@ class ThreadedTests
23
23
  c = Doing::Color
24
24
  c.coloring = true
25
25
 
26
- pattern = "test/doing_*#{pattern}*_test.rb"
26
+ shuffle = false
27
+
28
+ unless pattern =~ /shuffle/i
29
+ pattern = "test/doing_*#{pattern}*_test.rb"
30
+ else
31
+ pattern = "test/doing_*_test.rb"
32
+ shuffle = true
33
+ end
27
34
 
28
35
  tests = Dir.glob(pattern)
29
36
 
37
+ tests.shuffle! if shuffle
38
+
30
39
  if max_tests.to_i > 0
31
40
  tests = tests.slice(0, max_tests.to_i - 1)
32
41
  end
@@ -140,7 +149,11 @@ class ThreadedTests
140
149
  count = out.match(/^(?<tests>\d+) tests, (?<assrt>\d+) assertions, (?<fails>\d+) failures, (?<errs>\d+) errors/)
141
150
 
142
151
  unless status.success? && !count['fails'].to_i.positive? && !count['errs'].to_i.positive?
143
- s[2] = ": #{count['fails'].bold.red} #{'failures'.red}, #{count['errs'].bold.red} #{'errors'.red}"
152
+ s[2] = if count
153
+ ": #{count['fails'].bold.red} #{'failures'.red}, #{count['errs'].bold.red} #{'errors'.red}"
154
+ else
155
+ ": #{'Unknown Error'.bold.red}"
156
+ end
144
157
  bar.update(head: '✖'.boldred)
145
158
  bar.advance(head: '✖'.boldred, status: s[2])
146
159
 
data/scripts/deploy.rb ADDED
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tty-spinner'
4
+ require 'tty-cursor'
5
+ require 'pastel'
6
+ require 'fileutils'
7
+
8
+ pastel = Pastel.new
9
+ format = "[#{pastel.yellow(':spinner')}] " + pastel.white("Release Gem")
10
+ spinners = TTY::Spinner::Multi.new(format, format: :dots, success_mark: pastel.green('✔'), error_mark: pastel.red('✖'))
11
+ sp_v = spinners.register "[#{pastel.cyan(':spinner')}] :msg"
12
+ sp_t = spinners.register "[#{pastel.cyan(':spinner')}] Run tests :msg"
13
+ sp_c = spinners.register "[#{pastel.cyan(':spinner')}] Generate completions"
14
+ sp_d = spinners.register "[#{pastel.cyan(':spinner')}] Generate docs"
15
+ sp_w = spinners.register "[#{pastel.cyan(':spinner')}] Update wiki :msg"
16
+ spinners.auto_spin
17
+
18
+ $version = nil
19
+ sp_v.update(msg: 'Get version')
20
+ sp_t.update(msg: '')
21
+ sp_w.update(msg: '')
22
+ sp_v.run do |spinner|
23
+ spinner.update(msg: 'Getting version')
24
+ versions = `rake ver`.strip
25
+ version = versions.match(/version\.rb: ([\d.]+(\w+\d*)?)/)[1]
26
+ changelog_version = versions.match(/changelog: ([\d.]+(\w+\d*)?)/)[1]
27
+ git_version = versions.match(/git tag: ([\d.]+(\w+\d*)?)/)[1]
28
+
29
+ if git_version == version
30
+ spinner.update(msg: "Error: Git version (#{git_version}) is the same as version.rb (#{version})")
31
+ spinner.error
32
+ spinners.stop
33
+ Process.exit
34
+ end
35
+
36
+ unless version == changelog_version
37
+ spinner.update(msg: "Error: version.rb (#{version}) and Changelog (#{changelog_version}) do not match")
38
+ spinner.error
39
+ spinners.stop
40
+ Process.exit
41
+ end
42
+
43
+ $version = version
44
+
45
+ spinner.update(msg: "Version #{version}")
46
+ spinner.success
47
+ end
48
+
49
+
50
+ sp_t.run do |spinner|
51
+ spinner.update(msg: '')
52
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
53
+ unless system('rake parallel:test &> results.log')
54
+ spinner.update(msg: '- Unit tests failed')
55
+ spinner.error
56
+ spinners.stop
57
+ Process.exit
58
+ end
59
+
60
+ finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)
61
+ spinner.update(msg: "- passed in #{(finish - start).round(4)} seconds")
62
+ spinner.success
63
+ end
64
+
65
+ sp_c.auto_spin
66
+ `./generate_completions.sh &> results.log`
67
+ sp_c.success
68
+
69
+ sp_d.auto_spin
70
+ `bundle exec bin/doing _doc &> results.log`
71
+ `./rdoc_to_mmd.rb > /Users/ttscoff/Sites/dev/bt/source/doing_all_commands.md`
72
+ `rake yard &> results.log`
73
+ sp_d.success
74
+
75
+
76
+ sp_w.run do |spinner|
77
+ spinner.update(msg: '- Updating All Commands')
78
+ `./rdoc_to_mmd.rb > /Users/ttscoff/Desktop/Code/doing.wiki/commands.source`
79
+ prev_dir = Dir.pwd
80
+ Dir.chdir('/Users/ttscoff/Desktop/Code/doing.wiki/')
81
+ `./reformat_commands.rb &> results.log`
82
+ spinner.update(msg: '- Committing and Pushing')
83
+ `git commit -a -m "#{$version} update" &> results.log`
84
+ `git pull &> results.log`
85
+ `FORCE_PUSH=true git push &> results.log`
86
+ spinner.update(msg: '- Tagging Release')
87
+ `git release create -m "v#{$version}" $version &> results.log`
88
+ spinner.update(msg: '- Done')
89
+ Dir.chdir(prev_dir)
90
+ sp_w.success
91
+ end
92
+
93
+ sp_r = spinners.register "[:spinner] Releasing gem :msg"
94
+
95
+ sp_r.run do |spinner|
96
+ spinner.update(msg: '- Preparing git release')
97
+ `git commit -a -m "#{$version} release prep" &> results.log`
98
+ `git pull &> results.log`
99
+ `FORCE_PUSH=true git push &> results.log`
100
+ spinner.update(msg: '- Running releasegem script')
101
+ `/Users/ttscoff/scripts/releasegem &> results.log`
102
+ spinner.update(msg: '- Bumping gem version')
103
+ `rake bump[patch] &> results.log`
104
+ sp_r.success
105
+ end
106
+
107
+ FileUtils.rm('results.log')
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ bundle install
4
+ rake test
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.26
4
+ version: 2.1.30
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-23 00:00:00.000000000 Z
11
+ date: 2022-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml
@@ -426,6 +426,26 @@ dependencies:
426
426
  - - ">="
427
427
  - !ruby/object:Gem::Version
428
428
  version: 3.6.0
429
+ - !ruby/object:Gem::Dependency
430
+ name: sys-uname
431
+ requirement: !ruby/object:Gem::Requirement
432
+ requirements:
433
+ - - "~>"
434
+ - !ruby/object:Gem::Version
435
+ version: '1.2'
436
+ - - ">="
437
+ - !ruby/object:Gem::Version
438
+ version: 1.2.2
439
+ type: :runtime
440
+ prerelease: false
441
+ version_requirements: !ruby/object:Gem::Requirement
442
+ requirements:
443
+ - - "~>"
444
+ - !ruby/object:Gem::Version
445
+ version: '1.2'
446
+ - - ">="
447
+ - !ruby/object:Gem::Version
448
+ version: 1.2.2
429
449
  description: A tool for managing a TaskPaper-like file of recent activites. Perfect
430
450
  for the late-night hacker on too much caffeine to remember what they accomplished
431
451
  at 2 in the morning.
@@ -582,14 +602,19 @@ files:
582
602
  - lib/completion/doing.bash
583
603
  - lib/completion/doing.fish
584
604
  - lib/doing.rb
585
- - lib/doing/array.rb
586
- - lib/doing/array_chronify.rb
605
+ - lib/doing/array/array.rb
606
+ - lib/doing/array/nested_hash.rb
607
+ - lib/doing/array/tags.rb
587
608
  - lib/doing/boolean_term_parser.rb
588
609
  - lib/doing/changelog.rb
589
610
  - lib/doing/changelog/change.rb
590
611
  - lib/doing/changelog/changes.rb
591
612
  - lib/doing/changelog/entry.rb
592
613
  - lib/doing/changelog/version.rb
614
+ - lib/doing/chronify/array.rb
615
+ - lib/doing/chronify/chronify.rb
616
+ - lib/doing/chronify/numeric.rb
617
+ - lib/doing/chronify/string.rb
593
618
  - lib/doing/cli_status.rb
594
619
  - lib/doing/colors.rb
595
620
  - lib/doing/completion.rb
@@ -607,8 +632,8 @@ files:
607
632
  - lib/doing/items.rb
608
633
  - lib/doing/log_adapter.rb
609
634
  - lib/doing/markdown_document_listener.rb
635
+ - lib/doing/normalize.rb
610
636
  - lib/doing/note.rb
611
- - lib/doing/numeric_chronify.rb
612
637
  - lib/doing/pager.rb
613
638
  - lib/doing/phrase_parser.rb
614
639
  - lib/doing/plugin_manager.rb
@@ -625,9 +650,13 @@ files:
625
650
  - lib/doing/plugins/import/timing_import.rb
626
651
  - lib/doing/prompt.rb
627
652
  - lib/doing/section.rb
628
- - lib/doing/string.rb
629
- - lib/doing/string_chronify.rb
630
- - lib/doing/symbol.rb
653
+ - lib/doing/string/highlight.rb
654
+ - lib/doing/string/query.rb
655
+ - lib/doing/string/string.rb
656
+ - lib/doing/string/tags.rb
657
+ - lib/doing/string/transform.rb
658
+ - lib/doing/string/truncate.rb
659
+ - lib/doing/string/url.rb
631
660
  - lib/doing/template_string.rb
632
661
  - lib/doing/time.rb
633
662
  - lib/doing/types.rb
@@ -744,9 +773,11 @@ files:
744
773
  - package-lock.json
745
774
  - rdoc_to_mmd.rb
746
775
  - rdocfixer.rb
776
+ - scripts/deploy.rb
747
777
  - scripts/generate_bash_completions.rb
748
778
  - scripts/generate_fish_completions.rb
749
779
  - scripts/generate_zsh_completions.rb
780
+ - scripts/runtests.sh
750
781
  - scripts/sort_commands.rb
751
782
  - yard_templates/default/method_details/setup.rb
752
783
  homepage: http://brettterpstra.com/project/doing/