todo_or_die 0.0.3 → 0.0.4
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 +29 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +18 -15
- data/README.md +7 -5
- data/lib/todo_or_die.rb +3 -2
- data/lib/todo_or_die/version.rb +1 -1
- data/todo_or_die.gemspec +7 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 720068aa6be87b431d7bb5edd809ae84999347b553f8182de6f580bb5bd4b033
|
4
|
+
data.tar.gz: 58f7bff93dcee49e91c0ad7c51a2e0ffd633d77e6057eec380ac80e508f9308b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ad0bedfafe54e42295a2b1f6f414bcd11302062261b87fb4d544037fd36e008b8c5dee3374a66fa8bd3dd03ba2c53978d943d2fd4168bb5eebc3726556d878
|
7
|
+
data.tar.gz: 8608b6a2259e145936a642e8f4d8fb585fa0cba8bcb07ec7a2fe4e9182455cd17c35529bb40070459b321d9d5f6cf7757a68e2ceac89c0dd67220870dc36ca7b
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [0.0.3] - 2019-11-26
|
10
|
+
### Added
|
11
|
+
- Boolean-returning conditionals or callables (Proc, Block, Lambda) can be passed to the
|
12
|
+
new `if` argument. `if` can be used instead of or in conjunction with the `by` argument
|
13
|
+
to die on a specific date OR when a specific condition becomes true.
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
- Date strings can now be parsed parsed internally without calling `Time` or `Date`
|
17
|
+
classes explicitely.
|
18
|
+
|
19
|
+
## [0.0.2] - 2019-02-15
|
20
|
+
### Changed
|
21
|
+
- Exclude this gem's backtrace location from exceptions thrown to make it easier to find
|
22
|
+
TODOs.
|
23
|
+
|
24
|
+
## [0.0.1] - 2019-01-01
|
25
|
+
|
26
|
+
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...HEAD
|
27
|
+
[0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3
|
28
|
+
[0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2
|
29
|
+
[0.0.1]: https://github.com/olivierlacan/keep-a-changelog/releases/tag/v0.0.1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
todo_or_die (0.0.
|
4
|
+
todo_or_die (0.0.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.0)
|
10
|
-
jaro_winkler (1.5.
|
10
|
+
jaro_winkler (1.5.4)
|
11
11
|
minitest (5.11.3)
|
12
|
-
parallel (1.
|
13
|
-
parser (2.
|
12
|
+
parallel (1.19.1)
|
13
|
+
parser (2.7.1.2)
|
14
14
|
ast (~> 2.4.0)
|
15
|
-
powerpack (0.1.2)
|
16
15
|
rainbow (3.0.0)
|
17
|
-
rake (
|
18
|
-
|
16
|
+
rake (13.0.1)
|
17
|
+
rexml (3.2.4)
|
18
|
+
rubocop (0.82.0)
|
19
19
|
jaro_winkler (~> 1.5.1)
|
20
20
|
parallel (~> 1.10)
|
21
|
-
parser (>= 2.
|
22
|
-
powerpack (~> 0.1)
|
21
|
+
parser (>= 2.7.0.1)
|
23
22
|
rainbow (>= 2.2.2, < 4.0)
|
23
|
+
rexml
|
24
24
|
ruby-progressbar (~> 1.7)
|
25
|
-
unicode-display_width (
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
26
|
+
rubocop-performance (1.5.2)
|
27
|
+
rubocop (>= 0.71.0)
|
28
|
+
ruby-progressbar (1.10.1)
|
29
|
+
standard (0.4.1)
|
30
|
+
rubocop (~> 0.82.0)
|
31
|
+
rubocop-performance (~> 1.5.2)
|
29
32
|
timecop (0.9.1)
|
30
|
-
unicode-display_width (1.
|
33
|
+
unicode-display_width (1.7.0)
|
31
34
|
|
32
35
|
PLATFORMS
|
33
36
|
ruby
|
@@ -41,4 +44,4 @@ DEPENDENCIES
|
|
41
44
|
todo_or_die!
|
42
45
|
|
43
46
|
BUNDLED WITH
|
44
|
-
1.
|
47
|
+
2.1.4
|
data/README.md
CHANGED
@@ -60,20 +60,22 @@ end
|
|
60
60
|
Nothing will happen at all until February 4th, at which point the gem will
|
61
61
|
raise an error whenever this class is loaded until someone deals with it.
|
62
62
|
|
63
|
-
You may also pass a condition, either as
|
63
|
+
You may also pass a condition, either as a callable (e.g. proc/lambda/method) or
|
64
|
+
a boolean test:
|
64
65
|
|
65
66
|
``` ruby
|
66
67
|
class User < ApplicationRecord
|
67
|
-
TodoOrDie(
|
68
|
-
"delete after 1 million users",
|
69
|
-
if: User.size > 1000000,
|
70
|
-
)
|
68
|
+
TodoOrDie("delete after someone wins", if: User.count > 1000000)
|
71
69
|
def is_one_millionth_user?
|
72
70
|
id == 1000000
|
73
71
|
end
|
74
72
|
end
|
75
73
|
```
|
76
74
|
|
75
|
+
You can also pass both `by` and `if` (where both must be met for an error to be
|
76
|
+
raised) or, I guess, neither (where an error will be raised as soon as
|
77
|
+
`TodoOrDie` is invoked).
|
78
|
+
|
77
79
|
### What kind of error?
|
78
80
|
|
79
81
|
It depends on whether you're using [Rails](https://rubyonrails.org) or not.
|
data/lib/todo_or_die.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "time"
|
1
2
|
require "todo_or_die/version"
|
2
3
|
require "todo_or_die/overdue_error"
|
3
4
|
|
@@ -10,7 +11,7 @@ module TodoOrDie
|
|
10
11
|
(" came due on #{due_at.strftime("%Y-%m-%d")}" if due_at),
|
11
12
|
(" and" if due_at && condition),
|
12
13
|
(" has met the conditions to be acted upon" if condition),
|
13
|
-
". Do it!"
|
14
|
+
". Do it!"
|
14
15
|
].compact.join("")
|
15
16
|
|
16
17
|
if defined?(Rails) && Rails.env.production?
|
@@ -18,7 +19,7 @@ module TodoOrDie
|
|
18
19
|
else
|
19
20
|
raise TodoOrDie::OverdueTodo, error_message, TodoOrDie.__clean_backtrace(caller)
|
20
21
|
end
|
21
|
-
}
|
22
|
+
}
|
22
23
|
}.freeze
|
23
24
|
|
24
25
|
def self.config(options = {})
|
data/lib/todo_or_die/version.rb
CHANGED
data/todo_or_die.gemspec
CHANGED
@@ -3,15 +3,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require "todo_or_die"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
6
|
+
spec.name = "todo_or_die"
|
7
|
+
spec.version = TodoOrDie::VERSION
|
8
|
+
spec.authors = ["Justin Searls"]
|
9
|
+
spec.email = ["searls@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary
|
12
|
-
spec.homepage
|
11
|
+
spec.summary = "Write TODOs in code that ensure you actually do them"
|
12
|
+
spec.homepage = "https://github.com/searls/todo_or_die"
|
13
13
|
|
14
|
-
spec.files
|
14
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
15
15
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
16
|
end
|
17
17
|
spec.require_paths = ["lib"]
|
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.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searls
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".circleci/config.yml"
|
91
91
|
- ".gitignore"
|
92
|
+
- CHANGELOG.md
|
92
93
|
- Gemfile
|
93
94
|
- Gemfile.lock
|
94
95
|
- LICENSE.txt
|
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: '0'
|
120
121
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.1.2
|
122
123
|
signing_key:
|
123
124
|
specification_version: 4
|
124
125
|
summary: Write TODOs in code that ensure you actually do them
|