todo-jsonl 0.1.32 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/todo.rb +3 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70b3b87cee25e9b7f3b98d8c4fabfa9314953ab473fa845af8d5ac3865416bf3
4
- data.tar.gz: fc60551fd9ad077cbb794c91dc94595cc8969eaeede825d42bf425b1654113f4
3
+ metadata.gz: 89f9cb1d9f24fe4077faebac43c8fe85041021f560a9cd812e67acace53441cc
4
+ data.tar.gz: cddf8951cc9afbdea4ee6831f3c86fc5419a4f00582a2b1292007bba15b9cf13
5
5
  SHA512:
6
- metadata.gz: ee42c84380d64142ba3f64a9ea7deee06f874f3a9f6a9ac4142fc834a14b8f66732118ca1072d43bf484674971c37944053deff4fed89e797527b7a83fa1ff25
7
- data.tar.gz: f79bc0d5be7041e6efcc25f1f88afa43eecf10c382d7353f6b3fa55d6752756b767152b52ab694b5999eda0bbce58ed60ba36b520b09c16309b0ee06f36f82f5
6
+ metadata.gz: 9e90bb2be2db37e6bfdcee15f7953112bba1db7804562dd4ab697a033a7d38ec4cd495abb394320263ff2a76fb5ff23c0886eb8ae381959a170828a0d7d83d9f
7
+ data.tar.gz: ab376c488d6a86676ee134154ef62e7c63f801d3002ef1df28ec2aee521f535730739ff4a13847dd0d77ad19bab0b6b36d5ce7732d6b317696e125293fa95d28
data/bin/todo.rb CHANGED
@@ -29,7 +29,6 @@ require 'json'
29
29
  require 'date'
30
30
 
31
31
  class Todo
32
-
33
32
  COLOR_CODES = {
34
33
  black: 30,
35
34
  red: 31,
@@ -177,7 +176,6 @@ class Todo
177
176
  next_7_days = (0..6).map do |day| @today + day end
178
177
  @due_date_days = next_7_days.map do |day| day.strftime('%A').downcase end
179
178
  due_dates_for_queries = next_7_days.map do |day| day.strftime(DATE_FORMAT) end
180
-
181
179
  @queries = {
182
180
  ':active' => lambda do |task| /(new|started|blocked)/.match(task[:state]) end,
183
181
  ':done' => lambda do |task| 'done' == task[:state] end,
@@ -380,7 +378,7 @@ class Todo
380
378
  end
381
379
  items[num] = task if match
382
380
  end
383
- return items
381
+ items
384
382
  end
385
383
 
386
384
  def colorize(text, color)
@@ -388,16 +386,11 @@ class Todo
388
386
  end
389
387
 
390
388
  def convert_due_date(date)
391
- due = nil
392
389
  day_index = @due_date_days.index(date.to_s.downcase) ||
393
390
  DUE_DATE_DAYS_SIMPLE.index(date.to_s.downcase) ||
394
391
  @due_date_days.map do |day| day[0..2] end.index(date.to_s.downcase)
395
- if day_index
396
- due = (@today + day_index).strftime(DATE_FORMAT)
397
- else
398
- due = date.nil? || date.empty? ? nil : Date.strptime(date, DATE_FORMAT).strftime(DATE_FORMAT)
399
- end
400
- return due
392
+ return (@today + day_index).strftime(DATE_FORMAT) if day_index
393
+ date.nil? || date.empty? ? nil : Date.strptime(date, DATE_FORMAT).strftime(DATE_FORMAT)
401
394
  end
402
395
  end
403
396
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todo-jsonl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.32
4
+ version: 0.1.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabor Bata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: