doing 2.1.39 → 2.1.40

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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +1 -1
  5. data/bin/commands/config.rb +43 -34
  6. data/bin/commands/done.rb +1 -18
  7. data/bin/commands/finish.rb +30 -25
  8. data/bin/commands/grep.rb +3 -14
  9. data/bin/commands/last.rb +2 -8
  10. data/bin/commands/meanwhile.rb +13 -6
  11. data/bin/commands/on.rb +3 -16
  12. data/bin/commands/recent.rb +2 -8
  13. data/bin/commands/reset.rb +24 -1
  14. data/bin/commands/select.rb +1 -1
  15. data/bin/commands/show.rb +6 -17
  16. data/bin/commands/since.rb +1 -12
  17. data/bin/commands/today.rb +2 -13
  18. data/bin/commands/view.rb +1 -1
  19. data/bin/commands/yesterday.rb +2 -13
  20. data/bin/doing +15 -8
  21. data/docs/doc/Array.html +1 -1
  22. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  23. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  24. data/docs/doc/BooleanTermParser/Query.html +1 -1
  25. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  26. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  27. data/docs/doc/BooleanTermParser.html +1 -1
  28. data/docs/doc/Doing/Color.html +166 -20
  29. data/docs/doc/Doing/Completion.html +1 -1
  30. data/docs/doc/Doing/Configuration.html +1 -1
  31. data/docs/doc/Doing/Errors/DoingNoTraceError.html +7 -3
  32. data/docs/doc/Doing/Errors/DoingRuntimeError.html +7 -3
  33. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  34. data/docs/doc/Doing/Errors/EmptyInput.html +10 -2
  35. data/docs/doc/Doing/Errors/HistoryLimitError.html +194 -0
  36. data/docs/doc/Doing/Errors/InvalidPlugin.html +194 -0
  37. data/docs/doc/Doing/Errors/MissingBackupFile.html +194 -0
  38. data/docs/doc/Doing/Errors/NoResults.html +10 -2
  39. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  40. data/docs/doc/Doing/Errors/UserCancelled.html +10 -2
  41. data/docs/doc/Doing/Errors/WrongCommand.html +10 -2
  42. data/docs/doc/Doing/Errors.html +9 -9
  43. data/docs/doc/Doing/Hooks.html +1 -1
  44. data/docs/doc/Doing/Item.html +90 -1615
  45. data/docs/doc/Doing/Items.html +121 -5
  46. data/docs/doc/Doing/Logger.html +1 -1
  47. data/docs/doc/Doing/Note.html +1 -1
  48. data/docs/doc/Doing/Pager.html +1 -1
  49. data/docs/doc/Doing/Plugins.html +1 -1
  50. data/docs/doc/Doing/Prompt.html +2 -2
  51. data/docs/doc/Doing/Section.html +1 -1
  52. data/docs/doc/Doing/TemplateString.html +2 -2
  53. data/docs/doc/Doing/Types.html +1 -1
  54. data/docs/doc/Doing/Util/Backup.html +5 -5
  55. data/docs/doc/Doing/Util.html +1 -1
  56. data/docs/doc/Doing/WWID.html +197 -4033
  57. data/docs/doc/Doing.html +2 -2
  58. data/docs/doc/FalseClass.html +1 -1
  59. data/docs/doc/GLI/Commands/Help.html +1 -1
  60. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  61. data/docs/doc/GLI/Commands.html +1 -1
  62. data/docs/doc/GLI.html +1 -1
  63. data/docs/doc/Hash.html +1 -1
  64. data/docs/doc/Object.html +1 -1
  65. data/docs/doc/PhraseParser/Operator.html +1 -1
  66. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  67. data/docs/doc/PhraseParser/Query.html +1 -1
  68. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  69. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  70. data/docs/doc/PhraseParser/TermClause.html +1 -1
  71. data/docs/doc/PhraseParser.html +1 -1
  72. data/docs/doc/Status.html +1 -1
  73. data/docs/doc/String.html +1 -1
  74. data/docs/doc/Symbol.html +1 -1
  75. data/docs/doc/Time.html +1 -1
  76. data/docs/doc/TrueClass.html +1 -1
  77. data/docs/doc/_index.html +26 -5
  78. data/docs/doc/class_list.html +1 -1
  79. data/docs/doc/file.README.html +2 -2
  80. data/docs/doc/index.html +2 -2
  81. data/docs/doc/method_list.html +293 -773
  82. data/docs/doc/top-level-namespace.html +3 -3
  83. data/docs/index.md +1 -1
  84. data/doing.rdoc +49 -7
  85. data/lib/completion/_doing.zsh +5 -5
  86. data/lib/completion/doing.bash +8 -8
  87. data/lib/completion/doing.fish +7 -2
  88. data/lib/doing/add_options.rb +31 -1
  89. data/lib/doing/chronify/array.rb +64 -22
  90. data/lib/doing/colors.rb +77 -30
  91. data/lib/doing/completion.rb +4 -5
  92. data/lib/doing/errors.rb +51 -35
  93. data/lib/doing/hooks.rb +3 -3
  94. data/lib/doing/item/dates.rb +112 -0
  95. data/lib/doing/item/query.rb +433 -0
  96. data/lib/doing/item/state.rb +59 -0
  97. data/lib/doing/item/tags.rb +87 -0
  98. data/lib/doing/item.rb +6 -667
  99. data/lib/doing/items.rb +38 -13
  100. data/lib/doing/plugin_manager.rb +3 -3
  101. data/lib/doing/plugins/export/template_export.rb +4 -4
  102. data/lib/doing/plugins/import/cal_to_json.scpt +0 -0
  103. data/lib/doing/util_backup.rb +6 -8
  104. data/lib/doing/version.rb +1 -1
  105. data/lib/doing/wwid/display.rb +399 -0
  106. data/lib/doing/wwid/editor.rb +214 -0
  107. data/lib/doing/wwid/filetools.rb +186 -0
  108. data/lib/doing/wwid/filter.rb +218 -0
  109. data/lib/doing/wwid/guess.rb +87 -0
  110. data/lib/doing/wwid/interactive.rb +385 -0
  111. data/lib/doing/wwid/modify.rb +618 -0
  112. data/lib/doing/wwid/tags.rb +54 -0
  113. data/lib/doing/wwid/timers.rb +345 -0
  114. data/lib/doing/wwid/wwidutil.rb +104 -0
  115. data/lib/doing/wwid.rb +31 -2317
  116. metadata +19 -2
@@ -11,18 +11,7 @@ command :since do |c|
11
11
  c.arg_name 'NAME'
12
12
  c.flag %i[s section], default_value: 'All'
13
13
 
14
- c.desc "Output to export format (#{Doing::Plugins.plugin_names(type: :export)})"
15
- c.arg_name 'FORMAT'
16
- c.flag %i[o output]
17
-
18
- c.desc "Output using a template from configuration"
19
- c.arg_name 'TEMPLATE_KEY'
20
- c.flag [:config_template], type: TemplateName, default_value: 'default'
21
-
22
- c.desc 'Override output format with a template string containing %placeholders'
23
- c.arg_name 'TEMPLATE_STRING'
24
- c.flag [:template]
25
-
14
+ add_options(:output_template, c)
26
15
  add_options(:time_display, c)
27
16
  add_options(:tag_filter, c)
28
17
  add_options(:search, c)
@@ -12,23 +12,12 @@ command :today do |c|
12
12
  c.arg_name 'NAME'
13
13
  c.flag %i[s section], default_value: 'All'
14
14
 
15
- c.desc "Output to export format (#{Doing::Plugins.plugin_names(type: :export)})"
16
- c.arg_name 'FORMAT'
17
- c.flag %i[o output]
18
-
19
- c.desc "Output using a template from configuration"
20
- c.arg_name 'TEMPLATE_KEY'
21
- c.flag [:config_template], type: TemplateName, default_value: 'today'
22
-
23
- c.desc 'Override output format with a template string containing %placeholders'
24
- c.arg_name 'TEMPLATE_STRING'
25
- c.flag [:template]
26
-
15
+ add_options(:output_template, c, default_template: 'today')
27
16
  add_options(:time_filter, c)
28
17
  add_options(:time_display, c)
29
18
 
30
19
  c.action do |_global_options, options, _args|
31
- raise DoingRuntimeError, %(Invalid output type "#{options[:output]}") if options[:output] && options[:output] !~ Doing::Plugins.plugin_regex(type: :export)
20
+ raise InvalidPlugin.new('output', options[:output]) if options[:output] && options[:output] !~ Doing::Plugins.plugin_regex(type: :export)
32
21
 
33
22
  options[:times] = true if options[:totals]
34
23
  options[:sort_tags] = options[:tag_sort]
data/bin/commands/view.rb CHANGED
@@ -59,7 +59,7 @@ command :view do |c|
59
59
  c.action do |global_options, options, args|
60
60
  options[:fuzzy] = false
61
61
  if options[:output] && options[:output] !~ Doing::Plugins.plugin_regex(type: :export)
62
- raise DoingRuntimeError, %(Invalid output type "#{options[:output]}")
62
+ raise InvalidPlugin.new('output', options[:output])
63
63
 
64
64
  end
65
65
 
@@ -11,23 +11,12 @@ command :yesterday do |c|
11
11
  c.arg_name 'NAME'
12
12
  c.flag %i[s section], default_value: 'All'
13
13
 
14
- c.desc "Output to export format (#{Doing::Plugins.plugin_names(type: :export)})"
15
- c.arg_name 'FORMAT'
16
- c.flag %i[o output]
17
-
18
- c.desc "Output using a template from configuration"
19
- c.arg_name 'TEMPLATE_KEY'
20
- c.flag [:config_template], type: TemplateName, default_value: 'today'
21
-
22
- c.desc 'Override output format with a template string containing %placeholders'
23
- c.arg_name 'TEMPLATE_STRING'
24
- c.flag [:template]
25
-
14
+ add_options(:output_template, c, default_template: 'today')
26
15
  add_options(:time_filter, c)
27
16
  add_options(:time_display, c)
28
17
 
29
18
  c.action do |_global_options, options, _args|
30
- raise DoingRuntimeError, %(Invalid output type "#{options[:output]}") if options[:output] && options[:output] !~ Doing::Plugins.plugin_regex(type: :export)
19
+ raise InvalidPlugin.new('output', options[:output]) if options[:output] && options[:output] !~ Doing::Plugins.plugin_regex(type: :export)
31
20
 
32
21
  options[:sort_tags] = options[:tag_sort]
33
22
 
data/bin/doing CHANGED
@@ -233,8 +233,15 @@ pre do |global, _command, _options, _args|
233
233
  end
234
234
 
235
235
  on_error do |exception|
236
- if exception.is_a?(GLI::UnknownCommand) && ARGV.count > 1
237
- exit run(['now'].concat(ARGV.unshift(@command)))
236
+ if exception.is_a?(GLI::UnknownCommand)
237
+ if ARGV.count > 1
238
+ exit run(['now'].concat(ARGV.unshift(@command)))
239
+ else
240
+ Doing::Color.coloring = $stdout.isatty
241
+ Doing.logger.error('Unknown Command:', @command)
242
+ Doing.logger.output_results
243
+ false
244
+ end
238
245
  elsif exception.is_a?(SystemExit)
239
246
  false
240
247
  else
@@ -280,12 +287,12 @@ around do |global, command, _options, _arguments, code|
280
287
  end
281
288
 
282
289
  if global[:config_file] && global[:config_file] != Doing.config.config_file
283
- Doing.logger.warn(format(['%<promptcolor>sWARNING: %<textcolor>sThe use of --config_file is deprecated,',
284
- 'please set the environment variable DOING_CONFIG instead.'].join(' '),
285
- { promptcolor: @colors.flamingo, textcolor: @colors.boldred }))
286
- Doing.logger.warn(format(['%<promptcolor>sTo set it just for the current command,',
287
- 'use: %<highlight>sDOING_CONFIG=/path/to/doingrc doing [command]%<reset>s'].join(' '),
288
- { promptcolor: @colors.red, highlight: @colors.boldwhite, reset: @colors.default }))
290
+ msg = Doing::Color.template(['{Rwb}WARNING:{x} {br}The use of --config_file is deprecated,',
291
+ 'please set the environment variable DOING_CONFIG instead.{x}'])
292
+ Doing.logger.warn(msg)
293
+ msg = Doing::Color.template(['{r}To set it just for the current command, use:',
294
+ '{bw}DOING_CONFIG=/path/to/doingrc doing [command]{x}'])
295
+ Doing.logger.warn(msg)
289
296
 
290
297
  cf = File.expand_path(global[:config_file])
291
298
  raise MissingConfigFile, "Config file not found (#{global[:config_file]})" unless File.exist?(cf)
data/docs/doc/Array.html CHANGED
@@ -195,7 +195,7 @@ has content</p>
195
195
  </div>
196
196
 
197
197
  <div id="footer">
198
- Generated on Sun Mar 13 05:08:08 2022 by
198
+ Generated on Tue Mar 15 11:14:29 2022 by
199
199
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
200
200
  0.9.27 (ruby-3.0.1).
201
201
  </div>
@@ -283,7 +283,7 @@
283
283
  </div>
284
284
 
285
285
  <div id="footer">
286
- Generated on Sun Mar 13 05:08:08 2022 by
286
+ Generated on Tue Mar 15 11:14:30 2022 by
287
287
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
288
288
  0.9.27 (ruby-3.0.1).
289
289
  </div>
@@ -162,7 +162,7 @@
162
162
  </div>
163
163
 
164
164
  <div id="footer">
165
- Generated on Sun Mar 13 05:08:08 2022 by
165
+ Generated on Tue Mar 15 11:14:30 2022 by
166
166
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
167
167
  0.9.27 (ruby-3.0.1).
168
168
  </div>
@@ -407,7 +407,7 @@
407
407
  </div>
408
408
 
409
409
  <div id="footer">
410
- Generated on Sun Mar 13 05:08:08 2022 by
410
+ Generated on Tue Mar 15 11:14:30 2022 by
411
411
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
412
412
  0.9.27 (ruby-3.0.1).
413
413
  </div>
@@ -125,7 +125,7 @@ parser. In order to do that, a new &quot;clause&quot; node is added to the parse
125
125
  </div>
126
126
 
127
127
  <div id="footer">
128
- Generated on Sun Mar 13 05:08:08 2022 by
128
+ Generated on Tue Mar 15 11:14:30 2022 by
129
129
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
130
  0.9.27 (ruby-3.0.1).
131
131
  </div>
@@ -114,7 +114,7 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Sun Mar 13 05:08:08 2022 by
117
+ Generated on Tue Mar 15 11:14:30 2022 by
118
118
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
119
  0.9.27 (ruby-3.0.1).
120
120
  </div>
@@ -105,7 +105,7 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Sun Mar 13 05:08:08 2022 by
108
+ Generated on Tue Mar 15 11:14:29 2022 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.9.27 (ruby-3.0.1).
111
111
  </div>
@@ -95,7 +95,7 @@
95
95
 
96
96
  <h2>Overview</h2><div class="docstring">
97
97
  <div class="discussion">
98
- <p>Terminal color functions</p>
98
+ <p>Terminal output color functions.</p>
99
99
 
100
100
 
101
101
  </div>
@@ -115,13 +115,36 @@
115
115
  <dt id="ATTRIBUTES-constant" class="">ATTRIBUTES =
116
116
  <div class="docstring">
117
117
  <div class="discussion">
118
- <p>:stopdoc:</p>
118
+ <p>All available color names. Available as methods and string extensions.</p>
119
119
 
120
120
 
121
121
  </div>
122
122
  </div>
123
123
  <div class="tags">
124
124
 
125
+ <div class="examples">
126
+ <p class="tag_title">Examples:</p>
127
+
128
+
129
+ <p class="example_title"><div class='inline'><p>Use a color as a method. Color reset will be added to end of string.</p>
130
+ </div></p>
131
+
132
+ <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Doing::Color (module)">Color</a></span></span><span class='period'>.</span><span class='id identifier rubyid_yellow'>yellow</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>This text is yellow</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\e[33mThis text is yellow\e[0m</span><span class='tstring_end'>&quot;</span></span></code></pre>
133
+
134
+
135
+ <p class="example_title"><div class='inline'><p>Use a color as a string extension. Color reset added automatically.</p>
136
+ </div></p>
137
+
138
+ <pre class="example code"><code><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>This text is green</span><span class='tstring_end'>&#39;</span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\e[1;32mThis text is green\e[0m</span><span class='tstring_end'>&quot;</span></span></code></pre>
139
+
140
+
141
+ <p class="example_title"><div class='inline'><p>Send a text string as a color</p>
142
+ </div></p>
143
+
144
+ <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Doing::Color (module)">Color</a></span></span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>red</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\e[31m</span><span class='tstring_end'>&quot;</span></span></code></pre>
145
+
146
+ </div>
147
+
125
148
 
126
149
  </div>
127
150
  </dt>
@@ -186,7 +209,7 @@
186
209
  <span class='lbracket'>[</span><span class='symbol'>:redacted</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0;30;40</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
187
210
  <span class='lbracket'>[</span><span class='symbol'>:alert</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1;31;43</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
188
211
  <span class='lbracket'>[</span><span class='symbol'>:error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1;37;41</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
189
- <span class='lbracket'>[</span><span class='symbol'>:default</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0;39</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
212
+ <span class='lbracket'>[</span><span class='symbol'>:default</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0;39</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
190
213
  <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:freeze</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
191
214
 
192
215
  <dt id="ATTRIBUTE_NAMES-constant" class="">ATTRIBUTE_NAMES =
@@ -208,7 +231,7 @@ uncoloring strings.</p>
208
231
 
209
232
  </div>
210
233
  </dt>
211
- <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\e\[(?:(?:[349]|10)[0-7]|[0-9])?m</span><span class='regexp_end'>/</span></span></pre></dd>
234
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\e\[(?:(?:[349]|10)[0-7]|[0-9])?m</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
212
235
 
213
236
  </dl>
214
237
 
@@ -239,7 +262,8 @@ uncoloring strings.</p>
239
262
 
240
263
 
241
264
 
242
- <span class="summary_desc"><div class='inline'></div></span>
265
+ <span class="summary_desc"><div class='inline'><p>Enables colored output.</p>
266
+ </div></span>
243
267
 
244
268
  </li>
245
269
 
@@ -260,7 +284,7 @@ uncoloring strings.</p>
260
284
  <li class="public ">
261
285
  <span class="summary_signature">
262
286
 
263
- <a href="#attributes-class_method" title="attributes (class method)">.<strong>attributes</strong> &#x21d2; Object </a>
287
+ <a href="#coloring%3F-class_method" title="coloring? (class method)">.<strong>coloring?</strong> &#x21d2; Boolean </a>
264
288
 
265
289
 
266
290
 
@@ -274,7 +298,7 @@ uncoloring strings.</p>
274
298
 
275
299
 
276
300
 
277
- <span class="summary_desc"><div class='inline'><p>Returns an array of all Doing::Color attributes as symbols.</p>
301
+ <span class="summary_desc"><div class='inline'><p>Returns true if the coloring function of this module is switched on, false otherwise.</p>
278
302
  </div></span>
279
303
 
280
304
  </li>
@@ -283,7 +307,7 @@ uncoloring strings.</p>
283
307
  <li class="public ">
284
308
  <span class="summary_signature">
285
309
 
286
- <a href="#coloring%3F-class_method" title="coloring? (class method)">.<strong>coloring?</strong> &#x21d2; Boolean </a>
310
+ <a href="#template-class_method" title="template (class method)">.<strong>template</strong>(input) &#x21d2; String </a>
287
311
 
288
312
 
289
313
 
@@ -297,7 +321,7 @@ uncoloring strings.</p>
297
321
 
298
322
 
299
323
 
300
- <span class="summary_desc"><div class='inline'><p>Returns true, if the coloring function of this module is switched on, false otherwise.</p>
324
+ <span class="summary_desc"><div class='inline'><p>Convert a template string to a colored string.</p>
301
325
  </div></span>
302
326
 
303
327
  </li>
@@ -315,6 +339,29 @@ uncoloring strings.</p>
315
339
  <li class="public ">
316
340
  <span class="summary_signature">
317
341
 
342
+ <a href="#attributes-instance_method" title="#attributes (instance method)">#<strong>attributes</strong> &#x21d2; Object </a>
343
+
344
+
345
+
346
+ </span>
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+ <span class="summary_desc"><div class='inline'><p>Returns an array of all Doing::Color attributes as symbols.</p>
357
+ </div></span>
358
+
359
+ </li>
360
+
361
+
362
+ <li class="public ">
363
+ <span class="summary_signature">
364
+
318
365
  <a href="#support%3F-instance_method" title="#support? (instance method)">#<strong>support?</strong>(feature) &#x21d2; Boolean </a>
319
366
 
320
367
 
@@ -376,7 +423,28 @@ uncoloring strings.</p>
376
423
 
377
424
 
378
425
 
379
- </h3>
426
+ </h3><div class="docstring">
427
+ <div class="discussion">
428
+ <p>Enables colored output</p>
429
+
430
+
431
+ </div>
432
+ </div>
433
+ <div class="tags">
434
+
435
+ <div class="examples">
436
+ <p class="tag_title">Examples:</p>
437
+
438
+
439
+ <p class="example_title"><div class='inline'><p>Turn color on or off based on TTY</p>
440
+ </div></p>
441
+
442
+ <pre class="example code"><code><span class='const'><span class='object_link'><a href="../Doing.html" title="Doing (module)">Doing</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Doing::Color (module)">Color</a></span></span><span class='period'>.</span><span class='id identifier rubyid_coloring'>coloring</span> <span class='op'>=</span> <span class='const'>STDOUT</span><span class='period'>.</span><span class='id identifier rubyid_isatty'>isatty</span></code></pre>
443
+
444
+ </div>
445
+
446
+
447
+ </div>
380
448
  </div>
381
449
 
382
450
  </div>
@@ -387,9 +455,9 @@ uncoloring strings.</p>
387
455
 
388
456
 
389
457
  <div class="method_details first">
390
- <h3 class="signature first" id="attributes-class_method">
458
+ <h3 class="signature first" id="coloring?-class_method">
391
459
 
392
- .<strong>attributes</strong> &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>
460
+ .<strong>coloring?</strong> &#x21d2; <tt>Boolean</tt>
393
461
 
394
462
 
395
463
 
@@ -397,21 +465,35 @@ uncoloring strings.</p>
397
465
 
398
466
  </h3><div class="docstring">
399
467
  <div class="discussion">
400
- <p>Returns an array of all Doing::Color attributes as symbols.</p>
468
+ <p>Returns true if the coloring function of this module
469
+ is switched on, false otherwise.</p>
401
470
 
402
471
 
403
472
  </div>
404
473
  </div>
405
474
  <div class="tags">
406
475
 
476
+ <p class="tag_title">Returns:</p>
477
+ <ul class="return">
478
+
479
+ <li>
480
+
481
+
482
+ <span class='type'>(<tt>Boolean</tt>)</span>
483
+
484
+
485
+
486
+ </li>
487
+
488
+ </ul>
407
489
 
408
490
  </div>
409
491
  </div>
410
492
 
411
493
  <div class="method_details ">
412
- <h3 class="signature " id="coloring?-class_method">
494
+ <h3 class="signature " id="template-class_method">
413
495
 
414
- .<strong>coloring?</strong> &#x21d2; <tt>Boolean</tt>
496
+ .<strong>template</strong>(input) &#x21d2; <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
415
497
 
416
498
 
417
499
 
@@ -419,23 +501,65 @@ uncoloring strings.</p>
419
501
 
420
502
  </h3><div class="docstring">
421
503
  <div class="discussion">
422
- <p>Returns true, if the coloring function of this module
423
- is switched on, false otherwise.</p>
504
+ <p>Convert a template string to a colored string.
505
+ Colors are specified with single letters inside
506
+ curly braces. Uppercase changes background color.</p>
507
+
508
+ <p>w: white, k: black, g: green, l: blue, y: yellow, c: cyan,
509
+ m: magenta, r: red, b: bold, u: underline, i: italic,
510
+ x: reset (remove background, color, emphasis)</p>
424
511
 
425
512
 
426
513
  </div>
427
514
  </div>
428
515
  <div class="tags">
429
516
 
517
+ <div class="examples">
518
+ <p class="tag_title">Examples:</p>
519
+
520
+
521
+ <p class="example_title"><div class='inline'><p>Convert a templated string</p>
522
+ </div></p>
523
+
524
+ <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Doing::Color (module)">Color</a></span></span><span class='period'>.</span><span class='id identifier rubyid_template'>template</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{Rwb}Warning:{x} {w}you look a little {g}ill{x}</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span></code></pre>
525
+
526
+ </div>
527
+ <p class="tag_title">Parameters:</p>
528
+ <ul class="param">
529
+
530
+ <li>
531
+
532
+ <span class='name'>input</span>
533
+
534
+
535
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>, <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span>
536
+
537
+
538
+
539
+ &mdash;
540
+ <div class='inline'><p>The template
541
+ string. If this is an array, the
542
+ elements will be joined with a
543
+ space.</p>
544
+ </div>
545
+
546
+ </li>
547
+
548
+ </ul>
549
+
430
550
  <p class="tag_title">Returns:</p>
431
551
  <ul class="return">
432
552
 
433
553
  <li>
434
554
 
435
555
 
436
- <span class='type'>(<tt>Boolean</tt>)</span>
556
+ <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
557
+
437
558
 
438
559
 
560
+ &mdash;
561
+ <div class='inline'><p>Colorized string</p>
562
+ </div>
439
563
 
440
564
  </li>
441
565
 
@@ -451,7 +575,29 @@ is switched on, false otherwise.</p>
451
575
 
452
576
 
453
577
  <div class="method_details first">
454
- <h3 class="signature first" id="support?-instance_method">
578
+ <h3 class="signature first" id="attributes-instance_method">
579
+
580
+ #<strong>attributes</strong> &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>
581
+
582
+
583
+
584
+
585
+
586
+ </h3><div class="docstring">
587
+ <div class="discussion">
588
+ <p>Returns an array of all Doing::Color attributes as symbols.</p>
589
+
590
+
591
+ </div>
592
+ </div>
593
+ <div class="tags">
594
+
595
+
596
+ </div>
597
+ </div>
598
+
599
+ <div class="method_details ">
600
+ <h3 class="signature " id="support?-instance_method">
455
601
 
456
602
  #<strong>support?</strong>(feature) &#x21d2; <tt>Boolean</tt>
457
603
 
@@ -518,7 +664,7 @@ ANSI-sequences are stripped from the string.</p>
518
664
  </div>
519
665
 
520
666
  <div id="footer">
521
- Generated on Sun Mar 13 05:08:08 2022 by
667
+ Generated on Tue Mar 15 11:14:29 2022 by
522
668
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
523
669
  0.9.27 (ruby-3.0.1).
524
670
  </div>
@@ -526,7 +526,7 @@ stdout</p>
526
526
  </div>
527
527
 
528
528
  <div id="footer">
529
- Generated on Sun Mar 13 05:08:08 2022 by
529
+ Generated on Tue Mar 15 11:14:29 2022 by
530
530
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
531
531
  0.9.27 (ruby-3.0.1).
532
532
  </div>
@@ -1139,7 +1139,7 @@ matched, first match wins)</p>
1139
1139
  </div>
1140
1140
 
1141
1141
  <div id="footer">
1142
- Generated on Sun Mar 13 05:08:08 2022 by
1142
+ Generated on Tue Mar 15 11:14:30 2022 by
1143
1143
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1144
1144
  0.9.27 (ruby-3.0.1).
1145
1145
  </div>
@@ -101,6 +101,10 @@
101
101
 
102
102
  </div>
103
103
 
104
+ <div id="subclasses">
105
+ <h2>Direct Known Subclasses</h2>
106
+ <p class="children"><span class='object_link'><a href="EmptyInput.html" title="Doing::Errors::EmptyInput (class)">EmptyInput</a></span>, <span class='object_link'><a href="HistoryLimitError.html" title="Doing::Errors::HistoryLimitError (class)">HistoryLimitError</a></span>, <span class='object_link'><a href="MissingBackupFile.html" title="Doing::Errors::MissingBackupFile (class)">MissingBackupFile</a></span>, <span class='object_link'><a href="NoResults.html" title="Doing::Errors::NoResults (class)">NoResults</a></span>, <span class='object_link'><a href="UserCancelled.html" title="Doing::Errors::UserCancelled (class)">UserCancelled</a></span>, <span class='object_link'><a href="WrongCommand.html" title="Doing::Errors::WrongCommand (class)">WrongCommand</a></span></p>
107
+ </div>
104
108
 
105
109
 
106
110
 
@@ -119,7 +123,7 @@
119
123
  <li class="public ">
120
124
  <span class="summary_signature">
121
125
 
122
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(msg = nil, level = nil, topic = nil) &#x21d2; DoingNoTraceError </a>
126
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(msg = nil, level: nil, topic: &#39;Error:&#39;, exit_code: 1) &#x21d2; DoingNoTraceError </a>
123
127
 
124
128
 
125
129
 
@@ -151,7 +155,7 @@
151
155
  <div class="method_details first">
152
156
  <h3 class="signature first" id="initialize-instance_method">
153
157
 
154
- #<strong>initialize</strong>(msg = nil, level = nil, topic = nil) &#x21d2; <tt><span class='object_link'><a href="" title="Doing::Errors::DoingNoTraceError (class)">DoingNoTraceError</a></span></tt>
158
+ #<strong>initialize</strong>(msg = nil, level: nil, topic: &#39;Error:&#39;, exit_code: 1) &#x21d2; <tt><span class='object_link'><a href="" title="Doing::Errors::DoingNoTraceError (class)">DoingNoTraceError</a></span></tt>
155
159
 
156
160
 
157
161
 
@@ -176,7 +180,7 @@
176
180
  </div>
177
181
 
178
182
  <div id="footer">
179
- Generated on Sun Mar 13 05:08:08 2022 by
183
+ Generated on Tue Mar 15 11:14:29 2022 by
180
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
181
185
  0.9.27 (ruby-3.0.1).
182
186
  </div>
@@ -101,6 +101,10 @@
101
101
 
102
102
  </div>
103
103
 
104
+ <div id="subclasses">
105
+ <h2>Direct Known Subclasses</h2>
106
+ <p class="children"><span class='object_link'><a href="InvalidPlugin.html" title="Doing::Errors::InvalidPlugin (class)">InvalidPlugin</a></span></p>
107
+ </div>
104
108
 
105
109
 
106
110
 
@@ -119,7 +123,7 @@
119
123
  <li class="public ">
120
124
  <span class="summary_signature">
121
125
 
122
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(msg = &#39;Runtime Error&#39;, topic: &#39;Error:&#39;) &#x21d2; DoingRuntimeError </a>
126
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(msg = &#39;Runtime Error&#39;, exit_code = nil, topic: &#39;Error:&#39;) &#x21d2; DoingRuntimeError </a>
123
127
 
124
128
 
125
129
 
@@ -151,7 +155,7 @@
151
155
  <div class="method_details first">
152
156
  <h3 class="signature first" id="initialize-instance_method">
153
157
 
154
- #<strong>initialize</strong>(msg = &#39;Runtime Error&#39;, topic: &#39;Error:&#39;) &#x21d2; <tt><span class='object_link'><a href="" title="Doing::Errors::DoingRuntimeError (class)">DoingRuntimeError</a></span></tt>
158
+ #<strong>initialize</strong>(msg = &#39;Runtime Error&#39;, exit_code = nil, topic: &#39;Error:&#39;) &#x21d2; <tt><span class='object_link'><a href="" title="Doing::Errors::DoingRuntimeError (class)">DoingRuntimeError</a></span></tt>
155
159
 
156
160
 
157
161
 
@@ -176,7 +180,7 @@
176
180
  </div>
177
181
 
178
182
  <div id="footer">
179
- Generated on Sun Mar 13 05:08:08 2022 by
183
+ Generated on Tue Mar 15 11:14:29 2022 by
180
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
181
185
  0.9.27 (ruby-3.0.1).
182
186
  </div>
@@ -176,7 +176,7 @@
176
176
  </div>
177
177
 
178
178
  <div id="footer">
179
- Generated on Sun Mar 13 05:08:08 2022 by
179
+ Generated on Tue Mar 15 11:14:29 2022 by
180
180
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
181
181
  0.9.27 (ruby-3.0.1).
182
182
  </div>