daily_planner 0.1.1 → 0.1.2
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
- checksums.yaml.gz.sig +0 -0
- data/lib/daily_planner.rb +14 -9
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9af46a5832bbbf1a032e4df76866c8ec6a10e32
|
4
|
+
data.tar.gz: 259d22dbf34252fac923958b1075811b574c35ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756eb36fb1f333f1bf38850cb067d80d17cf7f5160f4843eeccc762c80a4ef22b853b37dacd58e6305f0fd8bfb78a3c30653258d72fb0a5d9f460ca42c05fa2f
|
7
|
+
data.tar.gz: c64c8dc8115b369e32b9eaf565ff2005e9e9e23d9439c20563ebe21eefb30fa8071157dbb4f6a3f4730c7a273fc44065ef6cc4691e57d2e7f56847ab475f67d3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/daily_planner.rb
CHANGED
@@ -11,9 +11,10 @@ class DailyPlanner
|
|
11
11
|
|
12
12
|
attr_reader :to_s
|
13
13
|
|
14
|
-
def initialize(filename='daily-planner.txt', path: '.'
|
14
|
+
def initialize(filename='daily-planner.txt', path: '.',
|
15
|
+
now: DateTime.now.to_date)
|
15
16
|
|
16
|
-
@filename, @path = filename, path
|
17
|
+
@filename, @path, @now = filename, path, now
|
17
18
|
|
18
19
|
fpath = File.join(path, filename)
|
19
20
|
|
@@ -24,7 +25,7 @@ class DailyPlanner
|
|
24
25
|
archive()
|
25
26
|
|
26
27
|
# if the date isn't today then update it to today
|
27
|
-
refresh() if @d !=
|
28
|
+
refresh() if @d != @now
|
28
29
|
|
29
30
|
else
|
30
31
|
@rx = new_rx
|
@@ -106,18 +107,22 @@ class DailyPlanner
|
|
106
107
|
def new_rx(today: '', tomorrow: '')
|
107
108
|
|
108
109
|
title = "Daily Planner"
|
109
|
-
|
110
|
-
rx = RecordX.new({title: title, date: date, \
|
110
|
+
rx = RecordX.new({title: title, date: @now, \
|
111
111
|
today: today, tomorrow: tomorrow})
|
112
112
|
return rx
|
113
113
|
end
|
114
114
|
|
115
115
|
def refresh()
|
116
|
-
|
117
|
-
if @d == DateTime.now.to_date - 1 and @rx.tomorrow.strip.length > 0 then
|
118
|
-
@rx = new_rx(today: @rx.tomorrow)
|
119
|
-
end
|
120
116
|
|
117
|
+
if @d != @now then
|
118
|
+
|
119
|
+
@rx = if @d == @now - 1 and @rx.tomorrow.strip.length > 0 then
|
120
|
+
new_rx(today: @rx.tomorrow)
|
121
|
+
else
|
122
|
+
new_rx()
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
121
126
|
end
|
122
127
|
|
123
128
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|