doing 1.0.46 → 1.0.47

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35a90bfcfe901ff215cddf7ce3f0f19734371c2934c08af6bf0263137320d7cc
4
- data.tar.gz: d791452d6e5235aaf2a04db3e485c57e56a99c84c65f61026f82fa0e6a56b04e
3
+ metadata.gz: 79bbbd412d3baf3354d88cb70c55aacf028e2260cfcb901bb0e66fac4ed4722a
4
+ data.tar.gz: 75e8f05005c05439aa3be05c51386745451ae83e8d1a3ec09aa9507286567864
5
5
  SHA512:
6
- metadata.gz: 2166a9ee774dc475e2f9d13c116ce7e1aaa550b0e454ce7ae47a6b950a855443a0c59d6a24ff87247aac28a88404314011a4d6420190fdf007b236a53dcac3e6
7
- data.tar.gz: f3ebed8c0f2ae40770fca5df63a2a7a680915aa57d0baf0046a2ffb50f3908914bfbb8ba46a38ad943e6fe0fc1bd8d4e92b39761212bf6285dbf70b385544d77
6
+ metadata.gz: e6fb1bb5d8f742bbd39232a4227361e47832968be2ffbc073eb454b6151f81222d91bbe062f4f430a03297d72d71562741915fd7cd0b8609d941e87774901308
7
+ data.tar.gz: 753d152c469b588f18545ef1bde93e5e8e0591b0b4f7558ed0bfc69e55041c37e6aa8c378ea61f1bd4b7a10d4081ff76f5ae0a1983db72ebd7a5f0d666d237be
data/README.md CHANGED
@@ -393,10 +393,11 @@ Note that you can include a tag with synonyms in the whitelist as well to tag it
393
393
 
394
394
  #### Adding entries:
395
395
 
396
- now, did - Add an entry
397
- later - Add an item to the Later section
398
- done - Add a completed item with @done(date). No argument finishes last entry.
399
- meanwhile - Finish any @meanwhile tasks and optionally create a new one
396
+ now, did - Add an entry
397
+ later - Add an item to the Later section
398
+ done - Add a completed item with @done(date). No argument finishes last entry.
399
+ meanwhile - Finish any @meanwhile tasks and optionally create a new one
400
+ again, resume - Duplicate the last entry as new entry (without @done tag)
400
401
 
401
402
  The `doing now` command can accept `-s section_name` to send the new entry straight to a non-default section. It also accepts `--back=AMOUNT` to let you specify a start date in the past using "natural language." For example, `doing now --back=25m ENTRY` or `doing now --back="yesterday 3:30pm" ENTRY`.
402
403
 
data/bin/doing CHANGED
@@ -44,7 +44,7 @@ default_value false
44
44
  switch [:stdout], :default_value => false, :negatable => false
45
45
 
46
46
  desc 'Exclude auto tags and default tags'
47
- switch [:x,:noauto], :default_value => false
47
+ switch [:x, :noauto], :default_value => false
48
48
 
49
49
  desc 'Use a specific configuration file'
50
50
  default_value false
@@ -52,37 +52,37 @@ flag [:config_file]
52
52
 
53
53
 
54
54
  # desc 'Wrap notes at X chars (0 for no wrap)'
55
- # flag [:w,:wrapwidth], :must_match => /^\d+$/, :type => Integer
55
+ # flag [:w, :wrapwidth], :must_match => /^\d+$/, :type => Integer
56
56
 
57
57
  desc 'Specify a different doing_file'
58
58
  flag [:f, :doing_file]
59
59
 
60
60
  desc 'Add an entry'
61
61
  arg_name 'entry'
62
- command [:now,:next] do |c|
62
+ command [:now, :next] do |c|
63
63
  c.desc 'Section'
64
64
  c.arg_name 'section_name'
65
65
  c.default_value wwid.current_section
66
- c.flag [:s,:section], :default_value => wwid.current_section
66
+ c.flag [:s, :section], :default_value => wwid.current_section
67
67
 
68
68
  c.desc "Edit entry with #{ENV['EDITOR']}"
69
- c.switch [:e,:editor]
69
+ c.switch [:e, :editor]
70
70
 
71
71
  c.desc 'Backdate start time [4pm|20m|2h|yesterday noon]'
72
- c.flag [:back]
72
+ c.flag [:b, :back]
73
73
 
74
74
  c.desc 'Timed entry, marks last entry in section as @done'
75
75
  c.default_value false
76
- c.switch [:f,:finish_last], :negatable => false, :default_value => false
76
+ c.switch [:f, :finish_last], :negatable => false, :default_value => false
77
77
 
78
78
  c.desc 'Note'
79
79
  c.arg_name 'note_text'
80
- c.flag [:n,:note]
80
+ c.flag [:n, :note]
81
81
 
82
82
  # c.desc "Edit entry with specified app"
83
83
  # c.arg_name 'editor_app'
84
84
  # c.default_value wwid.config.has_key?('editor_app') && wwid.config['editor_app'] ? wwid.config['editor_app'] : false
85
- # c.flag [:a,:app]
85
+ # c.flag [:a, :app]
86
86
 
87
87
  c.action do |global_options,options,args|
88
88
  if options[:back]
@@ -206,7 +206,7 @@ command :meanwhile do |c|
206
206
  c.switch [:a, :archive], :default_value => false
207
207
 
208
208
  c.desc 'Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]'
209
- c.flag [:back]
209
+ c.flag [:b, :back]
210
210
 
211
211
  c.desc 'Note'
212
212
  c.arg_name 'note_text'
@@ -280,7 +280,7 @@ command :later do |c|
280
280
  c.flag [:a, :app]
281
281
 
282
282
  c.desc 'Backdate start time to date string [4pm|20m|2h|yesterday noon]'
283
- c.flag [:back]
283
+ c.flag [:b, :back]
284
284
 
285
285
  c.desc 'Note'
286
286
  c.arg_name 'note_text'
@@ -327,14 +327,14 @@ end
327
327
 
328
328
  desc 'Add a completed item with @done(date). No argument finishes last entry.'
329
329
  arg_name 'entry'
330
- command [:done,:did] do |c|
330
+ command [:done, :did] do |c|
331
331
  c.desc 'Remove @done tag'
332
332
  c.default_value false
333
333
  c.switch [:r, :remove], :negatable => false, :default_value => false
334
334
 
335
335
  c.desc 'Include date'
336
336
  c.default_value true
337
- c.switch [:d, :date], :negatable => true, :default_value => true
337
+ c.switch [:date], :negatable => true, :default_value => true
338
338
 
339
339
  c.desc 'Immediately archive the entry'
340
340
  c.default_value false
@@ -351,15 +351,15 @@ command [:done,:did] do |c|
351
351
 
352
352
  c.desc 'Section'
353
353
  c.default_value wwid.current_section
354
- c.flag [:s,:section], :default_value => wwid.current_section
354
+ c.flag [:s, :section], :default_value => wwid.current_section
355
355
 
356
356
  c.desc "Edit entry with #{ENV['EDITOR']}"
357
- c.switch [:e,:editor]
357
+ c.switch [:e, :editor]
358
358
 
359
359
  # c.desc "Edit entry with specified app"
360
360
  # c.arg_name 'editor_app'
361
361
  # c.default_value wwid.config.has_key?('editor_app') && wwid.config['editor_app'] ? wwid.config['editor_app'] : false
362
- # c.flag [:a,:app]
362
+ # c.flag [:a, :app]
363
363
 
364
364
  c.action do |global_options,options,args|
365
365
  took = 0
@@ -438,14 +438,13 @@ long_desc 'Marks the last X entries with a @done tag and current date. Does not
438
438
  arg_name 'count'
439
439
  command :finish do |c|
440
440
  c.desc 'Include date'
441
- c.default_value true
442
- c.switch [:d,:date], :default_value => true
441
+ c.switch [:date], :negatable => true, :default_value => true
443
442
 
444
443
  c.desc 'Backdate completed date to date string [4pm|20m|2h|yesterday noon]'
445
- c.flag [:b,:back]
444
+ c.flag [:b, :back]
446
445
 
447
446
  c.desc 'Set the completed date to the start date plus XX[hmd]'
448
- c.flag [:t,:took]
447
+ c.flag [:t, :took]
449
448
 
450
449
  c.desc 'Auto-generate finish dates from next entry\'s start time. Automatically generate completion dates 1 minute before next start date. --auto overrides the --date and --back parameters.'
451
450
  c.default_value false
@@ -453,11 +452,11 @@ command :finish do |c|
453
452
 
454
453
  c.desc 'Archive entries'
455
454
  c.default_value false
456
- c.switch [:a,:archive], :negatable => false, :default_value => false
455
+ c.switch [:a, :archive], :negatable => false, :default_value => false
457
456
 
458
457
  c.desc 'Section'
459
458
  c.default_value wwid.current_section
460
- c.flag [:s,:section], :default_value => wwid.current_section
459
+ c.flag [:s, :section], :default_value => wwid.current_section
461
460
 
462
461
  c.action do |global_options,options,args|
463
462
 
@@ -490,13 +489,13 @@ end
490
489
 
491
490
  desc 'Repeat last entry as new entry'
492
491
  arg_name 'section'
493
- command [:again,:resume] do |c|
492
+ command [:again, :resume] do |c|
494
493
  c.desc 'Section'
495
494
  c.flag [:s, :section], :default_value => "All"
496
495
 
497
496
  c.desc 'Note'
498
497
  c.arg_name 'note_text'
499
- c.flag [:n,:note]
498
+ c.flag [:n, :note]
500
499
 
501
500
  c.action do |global_options, options, args|
502
501
  wwid.restart_last({ section: options[:s], note: options[:n] })
@@ -570,14 +569,14 @@ command :tag do |c|
570
569
  end
571
570
 
572
571
  desc 'Mark last entry as highlighted'
573
- command [:mark,:flag] do |c|
572
+ command [:mark, :flag] do |c|
574
573
  c.desc 'Section'
575
574
  c.default_value wwid.current_section
576
- c.flag [:s,:section], :default_value => wwid.current_section
575
+ c.flag [:s, :section], :default_value => wwid.current_section
577
576
 
578
577
  c.desc 'Remove mark'
579
578
  c.default_value false
580
- c.switch [:r,:remove], :negatable => false, :default_value => false
579
+ c.switch [:r, :remove], :negatable => false, :default_value => false
581
580
 
582
581
 
583
582
  c.action do |global_options,options,args|
@@ -592,28 +591,30 @@ arg_name '[section|@tags]'
592
591
  command :show do |c|
593
592
  c.desc 'Tag boolean (AND,OR,NONE)'
594
593
  c.default_value "OR"
595
- c.flag [:b,:bool], :default_value => "OR"
594
+ c.flag [:b, :bool], :default_value => "OR"
596
595
 
597
596
  c.desc 'Max count to show'
598
597
  c.default_value 0
599
- c.flag [:c,:count], :default_value => 0
598
+ c.flag [:c, :count], :default_value => 0
600
599
 
601
600
  c.desc 'Age (oldest/newest)'
602
601
  c.default_value 'newest'
603
- c.flag [:a,:age], :default_value => 'newest'
602
+ c.flag [:a, :age], :default_value => 'newest'
604
603
 
605
604
  c.desc 'Sort order (asc/desc)'
606
605
  c.default_value 'asc'
607
- c.flag [:s,:sort], :default_value => 'asc'
606
+ c.flag [:s, :sort], :default_value => 'asc'
608
607
 
609
608
  c.desc %{
610
- Date range to show, or a single day to filter date on. Date range argument should be quoted. Date specifications can be natural language. To specify a range, use "to," or "through,". Example `doing show --from "monday to friday"`
609
+ Date range to show, or a single day to filter date on.
610
+ Date range argument should be quoted. Date specifications can be natural language.
611
+ To specify a range, use "to" or "through": `doing show --from "monday to friday"`
611
612
  }
612
- c.flag [:f,:from]
613
+ c.flag [:f, :from]
613
614
 
614
615
  c.desc 'Show time intervals on @done tasks'
615
616
  c.default_value true
616
- c.switch [:t,:times], :default_value => true
617
+ c.switch [:t, :times], :default_value => true
617
618
 
618
619
  c.desc 'Show intervals with totals at the end of output'
619
620
  c.default_value false
@@ -631,7 +632,7 @@ command :show do |c|
631
632
  c.switch [:only_timed], :default_value => false, :negatable => false
632
633
 
633
634
  c.desc 'Output to export format (csv|html|json)'
634
- c.flag [:o,:output]
635
+ c.flag [:o, :output]
635
636
  c.action do |global_options,options,args|
636
637
 
637
638
  tag_filter = false
@@ -696,19 +697,24 @@ command :show do |c|
696
697
  end
697
698
 
698
699
  desc 'Search for entries'
699
- long_desc 'Search all sections (or limit to a single section) for entries matching text or regular expression. Normal strings are fuzzy matched, delineate regex with /expression/'
700
+ long_desc <<-'EODESC'
701
+ Search all sections (or limit to a single section) for entries matching text or regular expression. Normal strings are fuzzy matched.
702
+
703
+ To search with regular expressions, single quote the string and surround with slashes: `doing search '/\bm.*?x\b/'`
704
+ EODESC
705
+
700
706
  arg_name 'search_pattern'
701
- command [:grep,:search] do |c|
707
+ command [:grep, :search] do |c|
702
708
  c.desc 'Section'
703
709
  c.default_value "all"
704
- c.flag [:s,:section], :default_value => "All"
710
+ c.flag [:s, :section], :default_value => "All"
705
711
 
706
712
  c.desc 'Output to export format (csv|html|json)'
707
- c.flag [:o,:output]
713
+ c.flag [:o, :output]
708
714
 
709
715
  c.desc 'Show time intervals on @done tasks'
710
716
  c.default_value true
711
- c.switch [:t,:times], :default_value => true
717
+ c.switch [:t, :times], :default_value => true
712
718
 
713
719
  c.desc 'Show intervals with totals at the end of output'
714
720
  c.default_value false
@@ -743,11 +749,11 @@ arg_name 'count'
743
749
  command :recent do |c|
744
750
  c.desc 'Section'
745
751
  c.default_value "All"
746
- c.flag [:s,:section], :default_value => "All"
752
+ c.flag [:s, :section], :default_value => "All"
747
753
 
748
754
  c.desc 'Show time intervals on @done tasks'
749
755
  c.default_value true
750
- c.switch [:t,:times], :default_value => true
756
+ c.switch [:t, :times], :default_value => true
751
757
 
752
758
  c.desc 'Show intervals with totals at the end of output'
753
759
  c.default_value false
@@ -784,11 +790,11 @@ command :today do |c|
784
790
  c.desc 'Specify a section'
785
791
  c.arg_name 'section_name'
786
792
  c.default_value "All"
787
- c.flag [:s,:section], :default_value => 'All'
793
+ c.flag [:s, :section], :default_value => 'All'
788
794
 
789
795
  c.desc 'Show time intervals on @done tasks'
790
796
  c.default_value true
791
- c.switch [:t,:times], :default_value => true
797
+ c.switch [:t, :times], :default_value => true
792
798
 
793
799
  c.desc 'Show time totals at the end of output'
794
800
  c.default_value false
@@ -802,7 +808,7 @@ command :today do |c|
802
808
  c.flag [:tag_sort], :default_value => default
803
809
 
804
810
  c.desc 'Output to export format (csv|html|json)'
805
- c.flag [:o,:output]
811
+ c.flag [:o, :output]
806
812
 
807
813
  c.action do |global_options,options,args|
808
814
 
@@ -821,11 +827,11 @@ command :on do |c|
821
827
  c.desc 'Section'
822
828
  c.arg_name 'section_name'
823
829
  c.default_value 'All'
824
- c.flag [:s,:section], :default_value => 'All'
830
+ c.flag [:s, :section], :default_value => 'All'
825
831
 
826
832
  c.desc 'Show time intervals on @done tasks'
827
833
  c.default_value true
828
- c.switch [:t,:times], :default_value => true
834
+ c.switch [:t, :times], :default_value => true
829
835
 
830
836
  c.desc 'Show time totals at the end of output'
831
837
  c.default_value false
@@ -839,7 +845,7 @@ command :on do |c|
839
845
  c.flag [:tag_sort], :default_value => default
840
846
 
841
847
  c.desc 'Output to export format (csv|html|json)'
842
- c.flag [:o,:output]
848
+ c.flag [:o, :output]
843
849
 
844
850
  c.action do |global_options,options,args|
845
851
 
@@ -873,14 +879,14 @@ command :yesterday do |c|
873
879
  c.desc 'Specify a section'
874
880
  c.arg_name 'section_name'
875
881
  c.default_value "All"
876
- c.flag [:s,:section], :default_value => 'All'
882
+ c.flag [:s, :section], :default_value => 'All'
877
883
 
878
884
  c.desc 'Output to export format (csv|html|json)'
879
- c.flag [:o,:output]
885
+ c.flag [:o, :output]
880
886
 
881
887
  c.desc 'Show time intervals on @done tasks'
882
888
  c.default_value true
883
- c.switch [:t,:times], :default_value => true
889
+ c.switch [:t, :times], :default_value => true
884
890
 
885
891
  c.desc 'Show time totals at the end of output'
886
892
  c.default_value false
@@ -904,7 +910,7 @@ desc 'Show the last entry'
904
910
  command :last do |c|
905
911
  c.desc 'Specify a section'
906
912
  c.default_value "All"
907
- c.flag [:s,:section]
913
+ c.flag [:s, :section]
908
914
 
909
915
  c.action do |global_options,options,args|
910
916
  puts wwid.last(true,options[:s]).strip
@@ -915,7 +921,7 @@ desc 'List sections'
915
921
  command :sections do |c|
916
922
  c.desc 'List in single column'
917
923
  c.default_value false
918
- c.switch [:c,:column], :default_value => false
924
+ c.switch [:c, :column], :default_value => false
919
925
 
920
926
  c.action do |global_options,options,args|
921
927
  joiner = options[:c] ? "\n" : "\t"
@@ -966,17 +972,17 @@ desc 'Display a user-created view'
966
972
  arg_name 'view_name'
967
973
  command :view do |c|
968
974
  c.desc 'Section (override view settings)'
969
- c.flag [:s,:section]
975
+ c.flag [:s, :section]
970
976
 
971
977
  c.desc 'Count to display (override view settings)'
972
- c.flag [:c,:count], :must_match => /^\d+$/, :type => Integer
978
+ c.flag [:c, :count], :must_match => /^\d+$/, :type => Integer
973
979
 
974
980
  c.desc 'Output to export format (csv|html|json)'
975
- c.flag [:o,:output]
981
+ c.flag [:o, :output]
976
982
 
977
983
  c.desc 'Show time intervals on @done tasks'
978
984
  c.default_value true
979
- c.switch [:t,:times], :default_value => true
985
+ c.switch [:t, :times], :default_value => true
980
986
 
981
987
  c.desc 'Show intervals with totals at the end of output'
982
988
  c.default_value false
@@ -1054,7 +1060,7 @@ desc 'List available custom views'
1054
1060
  command :views do |c|
1055
1061
  c.desc 'List in single column'
1056
1062
  c.default_value false
1057
- c.switch [:c,:column], :default_value => false
1063
+ c.switch [:c, :column], :default_value => false
1058
1064
 
1059
1065
  c.action do |global_options,options,args|
1060
1066
  joiner = options[:c] ? "\n" : "\t"
@@ -1068,15 +1074,15 @@ default_value wwid.current_section
1068
1074
  command :archive do |c|
1069
1075
  c.desc 'Count to keep (ignored if archiving by tag)'
1070
1076
  c.default_value 5
1071
- c.flag [:k,:keep], :default_value => 5, :must_match => /^\d+$/, :type => Integer
1077
+ c.flag [:k, :keep], :default_value => 5, :must_match => /^\d+$/, :type => Integer
1072
1078
 
1073
1079
  c.desc 'Move entries to'
1074
1080
  c.default_value "Archive"
1075
- c.flag [:t,:to], :default_value => "Archive"
1081
+ c.flag [:t, :to], :default_value => "Archive"
1076
1082
 
1077
1083
  c.desc 'Tag boolean'
1078
1084
  c.default_value "AND"
1079
- c.flag [:b,:bool], :default_value => "AND"
1085
+ c.flag [:b, :bool], :default_value => "AND"
1080
1086
 
1081
1087
  c.action do |global_options,options,args|
1082
1088
  if args.length > 0
@@ -1145,7 +1151,7 @@ desc 'Edit the configuration file'
1145
1151
  command :config do |c|
1146
1152
  c.desc 'Editor to use'
1147
1153
  c.default_value ENV['EDITOR']
1148
- c.flag [:e,:editor], :default_value => nil
1154
+ c.flag [:e, :editor], :default_value => nil
1149
1155
 
1150
1156
  if `uname` =~ /Darwins/
1151
1157
  c.desc 'Application to use'
@@ -1184,7 +1190,7 @@ desc 'Undo the last change to the doing_file'
1184
1190
  command :undo do |c|
1185
1191
  c.desc 'Specify alternate doing file'
1186
1192
  c.default_value wwid.doing_file
1187
- c.flag [:f,:file], :default_value => wwid.doing_file
1193
+ c.flag [:f, :file], :default_value => wwid.doing_file
1188
1194
 
1189
1195
  c.action do |global_options,options,args|
1190
1196
  file = options[:f] || wwid.doing_file
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.46'
2
+ VERSION = '1.0.47'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
3
  require 'deep_merge'
4
+ require 'open3'
4
5
 
5
6
  ##
6
7
  ## @brief String helpers
@@ -644,6 +645,7 @@ class WWID
644
645
  end
645
646
  # Remove @done tag
646
647
  title = last['title'].sub(/\s*@done(\(.*?\))?/, '').chomp
648
+ @auto_tag = false
647
649
  add_item(title, last['section'], { note: opt[:note], back: opt[:date], timed: true })
648
650
  write(@doing_file)
649
651
  end
@@ -931,10 +933,10 @@ class WWID
931
933
  end
932
934
 
933
935
  if @config.key?('run_after')
934
- script = File.expand_path(@config['run_after'])
935
- if File.exist?(script)
936
- # warn "Running #{script}"
937
- `#{script}`
936
+ stdout, stderr, status = Open3.capture3(@config['run_after'])
937
+ if status.exitstatus.positive?
938
+ warn "Error running #{@config['run_after']}"
939
+ warn stderr
938
940
  end
939
941
  end
940
942
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.46
4
+ version: 1.0.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra