timesheet_nags 0.2.1 → 0.3.1

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
  SHA1:
3
- metadata.gz: 72968d25ff67d08469d2e2c18497698de17b3d0c
4
- data.tar.gz: a69721f64e6d97d2725959656429d68b9eb5e983
3
+ metadata.gz: e910ef1e4673eec9ea962965c6534446c8ea437d
4
+ data.tar.gz: 88d23ab20449b15eca23cdc48f1198530b7c463a
5
5
  SHA512:
6
- metadata.gz: b46b4cff5b2a17c9285f8fbc82ff7ba021cdb8c4856428792e1e12467b0ecf1c728592af82d33256060225b9b98449a9aca10c83592b75e73c2eeb392a7e4f2a
7
- data.tar.gz: 414ca02314f2f1e84191dc71143b1fce9eb7a3bdecad12047a139d24b26ea2c3a5848c94f186b6f0f89d1069b0558e098063e0ca4d691da555e5b9cc14c69a4a
6
+ metadata.gz: 32998425e73d705554ba612df855b71626ae98cbb87ce5527ee93960aac6450ae7cfd7965d9e8973cc1570f4025c8dbc61602862c2188432aeccaea591b07e50
7
+ data.tar.gz: d9520c465487415c101136abbcae13257c72d5b6217483618e21383d8d0f80897fe02d561533b9fa4ab3723cb79814387f2852ccfb0eccb693361fa081d8d0b8
data/.travis.yml CHANGED
@@ -1,5 +1,9 @@
1
- sudo: false
2
1
  language: ruby
3
2
  rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.15.4
3
+ - 2.2.6
4
+ - 2.3.3
5
+
6
+ #install:
7
+ #- bundle install
8
+
9
+ script: rake
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://help.getharvest.com/api-v2/authentication-api/authentication/authentication/)
7
+ - [Harvest API credentials](https://id.getharvest.com/developers)
8
8
  - OSX Sierra (maybe works on later versions?)
9
9
 
10
10
  ![image of a popup that says 'your timesheet is out of date - age: 1 days](img/timesheet_nag_cast.gif)
@@ -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
- send_nag('You rock at timesheets!')
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 > 1
24
+ latest_timestamp_age > 0 && tuesday_through_friday.include?(day_of_week)
19
25
  end
20
26
 
21
27
  def latest_timestamp_age
@@ -1,3 +1,3 @@
1
1
  module TimesheetNags
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
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.2.1
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-09 00:00:00.000000000 Z
11
+ date: 2018-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler