evertils 0.3.26 → 0.3.27
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/lib/evertils/controllers/log.rb +4 -0
- data/lib/evertils/type.rb +2 -2
- data/lib/evertils/types/daily.rb +6 -3
- data/lib/evertils/types/monthly.rb +0 -14
- data/lib/evertils/types/weekly.rb +5 -0
- 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: 720ca09dc9d7d89afa4d74339198a311f227d76b
|
4
|
+
data.tar.gz: 9cd601199146d6c4eca7e5ae88f55824d2dfb468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9159ebab49b3e62737224e13c9bf16a43271551f7242f9b38b643d5698b8b858becf2ca3db4a15c34e01c6c4f6ec1b77b26f7f5fa741307dd104cae76cf02247
|
7
|
+
data.tar.gz: 3ef0e54ced274549b7d29a5ec03e3c9acbaf55f04fa3caedcbfbfc1f3996e3043450ee9247642a8bd2756e2c946445927b00d1d5fadda028a4cc9ffee7bea508
|
@@ -40,6 +40,10 @@ module Evertils
|
|
40
40
|
|
41
41
|
# append the log message to the target
|
42
42
|
target.add_child(log_message_el)
|
43
|
+
# remove XML processing definition if it is the second element
|
44
|
+
if xml.children[1].is_a?(Nokogiri::XML::ProcessingInstruction)
|
45
|
+
xml.children[1].remove
|
46
|
+
end
|
43
47
|
|
44
48
|
note.entity.content = xml.to_s
|
45
49
|
Notify.success("Item logged at #{time}") if note.update
|
data/lib/evertils/type.rb
CHANGED
@@ -13,7 +13,7 @@ module Evertils
|
|
13
13
|
@note_helper = Evertils::Helper.load('Note')
|
14
14
|
@format = Evertils::Helper.load('Formatting')
|
15
15
|
|
16
|
-
@config = config
|
16
|
+
@config = config
|
17
17
|
@api = Evertils::Helper.load('ApiEnmlHandler', @config)
|
18
18
|
@args = args unless args.size.zero?
|
19
19
|
end
|
@@ -51,7 +51,7 @@ module Evertils
|
|
51
51
|
#
|
52
52
|
# @since 0.3.15
|
53
53
|
def morning_note?
|
54
|
-
!caller.grep(/morning/).
|
54
|
+
!caller.grep(/morning/).empty?
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
data/lib/evertils/types/daily.rb
CHANGED
@@ -32,18 +32,21 @@ module Evertils
|
|
32
32
|
# @since 0.3.13
|
33
33
|
def attach_pq_note
|
34
34
|
enml = @api.from_str(@format.template_contents(NOTEBOOK))
|
35
|
-
|
36
35
|
pq = @note_helper.wait_for(:'Priority Queue')
|
37
|
-
|
38
36
|
xml_conf = {
|
39
37
|
href: @note_helper.internal_url_for(pq.entity),
|
40
38
|
content: @format.date_templates[:'Priority Queue']
|
41
39
|
}
|
42
|
-
|
43
40
|
xml = Evertils::Helper.load('Xml', enml)
|
44
41
|
a = xml.create(:a, xml_conf)
|
45
42
|
|
46
43
|
enml.at('li:contains("Queue") ul li').children.first.replace(a)
|
44
|
+
|
45
|
+
# remove dtd if it is the first element
|
46
|
+
if enml.children.first.is_a?(Evertils::Helper::DTD)
|
47
|
+
enml.children.first.remove
|
48
|
+
end
|
49
|
+
|
47
50
|
@content = enml
|
48
51
|
end
|
49
52
|
end
|
@@ -19,20 +19,6 @@ module Evertils
|
|
19
19
|
["month-#{Date.today.month}"]
|
20
20
|
end
|
21
21
|
|
22
|
-
#
|
23
|
-
# @since 0.3.7
|
24
|
-
def should_create?
|
25
|
-
today_is_first_of_month = Date.today.day == 1
|
26
|
-
|
27
|
-
@note = @note_helper.find_note(NOTEBOOK)
|
28
|
-
@entity = @note.entity
|
29
|
-
result = @entity.nil? && today_is_first_of_month
|
30
|
-
|
31
|
-
Notify.warning "#{self.class.name} skipped, note already exists" unless result
|
32
|
-
|
33
|
-
result
|
34
|
-
end
|
35
|
-
|
36
22
|
#
|
37
23
|
# @since 0.3.15
|
38
24
|
def add_weekly_note_link
|
@@ -52,6 +52,11 @@ module Evertils
|
|
52
52
|
xml.search('en-note>div:first-child').after(br)
|
53
53
|
end
|
54
54
|
|
55
|
+
# remove XML processing definition if it is the second element
|
56
|
+
if xml.children[1].is_a?(Nokogiri::XML::ProcessingInstruction)
|
57
|
+
xml.children[1].remove
|
58
|
+
end
|
59
|
+
|
55
60
|
@entity.content = xml.to_s
|
56
61
|
|
57
62
|
Notify.success("#{self.class.name} updated, added daily note link") if @note.update
|
data/lib/evertils/version.rb
CHANGED