doing 1.0.90 → 2.0.2.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHORS +19 -0
  3. data/CHANGELOG.md +590 -0
  4. data/COMMANDS.md +1181 -0
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +110 -0
  7. data/LICENSE +23 -0
  8. data/README.md +14 -697
  9. data/Rakefile +79 -0
  10. data/_config.yml +1 -0
  11. data/bin/doing +1037 -481
  12. data/doing.fish +278 -0
  13. data/doing.gemspec +34 -0
  14. data/doing.rdoc +1759 -0
  15. data/example_plugin.rb +209 -0
  16. data/generate_completions.sh +4 -0
  17. data/img/doing-colors.jpg +0 -0
  18. data/img/doing-printf-wrap-800.jpg +0 -0
  19. data/img/doing-show-note-formatting-800.jpg +0 -0
  20. data/lib/completion/_doing.zsh +151 -0
  21. data/lib/completion/doing.bash +416 -0
  22. data/lib/completion/doing.fish +278 -0
  23. data/lib/doing/array.rb +8 -0
  24. data/lib/doing/cli_status.rb +66 -0
  25. data/lib/doing/colors.rb +136 -0
  26. data/lib/doing/configuration.rb +310 -0
  27. data/lib/doing/errors.rb +102 -0
  28. data/lib/doing/hash.rb +31 -0
  29. data/lib/doing/hooks.rb +59 -0
  30. data/lib/doing/item.rb +155 -0
  31. data/lib/doing/log_adapter.rb +342 -0
  32. data/lib/doing/markdown_document_listener.rb +174 -0
  33. data/lib/doing/note.rb +59 -0
  34. data/lib/doing/pager.rb +95 -0
  35. data/lib/doing/plugin_manager.rb +208 -0
  36. data/lib/doing/plugins/export/csv_export.rb +48 -0
  37. data/lib/doing/plugins/export/html_export.rb +83 -0
  38. data/lib/doing/plugins/export/json_export.rb +140 -0
  39. data/lib/doing/plugins/export/markdown_export.rb +85 -0
  40. data/lib/doing/plugins/export/taskpaper_export.rb +34 -0
  41. data/lib/doing/plugins/export/template_export.rb +141 -0
  42. data/lib/doing/plugins/import/cal_to_json.scpt +0 -0
  43. data/lib/doing/plugins/import/calendar_import.rb +76 -0
  44. data/lib/doing/plugins/import/doing_import.rb +144 -0
  45. data/lib/doing/plugins/import/timing_import.rb +78 -0
  46. data/lib/doing/string.rb +346 -0
  47. data/lib/doing/symbol.rb +16 -0
  48. data/lib/doing/time.rb +18 -0
  49. data/lib/doing/util.rb +186 -0
  50. data/lib/doing/version.rb +1 -1
  51. data/lib/doing/wwid.rb +1838 -2266
  52. data/lib/doing/wwidfile.rb +117 -0
  53. data/lib/doing.rb +43 -2
  54. data/lib/examples/commands/wiki.rb +80 -0
  55. data/lib/examples/plugins/hooks.rb +22 -0
  56. data/lib/examples/plugins/say_export.rb +202 -0
  57. data/lib/examples/plugins/templates/wiki.css +169 -0
  58. data/lib/examples/plugins/templates/wiki.haml +27 -0
  59. data/lib/examples/plugins/templates/wiki_index.haml +18 -0
  60. data/lib/examples/plugins/wiki_export.rb +87 -0
  61. data/lib/templates/doing-markdown.erb +5 -0
  62. data/man/doing.1 +964 -0
  63. data/man/doing.1.html +711 -0
  64. data/man/doing.1.ronn +600 -0
  65. data/package-lock.json +3 -0
  66. data/rdoc_to_mmd.rb +42 -0
  67. data/rdocfixer.rb +13 -0
  68. data/scripts/generate_bash_completions.rb +210 -0
  69. data/scripts/generate_fish_completions.rb +201 -0
  70. data/scripts/generate_zsh_completions.rb +164 -0
  71. metadata +82 -6
  72. data/lib/doing/helpers.rb +0 -121
data/lib/doing/helpers.rb DELETED
@@ -1,121 +0,0 @@
1
- ##
2
- ## @brief Hash helpers
3
- ##
4
- class ::Hash
5
- def has_tags?(tags, bool = :and)
6
- tags = tags.split(/ *, */) if tags.is_a? String
7
- bool = bool.normalize_bool if bool.is_a? String
8
- item = self
9
- tags.map! {|t| t.strip.sub(/^@/, '')}
10
- case bool
11
- when :and
12
- result = true
13
- tags.each do |tag|
14
- unless item['title'] =~ /@#{tag}/
15
- result = false
16
- break
17
- end
18
- end
19
- result
20
- when :not
21
- result = true
22
- tags.each do |tag|
23
- if item['title'] =~ /@#{tag}/
24
- result = false
25
- break
26
- end
27
- end
28
- result
29
- else
30
- result = false
31
- tags.each do |tag|
32
- if item['title'] =~ /@#{tag}/
33
- result = true
34
- break
35
- end
36
- end
37
- result
38
- end
39
- end
40
-
41
- def matches_search?(search)
42
- item = self
43
- text = item['note'] ? item['title'] + item['note'].join(' ') : item['title']
44
- pattern = if search.strip =~ %r{^/.*?/$}
45
- search.sub(%r{/(.*?)/}, '\1')
46
- else
47
- search.split('').join('.{0,3}')
48
- end
49
- text =~ /#{pattern}/i ? true : false
50
- end
51
- end
52
-
53
- ##
54
- ## @brief String helpers
55
- ##
56
- class ::String
57
- def cap_first
58
- sub(/^\w/) do |m|
59
- m.upcase
60
- end
61
- end
62
-
63
-
64
- ##
65
- ## @brief Convert a boolean string to a symbol
66
- ##
67
- ## @return Symbol :and, :or, or :not
68
- ##
69
- def normalize_bool!
70
- replace normalize_bool
71
- end
72
-
73
- def normalize_bool(default = :and)
74
- case self
75
- when /(and|all)/i
76
- :and
77
- when /(any|or)/i
78
- :or
79
- when /(not|none)/i
80
- :not
81
- else
82
- default.is_a?(Symbol) ? default : default.normalize_bool
83
- end
84
- end
85
-
86
-
87
- ##
88
- ## @brief Turn raw urls into HTML links
89
- ##
90
- ## @param opt (Hash) Additional Options
91
- ##
92
- def link_urls(opt = {})
93
- opt[:format] ||= :html
94
- if opt[:format] == :html
95
- gsub(%r{(?mi)((http|https)://)([\w\-_]+(\.[\w\-_]+)+)([\w\-.,@?^=%&:/~+#]*[\w\-@^=%&/~+#])?}) do |_match|
96
- m = Regexp.last_match
97
- proto = m[1].nil? ? 'http://' : ''
98
- %(<a href="#{proto}#{m[0]}" title="Link to #{m[0]}">[#{m[3]}]</a>)
99
- end.gsub(/<(\w+:.*?)>/) do |match|
100
- m = Regexp.last_match
101
- if m[1] =~ /<a href/
102
- match
103
- else
104
- %(<a href="#{m[1]}" title="Link to #{m[1]}">[link]</a>)
105
- end
106
- end
107
- else
108
- self
109
- end
110
- end
111
- end
112
-
113
- class ::Symbol
114
- def normalize_bool!
115
- replace normalize_bool
116
- end
117
-
118
- def normalize_bool
119
- to_s.normalize_bool
120
- end
121
- end