evertils 0.3.20 → 0.3.21
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 +1 -1
- data/lib/evertils/helpers/api-enml-handler.rb +3 -7
- data/lib/evertils/helpers/note.rb +1 -1
- data/lib/evertils/types/monthly.rb +6 -5
- data/lib/evertils/types/priority-queue.rb +1 -3
- data/lib/evertils/types/weekly.rb +6 -5
- 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: 20c36a98c336c394c744d795875d052e68bef5bd
|
4
|
+
data.tar.gz: 87d09f3440aa416fc002952ea0097ff1ec485dbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cd8e239d03e74d3c511f79442bf04da0b787e38fc25214232a8601d215459e7f6b3f851f738c769268208ec322e4b13672cc4b816b5768cf51699f2c6367545
|
7
|
+
data.tar.gz: 0f3df2fea341aac93f150e6facf06e9057f68083672c3974f62ddbe0ba02c5759f619e7f03ca54434380d5bd0ee55f502e437a6ec6b8f2213a6bcfe3c91d6752
|
@@ -25,11 +25,7 @@ module Evertils
|
|
25
25
|
#
|
26
26
|
# @since 0.3.7
|
27
27
|
def convert_to_xml(enml)
|
28
|
-
|
29
|
-
enml = enml.split("\n")
|
30
|
-
enml.shift(2)
|
31
|
-
|
32
|
-
@xml = from_str(enml.join)
|
28
|
+
@xml = from_str(enml)
|
33
29
|
self
|
34
30
|
end
|
35
31
|
alias to_xml convert_to_xml
|
@@ -62,9 +58,9 @@ module Evertils
|
|
62
58
|
# lets replace it with a new DTD if that is the case
|
63
59
|
# @since 0.3.15
|
64
60
|
def fix_dtd
|
65
|
-
if @xml.children.
|
61
|
+
if @xml.children[0].is_a?(Text)
|
66
62
|
# remove the existing broken DTD
|
67
|
-
@xml.children.
|
63
|
+
@xml.children[0].remove
|
68
64
|
# create a new one (note: output is overridden in DTD class defined
|
69
65
|
# below ApiEnmlHandler)
|
70
66
|
dtd = DTD.new('DOCTYPE', @xml)
|
@@ -36,22 +36,23 @@ module Evertils
|
|
36
36
|
#
|
37
37
|
# @since 0.3.15
|
38
38
|
def add_weekly_note_link
|
39
|
+
wk_entity = @note_helper.wait_for(:Weekly).entity
|
39
40
|
# parse the ENML note data into something we can work with
|
40
41
|
xml = @api.from_str(@entity.content)
|
41
42
|
# include the XML element builder
|
42
43
|
xml_helper = Evertils::Helper.load('Xml', xml)
|
43
|
-
#
|
44
|
-
|
44
|
+
# internal URL for the linked note
|
45
|
+
note_url = @note_helper.internal_url_for(wk_entity)
|
45
46
|
|
46
47
|
# don't add the note link if it is already there
|
47
|
-
unless xml.search("a[href='#{
|
48
|
+
unless xml.search("a[href='#{note_url}']").size.zero?
|
48
49
|
return Notify.warning('Weekly note link already exists here, exiting to avoid duplicate content')
|
49
50
|
end
|
50
51
|
|
51
52
|
a = xml_helper.a(
|
52
|
-
|
53
|
+
note_url,
|
53
54
|
@format.date_templates[:Weekly]
|
54
|
-
|
55
|
+
)
|
55
56
|
li = xml_helper.li(a)
|
56
57
|
br = xml_helper.br
|
57
58
|
|
@@ -28,7 +28,7 @@ module Evertils
|
|
28
28
|
day = Date.today
|
29
29
|
note = nil
|
30
30
|
|
31
|
-
Notify.info('Searching for...')
|
31
|
+
Notify.info('Searching for last PQ...')
|
32
32
|
|
33
33
|
(1..MAX_SEARCH_SIZE).each do |iter|
|
34
34
|
day -= 1
|
@@ -45,8 +45,6 @@ module Evertils
|
|
45
45
|
break unless note.nil?
|
46
46
|
end
|
47
47
|
|
48
|
-
raise 'Queue was not found' unless note
|
49
|
-
|
50
48
|
@handler.convert_to_xml(note.content).prepare
|
51
49
|
end
|
52
50
|
end
|
@@ -22,22 +22,23 @@ module Evertils
|
|
22
22
|
#
|
23
23
|
# @since 0.3.15
|
24
24
|
def add_daily_note_link
|
25
|
+
da_entity = @note_helper.wait_for(:Daily).entity
|
25
26
|
# parse the ENML note data into something we can work with
|
26
27
|
xml = @api.from_str(@entity.content)
|
27
28
|
# include the XML element builder
|
28
29
|
xml_helper = Evertils::Helper.load('Xml', xml)
|
29
|
-
#
|
30
|
-
|
30
|
+
# internal URL for the linked note
|
31
|
+
note_url = @note_helper.internal_url_for(da_entity)
|
31
32
|
|
32
33
|
# don't add the note link if it is already there
|
33
|
-
unless xml.search("a[href='#{
|
34
|
+
unless xml.search("a[href='#{note_url}']").size.zero?
|
34
35
|
return Notify.warning('Daily note link already exists here, exiting to avoid duplicate content')
|
35
36
|
end
|
36
37
|
|
37
38
|
a = xml_helper.a(
|
38
|
-
|
39
|
+
note_url,
|
39
40
|
@format.date_templates[:Daily]
|
40
|
-
|
41
|
+
)
|
41
42
|
li = xml_helper.li(a)
|
42
43
|
br = xml_helper.br
|
43
44
|
|
data/lib/evertils/version.rb
CHANGED