doing 1.0.87 → 1.0.88

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: 2540726a17efa50ef0cddc29353d8c14a4d921a89fb302711225053faacfbc4d
4
- data.tar.gz: e4f59cf1e2feda50df653bbbd981e1ab4ad75d807eaf47a8afbad9d98032d27b
3
+ metadata.gz: cd3101f8217fd3af3a0aa5fa57b2b7daf72aeb15510f83a361971403338c293e
4
+ data.tar.gz: 9bfc051f1129c40db87ac8c31a1eb88d0e9f1b1bc96b6f697e42fdb5351e3d35
5
5
  SHA512:
6
- metadata.gz: dabcbefd24a3d099d71eb14c03f71250067e509b385d573405219d3cfaea8a66f6ec526a32547401f249f0fdd82774415ed0da1c95e233aada2f54135de49558
7
- data.tar.gz: 5b5a5d7800110de9aeaf636b6b6b4947c1923e55ce4f455d2316483c37fcfb30461b818df78c24097ef66f574ed57bdeebf50f77e4f806161212c4d36c86eabd
6
+ metadata.gz: 3f7f0fe38daa1f63757dd4b3fb9b6c8a8d55415d47d74c58b2f4450327954381020279e353a44a790142da3802ffc2f6ce1b828ace7fbf3b0042a050674b7084
7
+ data.tar.gz: c36980be8fb2b8ae10fa750965eb2faa0c3ba4a0230e2e68a12cf09195b4fa16e70851521e0437d5e744fd954b9d1f50b39e7e31c6704592d03d51786be80a99
data/README.md CHANGED
@@ -27,7 +27,7 @@ If there's something I want to look at later but doesn't need to be added to a t
27
27
 
28
28
  ## Installation
29
29
 
30
- The current version of `doing` is <!--VER-->1.0.86<!--END VER-->.
30
+ The current version of `doing` is <!--VER-->1.0.87<!--END VER-->.
31
31
 
32
32
  $ [sudo] gem install doing
33
33
 
@@ -545,6 +545,8 @@ If you have a use for it, you can use `-o csv` on the show or view commands to o
545
545
 
546
546
  `doing yesterday` is great for stand-ups (thanks to [Sean Collins](https://github.com/sc68cal) for that!). Note that you can show yesterday's activity from an alternate section by using the section name as an argument (e.g. `doing yesterday archive`).
547
547
 
548
+ All of the display commands (view, show, today, yesterday, search) support date ranges in addition to other filtering options. Results can be narrowed to a date/time span using `--before DATE` and `--after DATE`. The `DATE` accepts a natural language string but works best in formats like `10/20/21` or `2021-05-13 3pm` (or shortened to just `5/13 3pm`). For the `today` and `yesterday` commands the `DATE` should just be a time, e.g. `12pm` or `15:00`, and results will be filtered within the timespan for just that day. Both flags are optional, and you can use just `--before` to get everything older than a certain date, or use just `--after` to get everything newer.
549
+
548
550
  `doing on` allows for full date ranges and filtering. `doing on saturday`, or `doing on one month to today` will give you ranges. You can use the same terms with the `show` command by adding the `-f` or `--from` flag. `doing show @done --from "monday to friday"` will give you all of your completed items for the last week (assuming it's the weekend). There's also `doing since` a simple alias for `doing on PAST_DATE to now`, e.g. `doing since monday`.
549
551
 
550
552
  You can also show entries matching a search string with `doing grep` (synonym `doing search`). If you want to search with regular expressions or for an exact match, surround your search query with forward slashes, e.g. `doing search /project name/`. If you pass a search string without slashes, it's treated as a fuzzy search string, meaning matches can be found as long as the characters in the search string are in order and with no more than three other characters between each. By default searches are across all sections, but you can limit it to one with the `-s SECTION_NAME` flag. Searches can be displayed with the default template, or output as HTML, CSV, or JSON.
data/bin/doing CHANGED
@@ -1324,10 +1324,33 @@ command :yesterday do |c|
1324
1324
  c.arg_name 'KEY'
1325
1325
  c.flag [:tag_sort], must_match: /^(?:name|time)$/i, default_value: default
1326
1326
 
1327
+ c.desc 'View entries before specified time (e.g. 8am, 12:30pm, 15:00)'
1328
+ c.arg_name 'TIME_STRING'
1329
+ c.flag [:before]
1330
+
1331
+ c.desc 'View entries after specified time (e.g. 8am, 12:30pm, 15:00)'
1332
+ c.arg_name 'TIME_STRING'
1333
+ c.flag [:after]
1334
+
1335
+ c.desc 'Tag sort direction (asc|desc)'
1336
+ c.arg_name 'DIRECTION'
1337
+ c.flag [:tag_order], must_match: /^(?:a(?:sc)?|d(?:esc)?)$/i
1338
+
1327
1339
  c.action do |_global_options, options, _args|
1340
+ tag_order = if options[:tag_order]
1341
+ options[:tag_order] =~ /^d/i ? 'desc' : 'asc'
1342
+ else
1343
+ 'asc'
1344
+ end
1328
1345
  options[:sort_tags] = options[:tag_sort] =~ /^n/i
1329
- puts wwid.yesterday(options[:s], options[:t], options[:o],
1330
- { totals: options[:totals], sort_tags: options[:sort_tags] }).chomp
1346
+ opt = {
1347
+ after: options[:after],
1348
+ before: options[:before],
1349
+ sort_tags: options[:sort_tags],
1350
+ tag_order: options[:tag_order],
1351
+ totals: options[:totals]
1352
+ }
1353
+ puts wwid.yesterday(options[:section], options[:times], options[:output], opt).chomp
1331
1354
  end
1332
1355
  end
1333
1356
 
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.87'
2
+ VERSION = '1.0.88'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -2257,8 +2257,25 @@ class WWID
2257
2257
  opt[:totals] ||= false
2258
2258
  opt[:sort_tags] ||= false
2259
2259
  section = guess_section(section)
2260
- list_section({ section: section, count: 0, order: 'asc', yesterday: true, times: times,
2261
- output: output, totals: opt[:totals], sort_tags: opt[:sort_tags] })
2260
+ y = (Time.now - (60 * 60 * 24)).strftime('%Y-%m-%d')
2261
+ opt[:after] = "#{y} #{opt[:after]}" if opt[:after]
2262
+ opt[:before] = "#{y} #{opt[:before]}" if opt[:before]
2263
+
2264
+ options = {
2265
+ after: opt[:after],
2266
+ before: opt[:before],
2267
+ count: 0,
2268
+ order: 'asc',
2269
+ output: output,
2270
+ section: section,
2271
+ sort_tags: opt[:sort_tags],
2272
+ tag_order: opt[:tag_order],
2273
+ times: times,
2274
+ totals: opt[:totals],
2275
+ yesterday: true
2276
+ }
2277
+
2278
+ list_section(options)
2262
2279
  end
2263
2280
 
2264
2281
  ##
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.87
4
+ version: 1.0.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra