File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
module Doing
2
- VERSION = '1.0.22 '
2
+ VERSION = '1.0.23 '
3
3
end
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ def initialize
52
52
@content = { }
53
53
@doingrc_needs_update = false
54
54
@default_config_file = '.doingrc'
55
+ @interval_cache = { }
55
56
end
56
57
57
58
##
@@ -1647,6 +1648,11 @@ def get_interval(item, formatted=true)
1647
1648
done = nil
1648
1649
start = nil
1649
1650
1651
+ if @interval_cache . keys . include? item [ 'title' ]
1652
+ seconds = @interval_cache [ item [ 'title' ] ]
1653
+ return seconds > 0 ? "%02d:%02d:%02d" % fmt_time ( seconds ) : false
1654
+ end
1655
+
1650
1656
if item [ 'title' ] =~ /@done\( (\d {4}-\d \d -\d \d \d \d :\d \d .*?)\) /
1651
1657
done = Time . parse ( $1)
1652
1658
else
@@ -1670,6 +1676,8 @@ def get_interval(item, formatted=true)
1670
1676
end
1671
1677
}
1672
1678
1679
+ @interval_cache [ item [ 'title' ] ] = seconds
1680
+
1673
1681
return seconds unless formatted
1674
1682
1675
1683
seconds > 0 ? "%02d:%02d:%02d" % fmt_time ( seconds ) : false
You can’t perform that action at this time.
0 commit comments