doing 1.0.2pre → 1.0.6pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/bin/doing +35 -21
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +96 -35
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31cbf5627a0818d3252c9f75265372652b7b22df
|
4
|
+
data.tar.gz: 3c70bc7a7b81dd3ce0db6d0e291dd4d4cf45d29f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68287fcedc4d02dc46fa61e6587f4c3d7cf33f6727a9a03a9c155b9ecce63244deca08451be86be9d0c0260221d75b3478224c2c52edf538fc161a4bde191662
|
7
|
+
data.tar.gz: a20c0b2ff59f6125e7d5f0046034a3bc1825546d3f8c01b0b72600285325a0ef719e97f4ead9beafb9954ec82e465263636caf152b08c9f93d6f22bd885fa588
|
data/README.md
CHANGED
@@ -283,7 +283,9 @@ You can finish the last unfinished task when starting a new one using `doing now
|
|
283
283
|
|
284
284
|
`doing done` is used to add an entry that you've already completed. Like `now`, you can specify a section with `-s section_name`. You can also skip straight to Archive with `-a`.
|
285
285
|
|
286
|
-
|
286
|
+
`doing done` can also backdate entries using natural language with `--back 15m` or `--back "3/15 3pm"`. That will modify the starting timestamp of the entry. You can also use `--took 1h20m` or `--took 1:20` to set the finish date based on a "natural language" time interval. If `--took` is used without `--back`, then the start date is adjusted (`--took` interval is subtracted) so that the completion date is the current time.
|
287
|
+
|
288
|
+
When used with `doing done`, `--back` and `--took` allow time intervals to be accurately counted when entering items after the fact. `--took` is also available for the `doing finish` command, but cannot be used in conjunction with `--back`. (In `finish` they both set the end date, and neither has priority. `--back` allows specific days/times, `--took` uses time intervals.)
|
287
289
|
|
288
290
|
All of these commands accept a `-e` argument. This opens your command line editor as defined in the environment variable `$EDITOR`. Add your entry, save the temp file and close it, and the new entry will be added. Anything after the first line is included as a note on the entry.
|
289
291
|
|
@@ -299,7 +301,7 @@ All of these commands accept a `-e` argument. This opens your command line edito
|
|
299
301
|
|
300
302
|
`doing finish` also provides an `--auto` flag, which you can use to set the end time of any entry to 1 minute before the start time of the next. Running a command such as `doing finish --auto 10` will go through the last 10 entries and sequentially update any without a `@done` tag with one set to the time just before the next entry in the list.
|
301
303
|
|
302
|
-
As mentioned above, `finish` also accepts `--back "2 hours"` (sets the date from time now minus interval) or `--took 30m` (sets the date
|
304
|
+
As mentioned above, `finish` also accepts `--back "2 hours"` (sets the finish date from time now minus interval) or `--took 30m` (sets the finish date to time started plus interval) so you can accurately add times to completed tasks, even if you don't do it in the moment.
|
303
305
|
|
304
306
|
`tag` adds one or more tags to the last entry, or specify a count with `-c X`. Tags are specified as basic arguments, separated by spaces. For example:
|
305
307
|
|
@@ -382,6 +384,10 @@ Example: Archive all Currently items for @client that are marked @done
|
|
382
384
|
|
383
385
|
See the file `doing.completion.bash` in the git repository for full bash completion. Thanks to [fcrespo82](https://github.com/fcrespo82) for getting it [started](https://gist.github.com/fcrespo82/9609318).
|
384
386
|
|
387
|
+
### Zsh completion
|
388
|
+
|
389
|
+
See the file doing.completion.zsh in the git repository for zsh completion.
|
390
|
+
|
385
391
|
### Launchbar
|
386
392
|
|
387
393
|
The previous incarnation of `doing` had a [LaunchBar](http://obdev.at/launchbar/) action that I used frequently. The Day One popup has mostly replaced that for me, but only because I have a system that connects it to my WWID file. However, I've still found a place for adding WWID entries without including them in my journal, and LaunchBar is the perfect way to do that for me.
|
@@ -445,6 +451,11 @@ I'll try to document some of the code structure as I flesh it out. I'm currently
|
|
445
451
|
|
446
452
|
### Changelog
|
447
453
|
|
454
|
+
#### 1.0.4pre
|
455
|
+
|
456
|
+
* Improved HTML output
|
457
|
+
* --only_timed option for view/show commands that only outputs items with elapsed timers (interval between start and done dates)
|
458
|
+
|
448
459
|
#### 1.0.0pre
|
449
460
|
|
450
461
|
* Skipped ahead in the version numbering. Because I don't care.
|
data/bin/doing
CHANGED
@@ -16,7 +16,7 @@ wwid = WWID.new
|
|
16
16
|
program_desc 'A CLI for a What Was I Doing system'
|
17
17
|
|
18
18
|
default_command :recent
|
19
|
-
sort_help :manually
|
19
|
+
# sort_help :manually
|
20
20
|
|
21
21
|
desc 'Output notes if included in the template'
|
22
22
|
default_value true
|
@@ -272,10 +272,15 @@ command :done do |c|
|
|
272
272
|
c.default_value false
|
273
273
|
c.switch [:a,:archive], :negatable => false, :default_value => false
|
274
274
|
|
275
|
-
|
275
|
+
# TODO: Set @done date to specific time, backtracking start date in case of --took option. Should ignore --back option if present.
|
276
|
+
# c.desc 'Set finish date to specific date/time (natural langauge)'
|
277
|
+
# c.flag [:at]
|
278
|
+
|
279
|
+
c.desc 'Backdate start date by interval [4pm|20m|2h|yesterday noon]'
|
276
280
|
c.flag [:b,:back]
|
277
281
|
|
278
|
-
c.desc 'Set completion date to start date plus XX[mhd] or
|
282
|
+
c.desc 'Set completion date to start date plus interval (XX[mhd] or HH:MM)'
|
283
|
+
c.long_desc 'If used without the --back option, the start date will be moved back to allow the completion date to be the current time.'
|
279
284
|
c.flag [:t,:took]
|
280
285
|
|
281
286
|
c.desc 'Section'
|
@@ -291,17 +296,22 @@ command :done do |c|
|
|
291
296
|
# c.flag [:a,:app]
|
292
297
|
|
293
298
|
c.action do |global_options,options,args|
|
299
|
+
took = 0
|
300
|
+
|
301
|
+
if options[:took]
|
302
|
+
took = wwid.chronify_qty(options[:took])
|
303
|
+
raise "Unable to parse date string for --took" if took.nil?
|
304
|
+
end
|
305
|
+
|
294
306
|
if options[:back]
|
295
307
|
date = wwid.chronify(options[:back])
|
296
308
|
raise "Unable to parse date string for --back" if date.nil?
|
297
309
|
else
|
298
|
-
date = Time.now
|
310
|
+
date = options[:took] ? Time.now - took : Time.now
|
299
311
|
end
|
300
312
|
|
301
313
|
if options[:took]
|
302
|
-
|
303
|
-
finish_date = date + minutes
|
304
|
-
raise "Unable to parse date string for --took" if date.nil?
|
314
|
+
finish_date = date + took
|
305
315
|
else
|
306
316
|
finish_date = Time.now
|
307
317
|
end
|
@@ -495,6 +505,10 @@ command :show do |c|
|
|
495
505
|
c.default_value false
|
496
506
|
c.switch [:totals], :default_value => false, :negatable => true
|
497
507
|
|
508
|
+
c.desc 'Only show items with recorded time intervals'
|
509
|
+
c.default_value false
|
510
|
+
c.switch [:only_timed], :default_value => false, :negatable => false
|
511
|
+
|
498
512
|
c.action do |global_options,options,args|
|
499
513
|
tag_filter = false
|
500
514
|
tags = []
|
@@ -524,9 +538,7 @@ command :show do |c|
|
|
524
538
|
|
525
539
|
options[:t] = true if options[:totals]
|
526
540
|
|
527
|
-
puts wwid.list_section({:section => section, :count => options[:c].to_i, :tag_filter => tag_filter, :age => options[:a], :order => options[:s], :output => options[:output], :times => options[:t], :highlight => true})
|
528
|
-
|
529
|
-
puts wwid.tag_times if options[:totals]
|
541
|
+
puts wwid.list_section({:section => section, :count => options[:c].to_i, :tag_filter => tag_filter, :age => options[:a], :order => options[:s], :output => options[:output], :times => options[:t], :totals => options[:totals], :highlight => true, :only_timed => options[:only_timed]})
|
530
542
|
|
531
543
|
end
|
532
544
|
end
|
@@ -550,15 +562,18 @@ command :grep do |c|
|
|
550
562
|
c.default_value false
|
551
563
|
c.switch [:totals], :default_value => false, :negatable => true
|
552
564
|
|
565
|
+
c.desc 'Only show items with recorded time intervals'
|
566
|
+
c.default_value false
|
567
|
+
c.switch [:only_timed], :default_value => false, :negatable => false
|
568
|
+
|
553
569
|
c.action do |global_options,options,args|
|
554
570
|
|
555
571
|
section = wwid.guess_section(options[:s]) if options[:s]
|
556
572
|
|
557
573
|
options[:t] = true if options[:totals]
|
558
574
|
|
559
|
-
puts wwid.list_section({:search => args.join, :section => section, :output => options[:output], :times => options[:t], :highlight => true})
|
575
|
+
puts wwid.list_section({:search => args.join, :section => section, :output => options[:output], :times => options[:t], :highlight => true, :totals => options[:totals], :only_timed => options[:only_timed]})
|
560
576
|
|
561
|
-
puts wwid.tag_times if options[:totals]
|
562
577
|
end
|
563
578
|
end
|
564
579
|
|
@@ -590,9 +605,8 @@ command :recent do |c|
|
|
590
605
|
end
|
591
606
|
options[:t] = true if options[:totals]
|
592
607
|
|
593
|
-
puts wwid.recent(count,section.cap_first,{ :times => options[:t] })
|
608
|
+
puts wwid.recent(count,section.cap_first,{ :times => options[:t], :totals => options[:totals] })
|
594
609
|
|
595
|
-
puts wwid.tag_times if options[:totals]
|
596
610
|
end
|
597
611
|
end
|
598
612
|
end
|
@@ -614,9 +628,8 @@ command :today do |c|
|
|
614
628
|
|
615
629
|
options[:t] = true if options[:totals]
|
616
630
|
|
617
|
-
puts wwid.today(options[:t],options[:output]).chomp
|
631
|
+
puts wwid.today(options[:t],options[:output],{:totals => options[:totals]}).chomp
|
618
632
|
|
619
|
-
puts wwid.tag_times if options[:totals]
|
620
633
|
end
|
621
634
|
end
|
622
635
|
|
@@ -637,9 +650,8 @@ command :yesterday do |c|
|
|
637
650
|
|
638
651
|
c.action do |global_options, options,args|
|
639
652
|
section = args.length > 0 ? args.join(" ") : wwid.current_section
|
640
|
-
puts wwid.yesterday(section,options[:t],options[:o]).chomp
|
653
|
+
puts wwid.yesterday(section,options[:t],options[:o],{:totals => options[:totals]}).chomp
|
641
654
|
|
642
|
-
puts wwid.tag_times if options[:totals]
|
643
655
|
end
|
644
656
|
end
|
645
657
|
|
@@ -698,6 +710,10 @@ command :view do |c|
|
|
698
710
|
c.default_value false
|
699
711
|
c.switch [:totals], :default_value => false, :negatable => true
|
700
712
|
|
713
|
+
c.desc 'Only show items with recorded time intervals'
|
714
|
+
c.default_value false
|
715
|
+
c.switch [:only_timed], :default_value => false, :negatable => false
|
716
|
+
|
701
717
|
c.action do |global_options,options,args|
|
702
718
|
if args.empty?
|
703
719
|
title = wwid.choose_view
|
@@ -731,9 +747,7 @@ command :view do |c|
|
|
731
747
|
order = view.has_key?('order') ? view['order'] : "asc"
|
732
748
|
options[:t] = true if options[:totals]
|
733
749
|
options[:output].downcase! if options[:output]
|
734
|
-
puts wwid.list_section({:section => section, :count => count, :template => template, :format => format, :order => order, :tag_filter => tag_filter, :output => options[:output], :tags_color => tags_color, :times => options[:t], :highlight => true })
|
735
|
-
|
736
|
-
puts wwid.tag_times if options[:totals]
|
750
|
+
puts wwid.list_section({:section => section, :count => count, :template => template, :format => format, :order => order, :tag_filter => tag_filter, :output => options[:output], :tags_color => tags_color, :times => options[:t], :highlight => true, :totals => options[:totals], :only_timed => options[:only_timed] })
|
737
751
|
else
|
738
752
|
raise "View #{title} not found in config"
|
739
753
|
end
|
data/lib/doing/version.rb
CHANGED
data/lib/doing/wwid.rb
CHANGED
@@ -147,7 +147,11 @@ class WWID
|
|
147
147
|
end
|
148
148
|
|
149
149
|
def home_config
|
150
|
-
|
150
|
+
if Dir.respond_to?('home')
|
151
|
+
File.join(Dir.home, DOING_CONFIG_NAME)
|
152
|
+
else
|
153
|
+
File.join(File.expand_path("~"), DOING_CONFIG_NAME)
|
154
|
+
end
|
151
155
|
end
|
152
156
|
|
153
157
|
def read_config
|
@@ -586,7 +590,9 @@ class WWID
|
|
586
590
|
opt[:tag_filter] ||= false
|
587
591
|
opt[:tags_color] ||= false
|
588
592
|
opt[:times] ||= false
|
593
|
+
opt[:totals] ||= false
|
589
594
|
opt[:search] ||= false
|
595
|
+
opt[:only_timed] ||= false
|
590
596
|
|
591
597
|
# opt[:highlight] ||= true
|
592
598
|
section = ""
|
@@ -645,6 +651,12 @@ class WWID
|
|
645
651
|
}
|
646
652
|
end
|
647
653
|
|
654
|
+
if opt[:only_timed]
|
655
|
+
items.delete_if {|item|
|
656
|
+
get_interval(item) == "00:00:00"
|
657
|
+
}
|
658
|
+
end
|
659
|
+
|
648
660
|
if opt[:today]
|
649
661
|
items.delete_if {|item|
|
650
662
|
item['date'] < Date.today.to_time
|
@@ -673,14 +685,18 @@ class WWID
|
|
673
685
|
end
|
674
686
|
|
675
687
|
if opt[:output] == "csv"
|
676
|
-
output = [CSV.generate_line(['date','title','note'])]
|
688
|
+
output = [CSV.generate_line(['date','title','note','timer'])]
|
677
689
|
items.each {|i|
|
678
690
|
note = ""
|
679
691
|
if i['note']
|
680
692
|
arr = i['note'].map{|line| line.strip}.delete_if{|e| e =~ /^\s*$/}
|
681
693
|
note = arr.join("\n") unless arr.nil?
|
682
694
|
end
|
683
|
-
|
695
|
+
if i['title'] =~ /@done\((\d{4}-\d\d-\d\d \d\d:\d\d.*?)\)/ && opt[:times]
|
696
|
+
interval = get_interval(i, false)
|
697
|
+
end
|
698
|
+
interval ||= 0
|
699
|
+
output.push(CSV.generate_line([i['date'],i['title'],note,interval]))
|
684
700
|
}
|
685
701
|
out = output.join("")
|
686
702
|
elsif opt[:output] == "html"
|
@@ -699,13 +715,20 @@ class WWID
|
|
699
715
|
title = i['title']
|
700
716
|
note = i['note'].map { |line| line.strip }
|
701
717
|
end
|
718
|
+
|
719
|
+
if i['title'] =~ /@done\((\d{4}-\d\d-\d\d \d\d:\d\d.*?)\)/ && opt[:times]
|
720
|
+
interval = get_interval(i)
|
721
|
+
end
|
722
|
+
interval ||= false
|
723
|
+
|
702
724
|
items_out << {
|
703
725
|
:date => i['date'].strftime('%a %-I:%M%p'),
|
704
726
|
:title => title.gsub(/(@[^ \(]+(\(.*?\))?)/im,'<span class="tag">\1</span>').strip, #+ " #{note}"
|
705
|
-
:note => note
|
727
|
+
:note => note,
|
728
|
+
:time => interval
|
706
729
|
}
|
707
730
|
}
|
708
|
-
style = "body{background:#fff;color:#333;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:16px;line-height:120%;text-align:justify;padding:20px}h1{text-align:left;position:relative;left:220px;margin-bottom:1em}ul{list-style-position:outside;position:relative;left:170px;margin-right:170px;text-align:left}ul li{list-style-type:none;border-left:solid 1px #ccc;padding-left:10px;line-height:2}ul li .date{font-size:14px;position:absolute;left:-
|
731
|
+
style = "body{background:#fff;color:#333;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:16px;line-height:120%;text-align:justify;padding:20px}h1{text-align:left;position:relative;left:220px;margin-bottom:1em}ul{list-style-position:outside;position:relative;left:170px;margin-right:170px;text-align:left}ul li{list-style-type:none;border-left:solid 1px #ccc;padding-left:10px;line-height:2;position:relative}ul li .date{font-size:14px;position:absolute;left:-122px;color:#7d9ca2;text-align:right;width:110px;line-height:2}ul li .tag{color:#999}ul li .note{display:block;color:#666;padding:0 0 0 22px;line-height:1.4;font-size:15px}ul li .note:before{content:'\\25BA';font-weight:300;position:absolute;left:40px;font-size:8px;color:#aaa;line-height:3}ul li:hover .note{display:block}span.time{color:#729953;float:left;position:relative;padding:0 5px;font-size:15px;border-bottom:dashed 1px #ccc;text-align:right;background:#f9fced;margin-right:4px}table td{border-bottom:solid 1px #ddd;height:24px}caption{text-align:left;border-bottom:solid 1px #aaa;margin:10px 0}table{width:400px;margin:50px 0 0 211px}th{padding-bottom:10px}th,td{padding-right:20px}table{max-width:400px;margin:50px 0 0 221px}"
|
709
732
|
template =<<EOT
|
710
733
|
!!!
|
711
734
|
%html
|
@@ -723,11 +746,15 @@ class WWID
|
|
723
746
|
%li
|
724
747
|
%span.date= i[:date]
|
725
748
|
= i[:title]
|
749
|
+
- if i[:time] && i[:time] != "00:00:00"
|
750
|
+
%span.time= i[:time]
|
726
751
|
- if i[:note]
|
727
752
|
%span.note= i[:note].map{|n| n.strip }.join('<br>')
|
753
|
+
= @totals
|
728
754
|
EOT
|
755
|
+
totals = opt[:totals] ? tag_times("html") : ""
|
729
756
|
engine = Haml::Engine.new(template)
|
730
|
-
puts engine.render(Object.new, { :@items => items_out, :@page_title => page_title, :@style => style })
|
757
|
+
puts engine.render(Object.new, { :@items => items_out, :@page_title => page_title, :@style => style, :@totals => totals })
|
731
758
|
|
732
759
|
else
|
733
760
|
items.each {|item|
|
@@ -807,7 +834,7 @@ EOT
|
|
807
834
|
out += output + "\n"
|
808
835
|
}
|
809
836
|
end
|
810
|
-
|
837
|
+
out += tag_times if opt[:totals]
|
811
838
|
return out
|
812
839
|
end
|
813
840
|
|
@@ -947,22 +974,25 @@ EOT
|
|
947
974
|
list_section({:section => @current_section, :wrap_width => cfg['wrap_width'], :count => 0, :format => cfg['date_format'], :template => cfg['template'], :order => order})
|
948
975
|
end
|
949
976
|
|
950
|
-
def today(times=true,output=nil)
|
977
|
+
def today(times=true,output=nil,opt={})
|
978
|
+
opt[:totals] ||= false
|
951
979
|
cfg = @config['templates']['today']
|
952
|
-
list_section({:section => @current_section, :wrap_width => cfg['wrap_width'], :count => 0, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :today => true, :times => times, :output => output})
|
980
|
+
list_section({:section => @current_section, :wrap_width => cfg['wrap_width'], :count => 0, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :today => true, :times => times, :output => output, :totals => opt[:totals]})
|
953
981
|
end
|
954
982
|
|
955
|
-
def yesterday(section,times=nil,output=nil)
|
983
|
+
def yesterday(section,times=nil,output=nil,opt={})
|
984
|
+
opt[:totals] ||= false
|
956
985
|
section = guess_section(section)
|
957
|
-
list_section({:section => section, :count => 0, :order => "asc", :yesterday => true, :times => times, :output => output })
|
986
|
+
list_section({:section => section, :count => 0, :order => "asc", :yesterday => true, :times => times, :output => output, :totals => opt[:totals] })
|
958
987
|
end
|
959
988
|
|
960
989
|
def recent(count=10,section=nil,opt={})
|
961
990
|
times = opt[:t] || true
|
991
|
+
opt[:totals] ||= false
|
962
992
|
cfg = @config['templates']['recent']
|
963
993
|
section ||= @current_section
|
964
994
|
section = guess_section(section)
|
965
|
-
list_section({:section => section, :wrap_width => cfg['wrap_width'], :count => count, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :times => times })
|
995
|
+
list_section({:section => section, :wrap_width => cfg['wrap_width'], :count => count, :format => cfg['date_format'], :template => cfg['template'], :order => "asc", :times => times, :totals => opt[:totals] })
|
966
996
|
end
|
967
997
|
|
968
998
|
def last(times=true)
|
@@ -970,30 +1000,68 @@ EOT
|
|
970
1000
|
list_section({:section => @current_section, :wrap_width => cfg['wrap_width'], :count => 1, :format => cfg['date_format'], :template => cfg['template'], :times => times})
|
971
1001
|
end
|
972
1002
|
|
973
|
-
def tag_times
|
974
|
-
|
975
|
-
|
1003
|
+
def tag_times(format="text")
|
1004
|
+
|
1005
|
+
return "" if @timers.empty?
|
976
1006
|
|
977
1007
|
max = @timers.keys.sort_by {|k| k.length }.reverse[0].length + 1
|
978
1008
|
|
979
1009
|
total = @timers.delete("All")
|
980
1010
|
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
1011
|
+
if format == "html"
|
1012
|
+
output =<<EOS
|
1013
|
+
<table>
|
1014
|
+
<caption id="tagtotals">Tag Totals</caption>
|
1015
|
+
<colgroup>
|
1016
|
+
<col style="text-align:left;"/>
|
1017
|
+
<col style="text-align:left;"/>
|
1018
|
+
</colgroup>
|
1019
|
+
<thead>
|
1020
|
+
<tr>
|
1021
|
+
<th style="text-align:left;">project</th>
|
1022
|
+
<th style="text-align:left;">time</th>
|
1023
|
+
</tr>
|
1024
|
+
</thead>
|
1025
|
+
<tbody>
|
1026
|
+
EOS
|
1027
|
+
@timers.sort_by {|k,v|
|
1028
|
+
v
|
1029
|
+
}.reverse.each {|k,v|
|
1030
|
+
output += "<tr><td style='text-align:left;'>#{k}</td><td style='text-align:left;'>#{"%02d:%02d:%02d" % fmt_time(v)}</td></tr>\n" if v > 0
|
1031
|
+
}
|
1032
|
+
tail =<<EOS
|
1033
|
+
<tr>
|
1034
|
+
<td style="text-align:left;" colspan="2"></td>
|
1035
|
+
</tr>
|
1036
|
+
</tbody>
|
1037
|
+
<tfoot>
|
1038
|
+
<tr>
|
1039
|
+
<td style="text-align:left;"><strong>Total</strong></td>
|
1040
|
+
<td style="text-align:left;">#{"%02d:%02d:%02d" % fmt_time(total)}</td>
|
1041
|
+
</tr>
|
1042
|
+
</tfoot>
|
1043
|
+
</table>
|
1044
|
+
EOS
|
1045
|
+
output + tail
|
1046
|
+
else
|
1047
|
+
output = []
|
1048
|
+
@timers.delete_if { |k,v| v == 0}.sort_by{|k,v| v }.reverse.each {|k,v|
|
1049
|
+
spacer = ""
|
1050
|
+
(max - k.length).times do
|
1051
|
+
spacer += " "
|
1052
|
+
end
|
1053
|
+
output.push("#{k}:#{spacer}#{"%02d:%02d:%02d" % fmt_time(v)}")
|
1054
|
+
}
|
988
1055
|
|
989
|
-
|
990
|
-
|
991
|
-
|
1056
|
+
output = output.empty? ? "" : "\n--- Tag Totals ---\n" + output.join("\n")
|
1057
|
+
output += "\n\nTotal tracked: #{"%02d:%02d:%02d" % fmt_time(total)}\n"
|
1058
|
+
output
|
1059
|
+
end
|
992
1060
|
end
|
993
1061
|
|
994
1062
|
private
|
995
1063
|
|
996
|
-
def get_interval(item)
|
1064
|
+
def get_interval(item, formatted=true)
|
997
1065
|
done = nil
|
998
1066
|
start = nil
|
999
1067
|
|
@@ -1020,6 +1088,8 @@ EOT
|
|
1020
1088
|
end
|
1021
1089
|
}
|
1022
1090
|
|
1091
|
+
return seconds unless formatted
|
1092
|
+
|
1023
1093
|
"%02d:%02d:%02d" % fmt_time(seconds)
|
1024
1094
|
end
|
1025
1095
|
|
@@ -1032,12 +1102,3 @@ EOT
|
|
1032
1102
|
[days, hours, minutes]
|
1033
1103
|
end
|
1034
1104
|
end
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
# infile = "~/Dropbox/nvALT2.2/?? What was I doing.md"
|
1039
|
-
|
1040
|
-
# wwid = WWID.new(infile)
|
1041
|
-
|
1042
|
-
# wwid.add_item("Getting freaky with wwid CLI","Currently",{:date => Time.now})
|
1043
|
-
# wwid.write(infile)
|
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.6pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|