doing 1.0.41 → 1.0.42

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d5f05e62d0f437134960c918fba1c4031ab826dd83a6a976883cc9321d90a20
4
- data.tar.gz: 33656713df024f8229897fc76083b115473ddc693afb16edc8bcd1beed1429f1
3
+ metadata.gz: f715c083c72c609fb2e2fc8c730cca68b8391dccbc4ca2168333dd9b30df0887
4
+ data.tar.gz: 3d7df2ec9624ae8d2b6822ccceed402c42f82f2a5b2e010c639880c9cd95580f
5
5
  SHA512:
6
- metadata.gz: 65b55315b30066d8364818aa153cea3723398696e1695a4843d36bd0e7e71d0bd2c4ab89217f8266a39d42a7f4e54d9c03e38f135649110ed1f657ac320a5907
7
- data.tar.gz: 677350fc0b33333d17be84b4ee69f85235123f0b16f20372aa9dcc485804152d8cab7e9948f58fc416662a9695052f0e46a21027166cfa17fcf5b23e2e961956
6
+ metadata.gz: 4287daf5a4821ff6e295c36275d2101ecebefdc0adc962faefe82c460bd52f2e9a1a69e767e3ad59f7d68074a86807496e3e1669dd7f6f68688da903fb370309
7
+ data.tar.gz: 4a62305048b02bac186c63f951a6e3a7985663dc826070801c3a333b8e9388147435639910ac0f1fe24b0ad5a90e15b61510c0799ce94cf84060ca8fad097f0b
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.41'
2
+ VERSION = '1.0.42'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -1125,7 +1125,6 @@ class WWID
1125
1125
  }
1126
1126
  out = output.join("")
1127
1127
  elsif opt[:output] == "json" || opt[:output] == "timeline"
1128
-
1129
1128
  items_out = []
1130
1129
  max = items[-1]['date'].strftime('%F')
1131
1130
  min = items[0]['date'].strftime('%F')
@@ -1137,7 +1136,6 @@ class WWID
1137
1136
  title = i['title']
1138
1137
  note = i['note'].map { |line| line.strip } if i['note']
1139
1138
  end
1140
-
1141
1139
  if i['title'] =~ /@done\((\d{4}-\d\d-\d\d \d\d:\d\d.*?)\)/ && opt[:times]
1142
1140
  end_date = Time.parse($1)
1143
1141
  interval = get_interval(i,false)
@@ -1152,14 +1150,16 @@ class WWID
1152
1150
  tags.push(tag[0]) unless skip_tags.include?(tag[0])
1153
1151
  }
1154
1152
  if opt[:output] == "json"
1153
+
1155
1154
  items_out << {
1156
1155
  :date => i['date'],
1157
1156
  :end_date => end_date,
1158
1157
  :title => title.strip, #+ " #{note}"
1159
- :note => note.class == Array ? note.join("\n") : note,
1158
+ :note => note.class == Array ? note.map(&:strip).join("\n") : note,
1160
1159
  :time => "%02d:%02d:%02d" % fmt_time(interval),
1161
1160
  :tags => tags
1162
1161
  }
1162
+
1163
1163
  elsif opt[:output] == "timeline"
1164
1164
  new_item = {
1165
1165
  'id' => index + 1,
@@ -1280,7 +1280,7 @@ EOTEMPLATE
1280
1280
  end
1281
1281
 
1282
1282
  if (item.has_key?('note') && !item['note'].empty?) && @config[:include_notes]
1283
- note_lines = item['note'].delete_if{|line| line =~ /^\s*$/ }.map{|line| "\t" + line.sub(/^\t*/,'') + " " }
1283
+ note_lines = item['note'].delete_if{|line| line =~ /^\s*$/ }.map{|line| "\t\t" + line.sub(/^\t*/,'').sub(/^-/, '—') + " " }
1284
1284
  if opt[:wrap_width] && opt[:wrap_width] > 0
1285
1285
  width = opt[:wrap_width]
1286
1286
  note_lines.map! {|line|
@@ -1607,7 +1607,6 @@ EOTEMPLATE
1607
1607
  ## @param format (String) return format (html, json, or text)
1608
1608
  ##
1609
1609
  def tag_times(format="text", sort_by_name = false)
1610
-
1611
1610
  return "" if @timers.empty?
1612
1611
 
1613
1612
  max = @timers.keys.sort_by {|k| k.length }.reverse[0].length + 1
@@ -1799,6 +1798,10 @@ EOS
1799
1798
  if seconds.nil?
1800
1799
  return [0, 0, 0]
1801
1800
  end
1801
+ if seconds =~ /(\d+):(\d+):(\d+)/
1802
+ h, m, s = [$1, $2, $3]
1803
+ seconds = (h.to_i * 60 * 60) + (m.to_i * 60) + s.to_i
1804
+ end
1802
1805
  minutes = (seconds / 60).to_i
1803
1806
  hours = (minutes / 60).to_i
1804
1807
  days = (hours / 24).to_i
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.41
4
+ version: 1.0.42
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-05-24 00:00:00.000000000 Z
11
+ date: 2021-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake