doing 1.0.42 → 1.0.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/doing +25 -2
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +56 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa5febc2d54f2d65e4e09b1b72e65cd19c3ca19c2c5b7b155fae667071f77aeb
|
4
|
+
data.tar.gz: 1a8401a27918d5e1ec4b5b66ae6986e2130a3dde568f894c79e93b8b610ed8cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 558ee0d409f410ec30a15f5cf99194f1a9a6c98bc6d7711ccff5d8d88492166fd9d2ff12b3b3cf304fd3c393e975bb09cda92efadb6439db8d20fe12a7a9b882
|
7
|
+
data.tar.gz: 638222cb9655553bbd230262127ccb03b551bb03989ab58e2cfecb9908735a654e775203c379593e3b79cebef132fcb2f8bad1d8251e73836e9758e8e7e6988d
|
data/bin/doing
CHANGED
@@ -488,6 +488,21 @@ command :finish do |c|
|
|
488
488
|
end
|
489
489
|
end
|
490
490
|
|
491
|
+
desc 'Repeat last entry as new entry'
|
492
|
+
arg_name 'section'
|
493
|
+
command [:again,:resume] do |c|
|
494
|
+
c.desc 'Section'
|
495
|
+
c.flag [:s, :section], :default_value => "All"
|
496
|
+
|
497
|
+
c.desc 'Note'
|
498
|
+
c.arg_name 'note_text'
|
499
|
+
c.flag [:n,:note]
|
500
|
+
|
501
|
+
c.action do |global_options, options, args|
|
502
|
+
wwid.restart_last({ section: options[:s], note: options[:n] })
|
503
|
+
end
|
504
|
+
end
|
505
|
+
|
491
506
|
desc 'Tag last entry'
|
492
507
|
arg_name 'tag1 [tag2...]'
|
493
508
|
command :tag do |c|
|
@@ -555,7 +570,7 @@ command :tag do |c|
|
|
555
570
|
end
|
556
571
|
|
557
572
|
desc 'Mark last entry as highlighted'
|
558
|
-
command :mark do |c|
|
573
|
+
command [:mark,:flag] do |c|
|
559
574
|
c.desc 'Section'
|
560
575
|
c.default_value wwid.current_section
|
561
576
|
c.flag [:s,:section], :default_value => wwid.current_section
|
@@ -1212,7 +1227,15 @@ post do |global,command,options,args|
|
|
1212
1227
|
if global[:stdout]
|
1213
1228
|
$stdout.print wwid.results.join("\n")
|
1214
1229
|
else
|
1215
|
-
|
1230
|
+
warn wwid.results.join("\n")
|
1231
|
+
end
|
1232
|
+
|
1233
|
+
if wwid.config['run_after']
|
1234
|
+
script = File.expand_path(wwid.config['run_after'])
|
1235
|
+
if File.exist?(script)
|
1236
|
+
warn "Running #{script}"
|
1237
|
+
`#{script}`
|
1238
|
+
end
|
1216
1239
|
end
|
1217
1240
|
end
|
1218
1241
|
|
data/lib/doing/version.rb
CHANGED
data/lib/doing/wwid.rb
CHANGED
@@ -654,6 +654,62 @@ class WWID
|
|
654
654
|
end
|
655
655
|
end
|
656
656
|
|
657
|
+
##
|
658
|
+
## @brief Restart the last entry
|
659
|
+
##
|
660
|
+
## @param opt (Hash) Additional Options
|
661
|
+
##
|
662
|
+
def restart_last(opt = {})
|
663
|
+
opt[:section] ||= 'all'
|
664
|
+
opt[:note] ||= []
|
665
|
+
|
666
|
+
last = last_entry(opt)
|
667
|
+
if last.nil?
|
668
|
+
@results.push(%Q{No previous entry found})
|
669
|
+
return
|
670
|
+
end
|
671
|
+
# Remove @done tag
|
672
|
+
title = last['title'].sub!(/\s*@done(\(.*?\))?/, '').chomp
|
673
|
+
add_item(title, last['section'], {:note => opt[:note], :back => opt[:date], :timed => true})
|
674
|
+
write(@doing_file)
|
675
|
+
end
|
676
|
+
|
677
|
+
##
|
678
|
+
## @brief Get the last entry
|
679
|
+
##
|
680
|
+
## @param opt (Hash) Additional Options
|
681
|
+
##
|
682
|
+
def last_entry(opt={})
|
683
|
+
opt[:section] ||= @current_section
|
684
|
+
|
685
|
+
sec_arr = []
|
686
|
+
|
687
|
+
if opt[:section].nil?
|
688
|
+
sec_arr = [@current_section]
|
689
|
+
elsif opt[:section].class == String
|
690
|
+
if opt[:section] =~ /^all$/i
|
691
|
+
combined = {'items' => []}
|
692
|
+
@content.each {|k,v|
|
693
|
+
combined['items'] += v['items']
|
694
|
+
}
|
695
|
+
items = combined['items'].dup.sort_by{|item| item['date'] }.reverse
|
696
|
+
sec_arr.push(items[0]['section'])
|
697
|
+
|
698
|
+
sec_arr = sections
|
699
|
+
else
|
700
|
+
sec_arr = [guess_section(opt[:section])]
|
701
|
+
end
|
702
|
+
end
|
703
|
+
|
704
|
+
|
705
|
+
all_items = []
|
706
|
+
sec_arr.each do |section|
|
707
|
+
all_items.concat(@content[section]['items'].dup) if @content.has_key?(section)
|
708
|
+
end
|
709
|
+
|
710
|
+
all_items.sort_by { |item| item['date'] }.last
|
711
|
+
end
|
712
|
+
|
657
713
|
##
|
658
714
|
## @brief Tag the last entry or X entries
|
659
715
|
##
|
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: 1.0.
|
4
|
+
version: 1.0.43
|
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-06-
|
11
|
+
date: 2021-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|