doing 2.1.6pre → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +6 -6
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/CHANGELOG.md +34 -18
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/doing +17 -0
- data/docs/doc/Array.html +1 -1
- data/docs/doc/BooleanTermParser/Clause.html +1 -1
- data/docs/doc/BooleanTermParser/Operator.html +1 -1
- data/docs/doc/BooleanTermParser/Query.html +1 -1
- data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
- data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
- data/docs/doc/BooleanTermParser.html +1 -1
- data/docs/doc/Doing/Color.html +1 -1
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +2 -1
- data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
- data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
- data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
- data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
- data/docs/doc/Doing/Errors/NoResults.html +1 -1
- data/docs/doc/Doing/Errors/PluginException.html +1 -1
- data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
- data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
- data/docs/doc/Doing/Errors.html +1 -1
- data/docs/doc/Doing/Hooks.html +1 -1
- data/docs/doc/Doing/Item.html +1 -1
- data/docs/doc/Doing/Items.html +1 -1
- data/docs/doc/Doing/LogAdapter.html +1 -1
- data/docs/doc/Doing/Note.html +1 -1
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +1 -1
- data/docs/doc/Doing/Prompt.html +132 -18
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/TemplateString.html +1 -1
- data/docs/doc/Doing/Util/Backup.html +79 -2
- data/docs/doc/Doing/Util.html +1 -1
- data/docs/doc/Doing/WWID.html +38 -70
- data/docs/doc/Doing.html +2 -2
- data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/docs/doc/GLI/Commands.html +1 -1
- data/docs/doc/GLI.html +1 -1
- data/docs/doc/Hash.html +1 -1
- data/docs/doc/PhraseParser/Operator.html +1 -1
- data/docs/doc/PhraseParser/PhraseClause.html +1 -1
- data/docs/doc/PhraseParser/Query.html +1 -1
- data/docs/doc/PhraseParser/QueryParser.html +1 -1
- data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
- data/docs/doc/PhraseParser/TermClause.html +1 -1
- data/docs/doc/PhraseParser.html +1 -1
- data/docs/doc/Status.html +1 -1
- data/docs/doc/String.html +1 -1
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +1 -1
- data/docs/doc/_index.html +1 -1
- data/docs/doc/file.README.html +2 -2
- data/docs/doc/index.html +2 -2
- data/docs/doc/method_list.html +345 -305
- data/docs/doc/top-level-namespace.html +1 -1
- data/docs/index.md +1 -1
- data/doing.rdoc +1 -1
- data/lib/doing/configuration.rb +1 -0
- data/lib/doing/log_adapter.rb +1 -0
- data/lib/doing/prompt.rb +47 -8
- data/lib/doing/util_backup.rb +23 -4
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +59 -30
- metadata +4 -5
- data/lib/helpers/fuzzyfilefinder +0 -0
@@ -102,7 +102,7 @@
|
|
102
102
|
</div>
|
103
103
|
|
104
104
|
<div id="footer">
|
105
|
-
Generated on
|
105
|
+
Generated on Tue Dec 21 12:36:35 2021 by
|
106
106
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
107
107
|
0.9.26 (ruby-3.0.1).
|
108
108
|
</div>
|
data/docs/index.md
CHANGED
@@ -6,7 +6,7 @@ _If you're one of the rare people like me who find this useful, feel free to [bu
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
The current version of `doing` is 2.1.
|
9
|
+
The current version of `doing` is 2.1.5.
|
10
10
|
|
11
11
|
Find all of the documentation in the [doing wiki](https://github.com/ttscoff/doing/wiki).
|
12
12
|
|
data/doing.rdoc
CHANGED
@@ -5,7 +5,7 @@ record of what you've been doing, complete with tag-based time tracking. The
|
|
5
5
|
command line tool allows you to add entries, annotate with tags and notes, and
|
6
6
|
view your entries with myriad options, with a focus on a "natural" language syntax.
|
7
7
|
|
8
|
-
v2.1.
|
8
|
+
v2.1.9
|
9
9
|
|
10
10
|
=== Global Options
|
11
11
|
=== --config_file arg
|
data/lib/doing/configuration.rb
CHANGED
data/lib/doing/log_adapter.rb
CHANGED
data/lib/doing/prompt.rb
CHANGED
@@ -86,7 +86,38 @@ module Doing
|
|
86
86
|
@fzf ||= install_fzf
|
87
87
|
end
|
88
88
|
|
89
|
-
def
|
89
|
+
def uninstall_fzf
|
90
|
+
fzf_bin = File.join(File.dirname(__FILE__), '../helpers/fzf/bin/fzf')
|
91
|
+
FileUtils.rm_f(fzf_bin) if File.exist?(fzf_bin)
|
92
|
+
Doing.logger.warn('fzf:', "removed #{fzf_bin}")
|
93
|
+
end
|
94
|
+
|
95
|
+
def which_fzf
|
96
|
+
fzf_dir = File.join(File.dirname(__FILE__), '../helpers/fzf')
|
97
|
+
fzf_bin = File.join(fzf_dir, 'bin/fzf')
|
98
|
+
return fzf_bin if File.exist?(fzf_bin)
|
99
|
+
|
100
|
+
Doing.logger.debug('fzf:', 'Using user-installed fzf')
|
101
|
+
TTY::Which.which('fzf')
|
102
|
+
end
|
103
|
+
|
104
|
+
def silence_std(file = '/dev/null')
|
105
|
+
$stdout = File.new(file, 'w')
|
106
|
+
$stderr = File.new(file, 'w')
|
107
|
+
end
|
108
|
+
|
109
|
+
def restore_std
|
110
|
+
$stdout = STDOUT
|
111
|
+
$stderr = STDERR
|
112
|
+
end
|
113
|
+
|
114
|
+
def install_fzf(force: false)
|
115
|
+
if force
|
116
|
+
uninstall_fzf
|
117
|
+
elsif which_fzf
|
118
|
+
return which_fzf
|
119
|
+
end
|
120
|
+
|
90
121
|
fzf_dir = File.join(File.dirname(__FILE__), '../helpers/fzf')
|
91
122
|
FileUtils.mkdir_p(fzf_dir) unless File.directory?(fzf_dir)
|
92
123
|
fzf_bin = File.join(fzf_dir, 'bin/fzf')
|
@@ -94,17 +125,25 @@ module Doing
|
|
94
125
|
|
95
126
|
prev_level = Doing.logger.level
|
96
127
|
Doing.logger.adjust_verbosity({ log_level: :info })
|
97
|
-
Doing.logger.log_now(:warn, 'Compiling and installing fzf -- this will only happen once')
|
98
|
-
Doing.logger.log_now(:warn, 'fzf is copyright Junegunn Choi, MIT License <https://github.com/junegunn/fzf/blob/master/LICENSE>')
|
128
|
+
Doing.logger.log_now(:warn, 'fzf:', 'Compiling and installing fzf -- this will only happen once')
|
129
|
+
Doing.logger.log_now(:warn, 'fzf:', 'fzf is copyright Junegunn Choi, MIT License <https://github.com/junegunn/fzf/blob/master/LICENSE>')
|
99
130
|
|
100
|
-
|
131
|
+
silence_std
|
132
|
+
`'#{fzf_dir}/install' --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &> /dev/null`
|
101
133
|
unless File.exist?(fzf_bin)
|
134
|
+
restore_std
|
102
135
|
Doing.logger.log_now(:warn, 'Error installing, trying again as root')
|
103
|
-
|
136
|
+
silence_std
|
137
|
+
`sudo '#{fzf_dir}/install' --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &> /dev/null`
|
138
|
+
end
|
139
|
+
restore_std
|
140
|
+
unless File.exist?(fzf_bin)
|
141
|
+
Doing.logger.error('fzf:', 'unable to install fzf. You can install manually and Doing will use the system version.')
|
142
|
+
Doing.logger.error('fzf:', 'see https://github.com/junegunn/fzf#installation')
|
143
|
+
raise RuntimeError.new('Error installing fzf, please report at https://github.com/ttscoff/doing/issues')
|
104
144
|
end
|
105
|
-
raise RuntimeError.new('Error installing fzf, please report at https://github.com/ttscoff/doing/issues') unless File.exist?(fzf_bin)
|
106
145
|
|
107
|
-
Doing.logger.info(
|
146
|
+
Doing.logger.info('fzf:', "installed to #{fzf}")
|
108
147
|
Doing.logger.adjust_verbosity({ log_level: prev_level })
|
109
148
|
fzf_bin
|
110
149
|
end
|
@@ -189,7 +228,7 @@ module Doing
|
|
189
228
|
%(-q "#{query}"),
|
190
229
|
'--info=inline'
|
191
230
|
]
|
192
|
-
fzf_args.push('-1') unless opt.fetch(:show_if_single)
|
231
|
+
fzf_args.push('-1') unless opt.fetch(:show_if_single, false)
|
193
232
|
fzf_args << case case_sensitive
|
194
233
|
when :sensitive
|
195
234
|
'+i'
|
data/lib/doing/util_backup.rb
CHANGED
@@ -20,6 +20,21 @@ module Doing
|
|
20
20
|
backups[limit..-1].each do |file|
|
21
21
|
FileUtils.rm(File.join(backup_dir, file))
|
22
22
|
end
|
23
|
+
|
24
|
+
clear_redo(filename)
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
## Delete all redo files
|
29
|
+
##
|
30
|
+
## @param limit Maximum number of backups to retain
|
31
|
+
##
|
32
|
+
def clear_redo(filename)
|
33
|
+
filename ||= Doing.config.settings['doing_file']
|
34
|
+
backups = Dir.glob("undone*___#{File.basename(filename)}", base: backup_dir).sort.reverse
|
35
|
+
backups.each do |file|
|
36
|
+
FileUtils.rm(File.join(backup_dir, file))
|
37
|
+
end
|
23
38
|
end
|
24
39
|
|
25
40
|
##
|
@@ -103,6 +118,8 @@ module Doing
|
|
103
118
|
arr.push("#{d.time_ago}\t#{File.join(backup_dir, file)}")
|
104
119
|
end
|
105
120
|
|
121
|
+
raise DoingRuntimeError, 'No backup files to load' if options.empty?
|
122
|
+
|
106
123
|
backup_file = show_menu(options, filename)
|
107
124
|
idx = undones.index(File.basename(backup_file))
|
108
125
|
skipped = undones.slice!(idx, undones.count - idx)
|
@@ -135,8 +152,10 @@ module Doing
|
|
135
152
|
arr.push("#{d.time_ago}\t#{File.join(backup_dir, file)}")
|
136
153
|
end
|
137
154
|
|
155
|
+
raise DoingRuntimeError, 'No backup files to load' if options.empty?
|
156
|
+
|
138
157
|
backup_file = show_menu(options, filename)
|
139
|
-
write_to_file(File.join(backup_dir, "undone___#{File.basename(filename)}"), IO.read(filename), backup: false)
|
158
|
+
Util.write_to_file(File.join(backup_dir, "undone___#{File.basename(filename)}"), IO.read(filename), backup: false)
|
140
159
|
FileUtils.mv(backup_file, filename)
|
141
160
|
prune_backups_after(File.basename(backup_file))
|
142
161
|
Doing.logger.warn('File update:', "restored from #{backup_file}")
|
@@ -204,7 +223,7 @@ module Doing
|
|
204
223
|
|
205
224
|
FileUtils.cp(filename, backup_file)
|
206
225
|
|
207
|
-
prune_backups(filename,
|
226
|
+
prune_backups(filename, Doing.config.settings['history_size'].to_i)
|
208
227
|
clear_undone(filename)
|
209
228
|
Doing.logger.benchmark(:_write_backup, :finish)
|
210
229
|
end
|
@@ -215,10 +234,10 @@ module Doing
|
|
215
234
|
Time.now.strftime('%Y-%m-%d_%H.%M.%S')
|
216
235
|
end
|
217
236
|
|
218
|
-
def get_backups(filename = nil)
|
237
|
+
def get_backups(filename = nil, include_forward: false)
|
219
238
|
filename ||= Doing.config.settings['doing_file']
|
220
239
|
backups = Dir.glob("*___#{File.basename(filename)}", base: backup_dir).sort.reverse
|
221
|
-
backups.delete_if { |f| f =~ /^undone/ }
|
240
|
+
backups.delete_if { |f| f =~ /^undone/ } unless include_forward
|
222
241
|
end
|
223
242
|
|
224
243
|
def save_undone(filename = nil)
|
data/lib/doing/version.rb
CHANGED
data/lib/doing/wwid.rb
CHANGED
@@ -338,7 +338,8 @@ module Doing
|
|
338
338
|
## @option opt :back [Date] backdate
|
339
339
|
## @option opt :timed [Boolean] new item is timed entry, marks previous entry as @done
|
340
340
|
##
|
341
|
-
def add_item(title, section = nil, opt
|
341
|
+
def add_item(title, section = nil, opt)
|
342
|
+
opt ||= {}
|
342
343
|
section ||= @config['current_section']
|
343
344
|
@content.add_section(section, log: false)
|
344
345
|
opt[:back] ||= opt[:date] ? opt[:date] : Time.now
|
@@ -401,7 +402,8 @@ module Doing
|
|
401
402
|
## @param paths [String] Path to JSON report file
|
402
403
|
## @param opt [Hash] Additional Options
|
403
404
|
##
|
404
|
-
def import(paths, opt
|
405
|
+
def import(paths, opt)
|
406
|
+
opt ||= {}
|
405
407
|
Plugins.plugins[:import].each do |_, options|
|
406
408
|
next unless opt[:type] =~ /^(#{options[:trigger].normalize_trigger})$/i
|
407
409
|
|
@@ -461,7 +463,8 @@ module Doing
|
|
461
463
|
#
|
462
464
|
# @return nothing
|
463
465
|
#
|
464
|
-
def repeat_item(item, opt
|
466
|
+
def repeat_item(item, opt)
|
467
|
+
opt ||= {}
|
465
468
|
if item.should_finish?
|
466
469
|
if item.should_time?
|
467
470
|
item.title.tag!('done', value: Time.now.strftime('%F %R'))
|
@@ -501,7 +504,8 @@ module Doing
|
|
501
504
|
##
|
502
505
|
## @param opt [Hash] Additional Options
|
503
506
|
##
|
504
|
-
def repeat_last(opt
|
507
|
+
def repeat_last(opt)
|
508
|
+
opt ||= {}
|
505
509
|
opt[:section] ||= 'all'
|
506
510
|
opt[:section] = guess_section(opt[:section])
|
507
511
|
opt[:note] ||= []
|
@@ -523,7 +527,8 @@ module Doing
|
|
523
527
|
##
|
524
528
|
## @param opt [Hash] Additional Options
|
525
529
|
##
|
526
|
-
def last_entry(opt
|
530
|
+
def last_entry(opt)
|
531
|
+
opt ||= {}
|
527
532
|
opt[:tag_bool] ||= :and
|
528
533
|
opt[:section] ||= @config['current_section']
|
529
534
|
|
@@ -800,7 +805,8 @@ module Doing
|
|
800
805
|
##
|
801
806
|
## Options hash is shared with #filter_items and #act_on
|
802
807
|
##
|
803
|
-
def interactive(opt
|
808
|
+
def interactive(opt)
|
809
|
+
opt ||= {}
|
804
810
|
opt[:section] = opt[:section] ? guess_section(opt[:section]) : 'All'
|
805
811
|
|
806
812
|
search = nil
|
@@ -820,7 +826,11 @@ module Doing
|
|
820
826
|
}
|
821
827
|
items = filter_items(Items.new, opt: filter_options)
|
822
828
|
|
823
|
-
|
829
|
+
menu_options = %i[search query exact multiple show_if_single menu sort case].each_with_object({}) {
|
830
|
+
|k, hsh| hsh[k] = opt[k]
|
831
|
+
}
|
832
|
+
|
833
|
+
selection = Prompt.choose_from_items(items, include_section: opt[:section] =~ /^all$/i, **menu_options)
|
824
834
|
|
825
835
|
raise NoResults, 'no items selected' if selection.nil? || selection.empty?
|
826
836
|
|
@@ -848,7 +858,8 @@ module Doing
|
|
848
858
|
## @option opt [Boolean] :again
|
849
859
|
## @option opt [Boolean] :resume
|
850
860
|
##
|
851
|
-
def act_on(items, opt
|
861
|
+
def act_on(items, opt)
|
862
|
+
opt ||= {}
|
852
863
|
actions = %i[editor delete tag flag finish cancel archive output save_to again resume]
|
853
864
|
has_action = false
|
854
865
|
single = items.count == 1
|
@@ -1105,7 +1116,8 @@ module Doing
|
|
1105
1116
|
##
|
1106
1117
|
## @see #filter_items
|
1107
1118
|
##
|
1108
|
-
def tag_last(opt
|
1119
|
+
def tag_last(opt)
|
1120
|
+
opt ||= {}
|
1109
1121
|
opt[:count] ||= 1
|
1110
1122
|
opt[:archive] ||= false
|
1111
1123
|
opt[:tags] ||= ['done']
|
@@ -1229,7 +1241,8 @@ module Doing
|
|
1229
1241
|
##
|
1230
1242
|
## @return [Item] the next chronological item in the index
|
1231
1243
|
##
|
1232
|
-
def next_item(item, options
|
1244
|
+
def next_item(item, options)
|
1245
|
+
options ||= {}
|
1233
1246
|
items = filter_items(Items.new, opt: options)
|
1234
1247
|
|
1235
1248
|
idx = items.index(item)
|
@@ -1287,7 +1300,8 @@ module Doing
|
|
1287
1300
|
## @option opt :back [Date] backdate new item
|
1288
1301
|
## @option opt :new_item [String] content to use for new item
|
1289
1302
|
## @option opt :note [Array] note content for new item
|
1290
|
-
def stop_start(target_tag, opt
|
1303
|
+
def stop_start(target_tag, opt)
|
1304
|
+
opt ||= {}
|
1291
1305
|
tag = target_tag.dup
|
1292
1306
|
opt[:section] ||= @config['current_section']
|
1293
1307
|
opt[:archive] ||= false
|
@@ -1354,7 +1368,8 @@ module Doing
|
|
1354
1368
|
##
|
1355
1369
|
## Rename doing file with date and start fresh one
|
1356
1370
|
##
|
1357
|
-
def rotate(opt
|
1371
|
+
def rotate(opt)
|
1372
|
+
opt ||= {}
|
1358
1373
|
keep = opt[:keep] || 0
|
1359
1374
|
tags = []
|
1360
1375
|
tags.concat(opt[:tag].split(/ *, */).map { |t| t.sub(/^@/, '').strip }) if opt[:tag]
|
@@ -1369,7 +1384,7 @@ module Doing
|
|
1369
1384
|
counter = 0
|
1370
1385
|
new_content = Items.new
|
1371
1386
|
|
1372
|
-
|
1387
|
+
section_items.each do |item|
|
1373
1388
|
break if counter >= max
|
1374
1389
|
if opt[:before]
|
1375
1390
|
time_string = opt[:before]
|
@@ -1482,7 +1497,7 @@ module Doing
|
|
1482
1497
|
##
|
1483
1498
|
## @param opt [Hash] Additional Options
|
1484
1499
|
##
|
1485
|
-
def list_section(opt
|
1500
|
+
def list_section(opt, items: Items.new)
|
1486
1501
|
opt[:config_template] ||= 'default'
|
1487
1502
|
|
1488
1503
|
tpl_cfg = @config.dig('templates', opt[:config_template])
|
@@ -1559,7 +1574,8 @@ module Doing
|
|
1559
1574
|
## @param section [String] The source section
|
1560
1575
|
## @param options [Hash] Options
|
1561
1576
|
##
|
1562
|
-
def archive(section = @config['current_section'], options
|
1577
|
+
def archive(section = @config['current_section'], options)
|
1578
|
+
options ||= {}
|
1563
1579
|
count = options[:keep] || 0
|
1564
1580
|
destination = options[:destination] || 'Archive'
|
1565
1581
|
tags = options[:tags] || []
|
@@ -1589,7 +1605,8 @@ module Doing
|
|
1589
1605
|
## @param output [String] output format
|
1590
1606
|
## @param opt [Hash] Options
|
1591
1607
|
##
|
1592
|
-
def today(times = true, output = nil, opt
|
1608
|
+
def today(times = true, output = nil, opt)
|
1609
|
+
opt ||= {}
|
1593
1610
|
opt[:totals] ||= false
|
1594
1611
|
opt[:sort_tags] ||= false
|
1595
1612
|
|
@@ -1637,7 +1654,8 @@ module Doing
|
|
1637
1654
|
## @param output [String] Output format
|
1638
1655
|
## @param opt [Hash] Additional Options
|
1639
1656
|
##
|
1640
|
-
def list_date(dates, section, times = nil, output = nil, opt
|
1657
|
+
def list_date(dates, section, times = nil, output = nil, opt)
|
1658
|
+
opt ||= {}
|
1641
1659
|
opt[:totals] ||= false
|
1642
1660
|
opt[:sort_tags] ||= false
|
1643
1661
|
section = guess_section(section)
|
@@ -1666,7 +1684,8 @@ module Doing
|
|
1666
1684
|
## @param output [String] Output format
|
1667
1685
|
## @param opt [Hash] Additional Options
|
1668
1686
|
##
|
1669
|
-
def yesterday(section, times = nil, output = nil, opt
|
1687
|
+
def yesterday(section, times = nil, output = nil, opt)
|
1688
|
+
opt ||= {}
|
1670
1689
|
opt[:totals] ||= false
|
1671
1690
|
opt[:sort_tags] ||= false
|
1672
1691
|
section = guess_section(section)
|
@@ -1701,7 +1720,8 @@ module Doing
|
|
1701
1720
|
## @param section [String] The section to show from, default Currently
|
1702
1721
|
## @param opt [Hash] Additional Options
|
1703
1722
|
##
|
1704
|
-
def recent(count = 10, section = nil, opt
|
1723
|
+
def recent(count = 10, section = nil, opt)
|
1724
|
+
opt ||= {}
|
1705
1725
|
times = opt[:t] || true
|
1706
1726
|
opt[:totals] ||= false
|
1707
1727
|
opt[:sort_tags] ||= false
|
@@ -1720,10 +1740,16 @@ module Doing
|
|
1720
1740
|
section ||= @config['current_section']
|
1721
1741
|
section = guess_section(section)
|
1722
1742
|
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1743
|
+
opt[:section] = section
|
1744
|
+
opt[:wrap_width] = cfg['wrap_width']
|
1745
|
+
opt[:count] = count
|
1746
|
+
opt[:format] = cfg['date_format']
|
1747
|
+
opt[:template] = cfg['template']
|
1748
|
+
opt[:order] = 'asc'
|
1749
|
+
opt[:times] = times
|
1750
|
+
opt[:config_template] = 'recent'
|
1751
|
+
|
1752
|
+
list_section(opt)
|
1727
1753
|
end
|
1728
1754
|
|
1729
1755
|
##
|
@@ -1776,13 +1802,14 @@ module Doing
|
|
1776
1802
|
## Does not repeat tags in a title, and only converts the first instance of an
|
1777
1803
|
## untagged keyword
|
1778
1804
|
##
|
1779
|
-
## @param
|
1805
|
+
## @param string [String] The text to tag
|
1780
1806
|
##
|
1781
|
-
def autotag(
|
1782
|
-
return unless
|
1783
|
-
return
|
1807
|
+
def autotag(string)
|
1808
|
+
return unless string
|
1809
|
+
return string unless @auto_tag
|
1784
1810
|
|
1785
|
-
original =
|
1811
|
+
original = string.dup
|
1812
|
+
text = string.dup
|
1786
1813
|
|
1787
1814
|
current_tags = text.scan(/@\w+/).map { |t| t.sub(/^@/, '') }
|
1788
1815
|
tagged = {
|
@@ -2091,7 +2118,8 @@ EOS
|
|
2091
2118
|
## @return [String] formatted output based on opt[:output]
|
2092
2119
|
## template trigger
|
2093
2120
|
##
|
2094
|
-
def output(items, title, is_single, opt
|
2121
|
+
def output(items, title, is_single, opt)
|
2122
|
+
opt ||= {}
|
2095
2123
|
out = nil
|
2096
2124
|
|
2097
2125
|
raise InvalidArgument, 'Unknown output format' unless opt[:output] =~ Plugins.plugin_regex(type: :export)
|
@@ -2135,7 +2163,8 @@ EOS
|
|
2135
2163
|
## section
|
2136
2164
|
## @param opt [Hash] Additional Options
|
2137
2165
|
##
|
2138
|
-
def do_archive(section, destination, opt
|
2166
|
+
def do_archive(section, destination, opt)
|
2167
|
+
opt ||= {}
|
2139
2168
|
count = opt[:count] || 0
|
2140
2169
|
tags = opt[:tags] || []
|
2141
2170
|
bool = opt[:bool] || :and
|
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.
|
4
|
+
version: 2.1.9
|
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-
|
11
|
+
date: 2021-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -542,7 +542,6 @@ files:
|
|
542
542
|
- lib/examples/plugins/wiki_export/templates/wiki.haml
|
543
543
|
- lib/examples/plugins/wiki_export/templates/wiki_index.haml
|
544
544
|
- lib/examples/plugins/wiki_export/wiki_export.rb
|
545
|
-
- lib/helpers/fuzzyfilefinder
|
546
545
|
- lib/helpers/fzf/.goreleaser.yml
|
547
546
|
- lib/helpers/fzf/.rubocop.yml
|
548
547
|
- lib/helpers/fzf/ADVANCED.md
|
@@ -666,9 +665,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
666
665
|
version: '0'
|
667
666
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
668
667
|
requirements:
|
669
|
-
- - "
|
668
|
+
- - ">="
|
670
669
|
- !ruby/object:Gem::Version
|
671
|
-
version:
|
670
|
+
version: '0'
|
672
671
|
requirements: []
|
673
672
|
rubygems_version: 3.2.16
|
674
673
|
signing_key:
|
data/lib/helpers/fuzzyfilefinder
DELETED
Binary file
|