timesheet_nags 0.2.1 → 0.3.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/.travis.yml +7 -3
- data/README.md +15 -1
- data/lib/timesheet_nags/nagger.rb +8 -2
- data/lib/timesheet_nags/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e910ef1e4673eec9ea962965c6534446c8ea437d
|
4
|
+
data.tar.gz: 88d23ab20449b15eca23cdc48f1198530b7c463a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32998425e73d705554ba612df855b71626ae98cbb87ce5527ee93960aac6450ae7cfd7965d9e8973cc1570f4025c8dbc61602862c2188432aeccaea591b07e50
|
7
|
+
data.tar.gz: d9520c465487415c101136abbcae13257c72d5b6217483618e21383d8d0f80897fe02d561533b9fa4ab3723cb79814387f2852ccfb0eccb693361fa081d8d0b8
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Goal: To remind you daily when your timesheet is out of date.
|
|
4
4
|
|
5
5
|
Requirements:
|
6
6
|
|
7
|
-
- [Harvest API credentials](https://
|
7
|
+
- [Harvest API credentials](https://id.getharvest.com/developers)
|
8
8
|
- OSX Sierra (maybe works on later versions?)
|
9
9
|
|
10
10
|

|
@@ -16,6 +16,20 @@ Requirements:
|
|
16
16
|
* Run `timesheet_nags` to get a live check - it'll annoy you if you haven't updated your timesheet in over a day (and today's not Monday).
|
17
17
|
|
18
18
|
|
19
|
+
### Scheduling
|
20
|
+
|
21
|
+
I'm using a crontab. Run `crontab -e` and then paste this in, save, and exit. Note that I used the full path to my executable, which in my case is in an `asdf` folder somewhere.
|
22
|
+
|
23
|
+
```sh
|
24
|
+
HARVEST_TOKEN='redacted'
|
25
|
+
HARVEST_ACCOUNT_ID='redacted'
|
26
|
+
|
27
|
+
# timesheet nags at 10 and 4
|
28
|
+
0 10 * * * /Users/daniel/.asdf/shims/timesheet_nag >>/tmp/stdout.log 2>>/tmp/stderr.log
|
29
|
+
0 16 * * * /Users/daniel/.asdf/shims/timesheet_nag >>/tmp/stdout.log 2>>/tmp/stderr.log
|
30
|
+
```
|
31
|
+
|
32
|
+
|
19
33
|
## Future possibilities
|
20
34
|
|
21
35
|
- More nag configuration
|
@@ -9,13 +9,19 @@ module TimesheetNags
|
|
9
9
|
if should_nag?
|
10
10
|
send_nag("Your timesheet is out of date 😭 Age: #{latest_timestamp_age} days.", is_good: false)
|
11
11
|
else
|
12
|
-
|
12
|
+
maybe_compliment 'You rock at timesheets!'
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
def maybe_compliment(message)
|
17
|
+
return unless rand(10).eql?(5)
|
18
|
+
send_nag message
|
19
|
+
end
|
20
|
+
|
16
21
|
def should_nag?
|
22
|
+
tuesday_through_friday = [2,3,4,5]
|
17
23
|
day_of_week = Date.today.to_time.wday
|
18
|
-
latest_timestamp_age > 0 && day_of_week
|
24
|
+
latest_timestamp_age > 0 && tuesday_through_friday.include?(day_of_week)
|
19
25
|
end
|
20
26
|
|
21
27
|
def latest_timestamp_age
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timesheet_nags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Pritchett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|