doing 1.0.62 → 1.0.63

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: 9e2384e06e56e40f7f6c2b26121d16e0caa2cf40639158fc0f079f8ae26738da
4
- data.tar.gz: 9e62f0ac38c0f19082094b88382e9779b743a4885403d796dddfb21a68ea1de2
3
+ metadata.gz: c103e507e82866174c88e6c3613f613964eaacba5f499631598b9ecbbb0cbe55
4
+ data.tar.gz: edb32425ba3e81c1e3ff5bfeed3d0cb0b2dd8c2a353bc3d6adee6b98bf3536e0
5
5
  SHA512:
6
- metadata.gz: 8cdb34a404ae818f10ee9facaba83fd44c584d06950fd2908b6fbb25b04e6a117a74a20836b765a2dca1cde480928398a42b5999e1678499013cbb1e88e5ccac
7
- data.tar.gz: 5a771f4ba236518f54cd11bc99f1258b90026afe4face70db83e98f5f5ee97124eab732c7c65ccd61f1b98e18129c4034ea6c036c145e45abe298f058e25bc3e
6
+ metadata.gz: 20b03da63cba70b6c12a2f7775429f974fba8bc12b5f7c411d7a8e4a765f6c3113d3a627cf96684e4fbdb26c1b0430e0beec196cd0d2f655dd4459ba10b0902f
7
+ data.tar.gz: 934a87ead078f5fa7d2b7260921bfdeb15a57ecddd7a793003ad7dabb5dbf5bc093c1048258ffaba41e0ad00f5d49ab26cbdb825cca5e7f21c30446d92e3b10e
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.61<!--END VER-->.
32
+ The current version of `doing` is <!--VER-->1.0.62<!--END VER-->.
33
33
 
34
34
  $ [sudo] gem install doing
35
35
 
@@ -394,24 +394,41 @@ Note that you can include a tag with synonyms in the whitelist as well to tag it
394
394
 
395
395
  #### Adding entries:
396
396
 
397
- now, did - Add an entry
397
+ now, next - Add an entry
398
398
  later - Add an item to the Later section
399
- done - Add a completed item with @done(date). No argument finishes last entry.
399
+ done, did - Add a completed item with @done(date). No argument finishes last entry.
400
400
  meanwhile - Finish any @meanwhile tasks and optionally create a new one
401
401
  again, resume - Duplicate the last entry as new entry (without @done tag)
402
402
 
403
- 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`.
403
+ ##### now
404
404
 
405
- If you want to use `--back` with `doing done` but want the end time to be different than the start time, you can either use `--took` in addition, or just use `--took` on its own as it will backdate the start time such that the end time is now and the duration is equal to the value of the `--took` argument.
405
+ The `doing now` command adds an entry to the "Currently" section by default. It accepts `-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`.
406
406
 
407
407
  You can finish the last unfinished task when starting a new one using `doing now` with the `-f` switch. It will look for the last task not marked _@done_ and add the _@done_ tag with the start time of the new task (either the current time or what you specified with `--back`).
408
408
 
409
- `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`.
409
+ > __Examples:__
410
+ >
411
+ > - `doing now Working on project X` --- Add a new entry at the current time
412
+ > - `doing now --section=Projects Working on @projectX` --- Add a new entry to a section titled "Projects"
413
+ > - `doing now --back 30m` --- Add a new entry with a backdated start time, indicating you've been working on it for 30 minutes already
414
+ > - `doing now --back 8am` --- Backdate a new entry to a specific time
415
+ > - `doing now -f Starting the next thing` --- Add a new entry at the current time, and add a @done tag to the previous item with the current time as its completion date
416
+ > - `doing now -f --back 30m Working on something new` --- Add a new entry and complete the last entry, but use a timestamp from 30 minutes ago for both.
410
417
 
411
- `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.
418
+ ##### done/finish
419
+
420
+ `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 the Archive with `-a`.
421
+
422
+ `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. Used on its own, it will set the start date, and the finish date will be the current time. 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.
412
423
 
413
424
  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.)
414
425
 
426
+ > __Examples:__
427
+ >
428
+ > - `doing done --back 1h The thing I just did` --- Add an entry for a completed task that you started an hour ago and just finished
429
+ > - `doing done --back 1h --took 20m The thing I just finished` --- Record an entry you started an hour ago and finished 20 minutes later
430
+ > - `doing done --took 20m` --- Finish the last task but change the finish date so that the total elapsed time is only 20 minutes (if the finish date would be in the future, start date will be adjusted accordingly)
431
+
415
432
  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. The new entry is added. Anything after the first line is included as a note on the entry.
416
433
 
417
434
  `doing again` (or `doing resume`) will duplicate the last @done entry (most recently completed) with a new start date (and without the @done tag). To resume the last entry matching specific tags, use `--tag=TAG`. You can specify multiple tags by separating with a comma. Multiple tags are combined with 'AND' by default (all tags must exist on the entry to match), but you can use `--bool=` to set it to 'OR' or 'NOT'. By default the new entry will be added to the same section as the matching entry, but you can specify a section with `--in=SECTION`.
@@ -429,7 +446,7 @@ See `doing help meanwhile` for more options.
429
446
 
430
447
  ##### Finishing
431
448
 
432
- `doing finish` by itself is the same as `doing done` by itself. It adds _@done(timestamp)_ to the last entry. It also accepts a numeric argument to complete X number of tasks back in history. Add `-a` to also archive the affected entries.
449
+ `doing finish` by itself is the same as `doing done` by itself. It adds _@done(timestamp)_ to the last entry. It also accepts a numeric argument to complete X number of tasks back in history (0 affects all entries). Add `-a` to also archive the affected entries.
433
450
 
434
451
  `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.
435
452
 
@@ -445,6 +462,8 @@ You can change the boolean using `--bool=OR` (last entry containing any of the s
445
462
 
446
463
  You can also include a `--no-date` switch to add `@done` without a finish date, meaning no time is tracked for the task. `doing cancel` is an alias for this. Like `finish`, `cancel` accepts a count to act on the last X entries, as well as `--archive` and `--section` options. `cancel` also accepts the `--tag` and `--bool` flags for tag filtering.
447
464
 
465
+ By default `doing finish` works on a single entry, the last entry or the most recent entry matching a `--tag` or `--search` query. Specifying `doing finish 10` would finish any unfinished entries within the last 10 entries. In the case of `--tag` or `--search` queries, the count serves as the maximum number of matches doing will act on, sorted in reverse date order (most recent first). A count of 0 will disable the limit entirely, acting on all matching entries.
466
+
448
467
 
449
468
  ##### Tagging and Autotagging
450
469
 
data/bin/doing CHANGED
@@ -374,11 +374,12 @@ command %i[done did] do |c|
374
374
  finish_date = Time.now
375
375
  end
376
376
 
377
- section = wwid.guess_section(options[:s]) || options[:s].cap_first
378
377
  if finish_date
379
378
  donedate = options[:date] ? "(#{finish_date.strftime('%F %R')})" : ''
380
379
  end
381
380
 
381
+ section = wwid.guess_section(options[:s]) || options[:s].cap_first
382
+
382
383
  if options[:e]
383
384
  raise 'No EDITOR variable defined in environment' if ENV['EDITOR'].nil?
384
385
 
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.62'
2
+ VERSION = '1.0.63'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -835,7 +835,12 @@ class WWID
835
835
  done_date = item['date'] + (opt[:back] - item['date'])
836
836
  end
837
837
  elsif opt[:took]
838
- done_date = item['date'] + opt[:took]
838
+ if item['date'] + opt[:took] > Time.now
839
+ item['date'] = Time.now - opt[:took]
840
+ done_date = Time.now
841
+ else
842
+ done_date = item['date'] + opt[:took]
843
+ end
839
844
  else
840
845
  done_date = Time.now
841
846
  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.62
4
+ version: 1.0.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra