daily_reflection 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/daily_reflection.rb +57 -17
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4a7897f4dc50e3fce7dd1957bc27637d005fb53b96317374f841e308bd94607
|
4
|
+
data.tar.gz: 1c47c849917efda0f62b68451d9b58e642618b4e52ff12b625d61e407731c499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 035bb3603a3a0b549e9f69e9218c3fe0ac36b3472fabdf86d9fd883a1577bca4b20f5a4537604ad7cdfbce1a4cac81465200483290cfba5fd0ef6643dd8e8462
|
7
|
+
data.tar.gz: e6450b776b59a30b9f0693f31d5d8121bdc9b92d6ae36044c37cf6b5142393be31ac99e423d901896425a75e096457b0731fff5f5bb36ea4e2f8a9c1c6986c47
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/daily_reflection.rb
CHANGED
@@ -10,19 +10,20 @@ class DailyReflection < WikiMd
|
|
10
10
|
|
11
11
|
attr_accessor :date
|
12
12
|
|
13
|
-
def initialize(s, debug: false, date: Date.today,
|
14
|
-
|
13
|
+
def initialize(s=nil, debug: false, date: Date.today,
|
14
|
+
period: :daily,
|
15
|
+
title: "My #{period.to_s.capitalize} Reflection" )
|
15
16
|
|
16
|
-
@date = date
|
17
|
+
@date, @period = date, period
|
17
18
|
super(s, order: 'descending', debug: debug, title: title)
|
18
19
|
|
19
|
-
|
20
|
+
check_period_entry()
|
20
21
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def add_entry(s)
|
24
25
|
|
25
|
-
|
26
|
+
check_period_entry()
|
26
27
|
|
27
28
|
e = Entry.new(@dxsx.dx.all.first)
|
28
29
|
e.body = e.body + "\n" + s
|
@@ -31,27 +32,66 @@ class DailyReflection < WikiMd
|
|
31
32
|
|
32
33
|
end
|
33
34
|
|
34
|
-
def
|
35
|
-
|
36
|
-
puts ('r: ' + r.inspect).debug if @debug
|
37
|
-
r
|
35
|
+
def find_date(d)
|
36
|
+
self.find d.strftime("%-d %b %Y")
|
38
37
|
end
|
39
38
|
|
40
|
-
def found_today?()
|
41
|
-
self.find_today()
|
42
|
-
end
|
43
39
|
|
44
40
|
def create_day()
|
41
|
+
create_date_entry(@date)
|
42
|
+
end
|
43
|
+
|
44
|
+
def create_week()
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
d = @date
|
47
|
+
d += 1 until d.wday == 0
|
48
48
|
|
49
|
-
|
49
|
+
create_date_entry(d)
|
50
50
|
|
51
|
+
end
|
52
|
+
|
53
|
+
def create_month()
|
54
|
+
create_date_entry(Date.civil(@date.year, @date.month, -1))
|
55
|
+
end
|
56
|
+
|
57
|
+
def create_year()
|
58
|
+
create_date_entry(Date.new(@date.year+1,1,1)-1)
|
59
|
+
end
|
60
|
+
|
51
61
|
def today()
|
52
|
-
|
53
62
|
Entry.new(@dxsx.dx.all.first)
|
54
|
-
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def check_period_entry()
|
68
|
+
|
69
|
+
case @period.to_sym
|
70
|
+
when :daily
|
71
|
+
|
72
|
+
create_day() unless find_date(@date)
|
73
|
+
|
74
|
+
when :weekly
|
75
|
+
|
76
|
+
d = @date
|
77
|
+
d += 1 until d.wday == 0
|
78
|
+
create_week() unless find_date(d)
|
79
|
+
|
80
|
+
when :monthly
|
81
|
+
|
82
|
+
d = Date.civil(@date.year, @date.month, -1)
|
83
|
+
create_month() unless find_date(d)
|
84
|
+
|
85
|
+
when :yearly
|
86
|
+
|
87
|
+
create_year() unless find_date(Date.new(@date.year+1,1,1)-1)
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
def create_date_entry(d)
|
94
|
+
self.create_section "# %s\n\n\n+ %s" % [d.strftime("%-d %b %Y"), d.year]
|
55
95
|
end
|
56
96
|
|
57
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daily_reflection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
b2BjS30NjJ1ip3dATTcNML+TzkqoRwvprlZgx9mPUPLhhzy6XPSvVD4ErwvxKSlZ
|
36
36
|
C9mRU23Hzg7ASRqGw0rzoDgj
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2019-01-
|
38
|
+
date: 2019-01-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: wiki_md
|
@@ -43,20 +43,20 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.7'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.7.1
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '0.
|
56
|
+
version: '0.7'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.
|
59
|
+
version: 0.7.1
|
60
60
|
description:
|
61
61
|
email: james@jamesrobertson.eu
|
62
62
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|