evertils 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/evertils/controllers/generate.rb +9 -16
- data/lib/evertils/type.rb +6 -3
- data/lib/evertils/types/monthly.rb +4 -1
- data/lib/evertils/types/weekly.rb +4 -1
- data/lib/evertils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14fb0d4d14987ca35e2271f9bf5d0cd62dcdbc80
|
4
|
+
data.tar.gz: b3658a61ff67727365d5c2ef0a7a847f57e07436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66034f1b1108c9d833ee5ec65e49e1df4881ec8e0e5c01b5b43b6e6613afab8626a528678ebb341bcd6796b1c079b218981dd0aa878e44981ed9a6004617e21c
|
7
|
+
data.tar.gz: 57c1521538ef72e102456d3e2f60506033e6610f3b5669b17d94c56868229bf5b82d6334171e566fc5314eb4e994b921d1619c9ff23694efb984961447fdc9d9
|
@@ -10,19 +10,19 @@ module Evertils
|
|
10
10
|
# generate daily notes
|
11
11
|
def daily
|
12
12
|
note = Type::Daily.new(@config)
|
13
|
-
note.create
|
13
|
+
note.create if note.should_create?
|
14
14
|
end
|
15
15
|
|
16
16
|
# generate weekly notes
|
17
17
|
def weekly
|
18
18
|
note = Type::Weekly.new(@config)
|
19
|
-
note.create
|
19
|
+
note.create if note.should_create?
|
20
20
|
end
|
21
21
|
|
22
22
|
# generate monthly notes
|
23
23
|
def monthly
|
24
24
|
note = Type::Monthly.new(@config)
|
25
|
-
note.create
|
25
|
+
note.create if note.should_create?
|
26
26
|
end
|
27
27
|
|
28
28
|
# generate monthly task summary templates
|
@@ -30,13 +30,13 @@ module Evertils
|
|
30
30
|
Notify.error('Name argument is required', {}) if arg.nil?
|
31
31
|
|
32
32
|
note = Type::MonthlyTaskSummary.new(@config, arg[1])
|
33
|
-
note.create
|
33
|
+
note.create if note.should_create?
|
34
34
|
end
|
35
35
|
|
36
36
|
# generate priority queue notes
|
37
37
|
def pq
|
38
38
|
note = Type::PriorityQueue.new(@config)
|
39
|
-
note.create
|
39
|
+
note.create if note.should_create?
|
40
40
|
end
|
41
41
|
|
42
42
|
# creates the notes required to start the day
|
@@ -45,17 +45,10 @@ module Evertils
|
|
45
45
|
# - weekly (if today is Monday and there isn't a weekly log already)
|
46
46
|
# - monthly (if today is the 1st and there isn't a monthly log already)
|
47
47
|
def morning
|
48
|
-
pq
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
daily.create
|
53
|
-
|
54
|
-
weekly = Type::Weekly.new(@config)
|
55
|
-
weekly.create if weekly.should_create?
|
56
|
-
|
57
|
-
monthly = Type::Monthly.new(@config)
|
58
|
-
monthly.create if monthly.should_create?
|
48
|
+
pq
|
49
|
+
daily
|
50
|
+
weekly
|
51
|
+
monthly
|
59
52
|
end
|
60
53
|
end
|
61
54
|
end
|
data/lib/evertils/type.rb
CHANGED
@@ -22,7 +22,7 @@ module Evertils
|
|
22
22
|
body: @content,
|
23
23
|
parent_notebook: self.class::NOTEBOOK,
|
24
24
|
tags: tags || [],
|
25
|
-
colour: self.class
|
25
|
+
colour: self.class::COLOUR
|
26
26
|
}
|
27
27
|
|
28
28
|
raise 'Invalid title' if @title.nil?
|
@@ -35,10 +35,13 @@ module Evertils
|
|
35
35
|
#
|
36
36
|
# @since 0.3.7
|
37
37
|
def should_create?
|
38
|
-
note_title = @format.date_templates[NOTEBOOK]
|
38
|
+
note_title = @format.date_templates[self.class::NOTEBOOK]
|
39
39
|
found = @model.find_note_contents(note_title)
|
40
|
+
result = found.entity.nil?
|
40
41
|
|
41
|
-
|
42
|
+
Notify.warning "#{self.class.name} skipped, note already exists" unless result
|
43
|
+
|
44
|
+
result
|
42
45
|
end
|
43
46
|
end
|
44
47
|
end
|
@@ -26,8 +26,11 @@ module Evertils
|
|
26
26
|
|
27
27
|
monthly_note_title = @format.date_templates[NOTEBOOK]
|
28
28
|
found = @model.find_note_contents(monthly_note_title)
|
29
|
+
result = found.entity.nil? && today_is_first_of_month
|
29
30
|
|
30
|
-
|
31
|
+
Notify.warning "#{self.class.name} skipped, note already exists" unless result
|
32
|
+
|
33
|
+
result
|
31
34
|
end
|
32
35
|
end
|
33
36
|
end
|
@@ -26,8 +26,11 @@ module Evertils
|
|
26
26
|
|
27
27
|
weekly_note_title = @format.date_templates[NOTEBOOK]
|
28
28
|
found = @model.find_note_contents(weekly_note_title)
|
29
|
+
result = found.entity.nil? && is_monday
|
29
30
|
|
30
|
-
|
31
|
+
Notify.warning "#{self.class.name} skipped, note already exists" unless result
|
32
|
+
|
33
|
+
result
|
31
34
|
end
|
32
35
|
end
|
33
36
|
end
|
data/lib/evertils/version.rb
CHANGED