doing 2.1.8 → 2.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +9 -9
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/CHANGELOG.md +38 -0
  6. data/Dockerfile +9 -0
  7. data/Dockerfile-2.6 +9 -0
  8. data/Dockerfile-2.7 +8 -0
  9. data/Dockerfile-3.0 +8 -0
  10. data/Gemfile.lock +1 -1
  11. data/README.md +1 -1
  12. data/Rakefile +51 -6
  13. data/bin/doing +2098 -1944
  14. data/docs/doc/Array.html +1 -1
  15. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  16. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  17. data/docs/doc/BooleanTermParser/Query.html +1 -1
  18. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  19. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  20. data/docs/doc/BooleanTermParser.html +1 -1
  21. data/docs/doc/Doing/Color.html +1 -1
  22. data/docs/doc/Doing/Completion.html +1 -1
  23. data/docs/doc/Doing/Configuration.html +2 -2
  24. data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
  25. data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
  26. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  27. data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
  28. data/docs/doc/Doing/Errors/NoResults.html +1 -1
  29. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  30. data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
  31. data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
  32. data/docs/doc/Doing/Errors.html +1 -1
  33. data/docs/doc/Doing/Hooks.html +1 -1
  34. data/docs/doc/Doing/Item.html +1 -1
  35. data/docs/doc/Doing/Items.html +1 -1
  36. data/docs/doc/Doing/LogAdapter.html +1 -1
  37. data/docs/doc/Doing/Note.html +1 -1
  38. data/docs/doc/Doing/Pager.html +1 -1
  39. data/docs/doc/Doing/Plugins.html +1 -1
  40. data/docs/doc/Doing/Prompt.html +132 -18
  41. data/docs/doc/Doing/Section.html +1 -1
  42. data/docs/doc/Doing/TemplateString.html +2 -2
  43. data/docs/doc/Doing/Util/Backup.html +79 -2
  44. data/docs/doc/Doing/Util.html +1 -1
  45. data/docs/doc/Doing/WWID.html +88 -73
  46. data/docs/doc/Doing.html +2 -2
  47. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  48. data/docs/doc/GLI/Commands.html +1 -1
  49. data/docs/doc/GLI.html +1 -1
  50. data/docs/doc/Hash.html +1 -1
  51. data/docs/doc/PhraseParser/Operator.html +1 -1
  52. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  53. data/docs/doc/PhraseParser/Query.html +1 -1
  54. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  55. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  56. data/docs/doc/PhraseParser/TermClause.html +1 -1
  57. data/docs/doc/PhraseParser.html +1 -1
  58. data/docs/doc/Status.html +1 -1
  59. data/docs/doc/String.html +97 -1
  60. data/docs/doc/Symbol.html +36 -2
  61. data/docs/doc/Time.html +1 -1
  62. data/docs/doc/_index.html +1 -1
  63. data/docs/doc/file.README.html +2 -2
  64. data/docs/doc/index.html +2 -2
  65. data/docs/doc/method_list.html +299 -235
  66. data/docs/doc/top-level-namespace.html +1 -1
  67. data/docs/index.md +1 -1
  68. data/doing.rdoc +9 -2
  69. data/generate_completions.sh +1 -3
  70. data/lib/completion/_doing.zsh +1 -1
  71. data/lib/completion/doing.bash +2 -2
  72. data/lib/completion/doing.fish +2 -1
  73. data/lib/doing/completion/bash_completion.rb +2 -2
  74. data/lib/doing/completion/fish_completion.rb +2 -2
  75. data/lib/doing/completion/zsh_completion.rb +2 -2
  76. data/lib/doing/completion.rb +12 -2
  77. data/lib/doing/configuration.rb +19 -9
  78. data/lib/doing/hooks.rb +10 -5
  79. data/lib/doing/items.rb +16 -1
  80. data/lib/doing/log_adapter.rb +1 -0
  81. data/lib/doing/pager.rb +2 -20
  82. data/lib/doing/plugins/import/calendar_import.rb +5 -0
  83. data/lib/doing/plugins/import/doing_import.rb +2 -0
  84. data/lib/doing/plugins/import/timing_import.rb +5 -0
  85. data/lib/doing/prompt.rb +47 -8
  86. data/lib/doing/string.rb +20 -0
  87. data/lib/doing/symbol.rb +4 -0
  88. data/lib/doing/util_backup.rb +38 -8
  89. data/lib/doing/version.rb +1 -1
  90. data/lib/doing/wwid.rb +210 -105
  91. data/lib/doing.rb +1 -0
  92. data/lib/examples/plugins/hooks.rb +31 -0
  93. data/scripts/generate_bash_completions.rb +2 -2
  94. data/scripts/sort_commands.rb +59 -0
  95. metadata +7 -3
  96. data/lib/helpers/fuzzyfilefinder +0 -0
@@ -18,5 +18,36 @@ module Doing
18
18
  Hooks.register :post_write do |filename|
19
19
  res = `/bin/bash /Users/ttscoff/scripts/after_doing.sh`.strip
20
20
  Doing.logger.debug('Hooks:', res) unless res =~ /^\.\.\.$/
21
+
22
+ wwid = WWID.new
23
+ wwid.configure
24
+ if filename == wwid.config['doing_file']
25
+ diff = wwid.get_diff(filename)
26
+ puts diff
27
+ end
28
+ end
29
+
30
+ Hooks.register :post_entry_added do |wwid, entry|
31
+ if wwid.config.key?('day_one_trigger') && entry.tags?(wwid.config['day_one_trigger'], :and)
32
+
33
+ logger.info('New entry:', 'Adding to Day One')
34
+ add_to_day_one(entry, wwid.config)
35
+ end
36
+ end
37
+
38
+ ##
39
+ ## Add the entry to Day One using the CLI
40
+ ##
41
+ ## @param entry The entry to add
42
+ ##
43
+ def self.add_to_day_one(entry, config)
44
+ dayone = TTY::Which.which('dayone2')
45
+ flagged = entry.tags?('flagged') ? ' -s' : ''
46
+ tags = entry.tags.map { |t| Shellwords.escape(t) }.join(' ')
47
+ tags = tags.length.positive? ? " -t #{tags}" : ''
48
+ date = " -d '#{entry.date.strftime('%Y-%m-%d %H:%M:%S')}'"
49
+ title = entry.title.tag(config['day_one_trigger'], remove: true)
50
+ title += "\n#{entry.note}" unless entry.note.empty?
51
+ `echo #{Shellwords.escape(title)} | #{dayone} new#{flagged}#{date}#{tags}`
21
52
  end
22
53
  end
@@ -30,7 +30,7 @@ class BashCompletions
30
30
  need_export = []
31
31
 
32
32
  @commands.each_with_index do |cmd, i|
33
- @bar.advance
33
+ @bar.advance(status: cmd[:commands].first)
34
34
 
35
35
  data = get_help_sections(cmd[:commands].first)
36
36
 
@@ -188,7 +188,7 @@ class BashCompletions
188
188
  data = get_help_sections
189
189
  @global_options = parse_options(data[:global_options])
190
190
  @commands = parse_commands(data[:commands])
191
- @bar = TTY::ProgressBar.new("\033[0;0;33mGenerating Bash completions: \033[0;35;40m[:bar]\033[0m", total: @commands.count, bar_format: :blade)
191
+ @bar = TTY::ProgressBar.new("\033[0;0;33mGenerating Bash completions: \033[0;35;40m[:bar] :status\033[0m", total: @commands.count, bar_format: :blade, status: '')
192
192
  @bar.resize(25)
193
193
  end
194
194
 
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env ruby
2
+ require 'awesome_print'
3
+
4
+ input = STDIN.read.force_encoding('utf-8')
5
+
6
+ commands = input.split(/^# @@/).delete_if(&:empty?).sort
7
+ # commands.each do |cmd|
8
+ # puts cmd.split(/^(\w+)(.*)$/m)[1]
9
+ # end
10
+ indexes = %w[
11
+ again
12
+ cancel
13
+ done
14
+ finish
15
+ later
16
+ mark
17
+ meanwhile
18
+ note
19
+ now
20
+ reset
21
+ select
22
+ tag
23
+ choose
24
+ grep
25
+ last
26
+ recent
27
+ show
28
+ tags
29
+ today
30
+ view
31
+ yesterday
32
+ open
33
+ config
34
+ archive
35
+ import
36
+ rotate
37
+ colors
38
+ completion
39
+ plugins
40
+ sections
41
+ template
42
+ views
43
+ undo
44
+ redo
45
+ add_section
46
+ tag_dir
47
+ changelog
48
+ ]
49
+
50
+ result = Array.new(indexes.count)
51
+
52
+ commands.each do |cmd|
53
+ key = cmd.match(/^(\w+)/)[1]
54
+ idx = indexes.index(key)
55
+ result[idx] = "#@@#{cmd}"
56
+ # puts commands.join('# @@')
57
+ end
58
+
59
+ puts result.join('')
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.8
4
+ version: 2.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-20 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml
@@ -405,6 +405,10 @@ files:
405
405
  - AUTHORS
406
406
  - CHANGELOG.md
407
407
  - COMMANDS.md
408
+ - Dockerfile
409
+ - Dockerfile-2.6
410
+ - Dockerfile-2.7
411
+ - Dockerfile-3.0
408
412
  - Gemfile
409
413
  - Gemfile.lock
410
414
  - LICENSE
@@ -542,7 +546,6 @@ files:
542
546
  - lib/examples/plugins/wiki_export/templates/wiki.haml
543
547
  - lib/examples/plugins/wiki_export/templates/wiki_index.haml
544
548
  - lib/examples/plugins/wiki_export/wiki_export.rb
545
- - lib/helpers/fuzzyfilefinder
546
549
  - lib/helpers/fzf/.goreleaser.yml
547
550
  - lib/helpers/fzf/.rubocop.yml
548
551
  - lib/helpers/fzf/ADVANCED.md
@@ -643,6 +646,7 @@ files:
643
646
  - scripts/generate_bash_completions.rb
644
647
  - scripts/generate_fish_completions.rb
645
648
  - scripts/generate_zsh_completions.rb
649
+ - scripts/sort_commands.rb
646
650
  - yard_templates/default/method_details/setup.rb
647
651
  homepage: http://brettterpstra.com/project/doing/
648
652
  licenses:
Binary file