todo_or_die 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +27 -23
- data/lib/todo_or_die/version.rb +1 -1
- data/lib/todo_or_die.rb +8 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cc7971ad1d363af9350c7f9bdc7ae6884104ad1161b1a584de791eb1bccd2f6
|
4
|
+
data.tar.gz: 037644cf228dd8c3fae1f15fe568d11c50aebff47494a040ee6702198305464b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce9ed473d8727a3596380df75079d51e88c23328dc741bc700eaaafd167fcec00a5b510f84931134860a530bf7692ca6dff9f9e62d93eec3b8ad3b085b4428f
|
7
|
+
data.tar.gz: 70a8d8b3df3da35509932cb01ab3f2861b79e7e030602183e581d0a8ea83018dfeb675254618976788789f20aec052323a84b157f587a4a75e31c669bfbb1f4c
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.1.1] - 2022-07-01
|
8
|
+
|
9
|
+
- Fix `warn_by` [#16](https://github.com/searls/todo_or_die/pull/16)
|
10
|
+
|
7
11
|
## [0.1.0] - 2022-06-27
|
8
12
|
|
9
13
|
- Add `warn_by` option [#14](https://github.com/searls/todo_or_die/pull/14)
|
data/Gemfile.lock
CHANGED
@@ -1,36 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
todo_or_die (0.1.
|
4
|
+
todo_or_die (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
rexml (3.2.
|
18
|
-
rubocop (
|
19
|
-
jaro_winkler (~> 1.5.1)
|
9
|
+
ast (2.4.2)
|
10
|
+
minitest (5.16.1)
|
11
|
+
parallel (1.22.1)
|
12
|
+
parser (3.1.2.0)
|
13
|
+
ast (~> 2.4.1)
|
14
|
+
rainbow (3.1.1)
|
15
|
+
rake (13.0.6)
|
16
|
+
regexp_parser (2.5.0)
|
17
|
+
rexml (3.2.5)
|
18
|
+
rubocop (1.29.1)
|
20
19
|
parallel (~> 1.10)
|
21
|
-
parser (>=
|
20
|
+
parser (>= 3.1.0.0)
|
22
21
|
rainbow (>= 2.2.2, < 4.0)
|
23
|
-
|
22
|
+
regexp_parser (>= 1.8, < 3.0)
|
23
|
+
rexml (>= 3.2.5, < 4.0)
|
24
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
24
25
|
ruby-progressbar (~> 1.7)
|
25
|
-
unicode-display_width (>= 1.4.0, <
|
26
|
-
rubocop-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
rubocop (
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
27
|
+
rubocop-ast (1.18.0)
|
28
|
+
parser (>= 3.1.1.0)
|
29
|
+
rubocop-performance (1.13.3)
|
30
|
+
rubocop (>= 1.7.0, < 2.0)
|
31
|
+
rubocop-ast (>= 0.4.0)
|
32
|
+
ruby-progressbar (1.11.0)
|
33
|
+
standard (1.12.1)
|
34
|
+
rubocop (= 1.29.1)
|
35
|
+
rubocop-performance (= 1.13.3)
|
36
|
+
timecop (0.9.5)
|
37
|
+
unicode-display_width (2.2.0)
|
34
38
|
|
35
39
|
PLATFORMS
|
36
40
|
ruby
|
data/lib/todo_or_die/version.rb
CHANGED
data/lib/todo_or_die.rb
CHANGED
@@ -52,15 +52,19 @@ module TodoOrDie
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# The main event
|
55
|
-
def TodoOrDie(message, by: by_omitted = true, if: if_omitted = true, warn_by: warn_by_omitted = true)
|
55
|
+
def TodoOrDie(message, by: by_omitted = true, if: if_omitted = true, warn_by: warn_by_omitted = true)
|
56
56
|
due_at = Time.parse(by.to_s) unless by_omitted
|
57
57
|
warn_at = Time.parse(warn_by.to_s) unless warn_by_omitted
|
58
58
|
condition = binding.local_variable_get(:if) unless if_omitted
|
59
59
|
|
60
|
-
|
61
|
-
is_due = by_omitted || Time.now > due_at
|
60
|
+
is_past_due_date = by_omitted || Time.now > due_at
|
62
61
|
die_condition_met = if_omitted || (condition.respond_to?(:call) ? condition.call : condition)
|
63
|
-
|
62
|
+
no_conditions_given = by_omitted && if_omitted && warn_by_omitted
|
63
|
+
only_warn_condition_given = (if_omitted && by_omitted && !warn_by_omitted)
|
64
|
+
|
65
|
+
ready_to_die = is_past_due_date && die_condition_met && !only_warn_condition_given
|
66
|
+
should_die = no_conditions_given || ready_to_die
|
67
|
+
should_warn = !warn_by_omitted && Time.now > warn_at
|
64
68
|
|
65
69
|
if should_die
|
66
70
|
die = TodoOrDie.config[:die]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todo_or_die
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searls
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.3.
|
122
|
+
rubygems_version: 3.3.6
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Write TODOs in code that ensure you actually do them
|