doing 1.0.61 → 1.0.62

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: 406fa23f47c83c1b9b3c8fa1cd0e193761c0b13e7ec31f75fdf43b1375769d18
4
- data.tar.gz: 2c7f30f6acfac0fb33266dd62ce204099c0358cef88e19de8f26c9e9a4f866f2
3
+ metadata.gz: 9e2384e06e56e40f7f6c2b26121d16e0caa2cf40639158fc0f079f8ae26738da
4
+ data.tar.gz: 9e62f0ac38c0f19082094b88382e9779b743a4885403d796dddfb21a68ea1de2
5
5
  SHA512:
6
- metadata.gz: 547c64a9fbfdb026a0ecaf1b4b0ae203306907ddbdc7cff76062b82312293e36eb170b8874f3aa643e19a8f2d3310aea472f23b12128b7b9eeb300956210ca68
7
- data.tar.gz: 37d3819348c3167b6c77a34f8e7e2311015c3975e8595303e04c1d89cb28d7d8a83d7dfea810440b846621d90fd8e7bd1538dd9e3f607a2002284d1405474de8
6
+ metadata.gz: 8cdb34a404ae818f10ee9facaba83fd44c584d06950fd2908b6fbb25b04e6a117a74a20836b765a2dca1cde480928398a42b5999e1678499013cbb1e88e5ccac
7
+ data.tar.gz: 5a771f4ba236518f54cd11bc99f1258b90026afe4face70db83e98f5f5ee97124eab732c7c65ccd61f1b98e18129c4034ea6c036c145e45abe298f058e25bc3e
data/README.md CHANGED
@@ -29,7 +29,7 @@ _Side note:_ I actually use the library behind this utility as part of another s
29
29
 
30
30
  ## Installation
31
31
 
32
- The current version of `doing` is <!--VER-->1.0.60<!--END VER-->.
32
+ The current version of `doing` is <!--VER-->1.0.61<!--END VER-->.
33
33
 
34
34
  $ [sudo] gem install doing
35
35
 
@@ -167,7 +167,7 @@ The config also contains templates for various command outputs. Include placehol
167
167
  - there are some random special combo colors. Use `doing colors` to see the list
168
168
  - `%interval`: when used with the `-t` switch on the `show` command, it will display the time between a timestamp or _@start(date)_ tag and the _@done(date)_ tag, if it exists. Otherwise, it will remain empty.
169
169
 
170
- Date formats are based on Ruby [`strftime`](http://www.ruby-doc.org/stdlib-2.1.1/libdoc/date/rdoc/Date.html#method-i-strftime) formatting.
170
+ Date formats are based on Ruby [`strftime`](http://www.ruby-doc.org/stdlib-2.1.1/libdoc/date/rdoc/Date.html#method-i-strftime) formatting. You can try it out [here](http://strftime.net).
171
171
 
172
172
  My normal template for the `recent` command looks like this:
173
173
 
data/bin/doing CHANGED
@@ -310,7 +310,7 @@ end
310
310
 
311
311
  desc 'Add a completed item with @done(date). No argument finishes last entry.'
312
312
  arg_name 'ENTRY'
313
- command [:done, :did] do |c|
313
+ command %i[done did] do |c|
314
314
  c.desc 'Remove @done tag'
315
315
  c.switch %i[r remove], negatable: false, default_value: false
316
316
 
@@ -367,7 +367,7 @@ command [:done, :did] do |c|
367
367
 
368
368
  date = options[:took] ? finish_date - took : finish_date
369
369
  elsif options[:took]
370
- finish_date = date + took
370
+ finish_date = options[:back] ? date + took : nil
371
371
  elsif options[:back]
372
372
  finish_date = date
373
373
  else
@@ -375,7 +375,9 @@ command [:done, :did] do |c|
375
375
  end
376
376
 
377
377
  section = wwid.guess_section(options[:s]) || options[:s].cap_first
378
- donedate = options[:date] ? "(#{finish_date.strftime('%F %R')})" : ''
378
+ if finish_date
379
+ donedate = options[:date] ? "(#{finish_date.strftime('%F %R')})" : ''
380
+ end
379
381
 
380
382
  if options[:e]
381
383
  raise 'No EDITOR variable defined in environment' if ENV['EDITOR'].nil?
@@ -394,8 +396,15 @@ command [:done, :did] do |c|
394
396
  if options[:r]
395
397
  wwid.tag_last({ tags: ['done'], count: 1, section: section, remove: true })
396
398
  else
397
- wwid.tag_last({ tags: ['done'], count: 1, section: section, archive: options[:a], back: finish_date,
398
- date: options[:date] })
399
+ options = { tags: ['done'],
400
+ archive: options[:a],
401
+ back: finish_date,
402
+ count: 1,
403
+ date: options[:date],
404
+ section: section,
405
+ took: took == 0 ? nil : took
406
+ }
407
+ wwid.tag_last(options)
399
408
  end
400
409
  elsif !args.empty?
401
410
  title, note = wwid.format_input(args.join(' '))
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.61'
2
+ VERSION = '1.0.62'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -776,6 +776,7 @@ class WWID
776
776
  opt[:remove] ||= false
777
777
  opt[:autotag] ||= false
778
778
  opt[:back] ||= false
779
+ opt[:took] ||= nil
779
780
 
780
781
  sec_arr = []
781
782
 
@@ -833,6 +834,8 @@ class WWID
833
834
  else
834
835
  done_date = item['date'] + (opt[:back] - item['date'])
835
836
  end
837
+ elsif opt[:took]
838
+ done_date = item['date'] + opt[:took]
836
839
  else
837
840
  done_date = Time.now
838
841
  end
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.61
4
+ version: 1.0.62
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-07-07 00:00:00.000000000 Z
11
+ date: 2021-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake