evertils 0.3.16 → 0.3.17
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/type.rb +3 -5
- data/lib/evertils/types/monthly.rb +2 -2
- data/lib/evertils/types/weekly.rb +1 -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: 561c28824de0f475fed905f3ad995a484f363533
|
4
|
+
data.tar.gz: e8ffe5ac1387992629396c333bb9c0096e41fe46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f096438ac57c7500fb97c5c0ec24f4cebd33d7a0cb5ee394edd6c7b42efed535ded0c1d9021161d80dee4b3a98da0e22ae7d72bcbe3a02f1384984d75b3b9151
|
7
|
+
data.tar.gz: 9bf09c2ded96a58e8fc60636ae5cada0604edfc88213bc7c991bb92cd992bfe484b64be398972eb256acc54cd1a1287c2bb3b85586465edc73b77712277d80a9
|
data/lib/evertils/type.rb
CHANGED
@@ -23,7 +23,7 @@ module Evertils
|
|
23
23
|
def create
|
24
24
|
data = {
|
25
25
|
title: @title,
|
26
|
-
body: @content.delete!("\n"),
|
26
|
+
body: @content.to_s.delete!("\n"),
|
27
27
|
parent_notebook: self.class::NOTEBOOK,
|
28
28
|
tags: tags || [],
|
29
29
|
colour: self.class::COLOUR
|
@@ -41,7 +41,7 @@ module Evertils
|
|
41
41
|
def should_create?
|
42
42
|
@note = find_note(self.class::NOTEBOOK)
|
43
43
|
@entity = @note.entity
|
44
|
-
result = @
|
44
|
+
result = @entity.nil?
|
45
45
|
|
46
46
|
Notify.warning "#{self.class.name} skipped, note already exists" unless result
|
47
47
|
|
@@ -65,10 +65,8 @@ module Evertils
|
|
65
65
|
(1..MAX_SEARCH_SIZE).each do |iter|
|
66
66
|
Notify.info(" (#{iter}) #{notebook}")
|
67
67
|
note = find_note(notebook, true)
|
68
|
-
break unless note.entity.nil?
|
68
|
+
break unless note.entity.nil? || iter == MAX_SEARCH_SIZE
|
69
69
|
end
|
70
|
-
|
71
|
-
Notify.info("#{iter} attempts to find #{notebook} note") unless iter.zero?
|
72
70
|
end
|
73
71
|
|
74
72
|
note
|
@@ -26,7 +26,7 @@ module Evertils
|
|
26
26
|
|
27
27
|
@note = find_note(NOTEBOOK)
|
28
28
|
@entity = @note.entity
|
29
|
-
result = @
|
29
|
+
result = @entity.nil? && today_is_first_of_month
|
30
30
|
|
31
31
|
Notify.warning "#{self.class.name} skipped, note already exists" unless result
|
32
32
|
|
@@ -41,7 +41,7 @@ module Evertils
|
|
41
41
|
# include the XML element builder
|
42
42
|
xml_helper = Evertils::Helper.load('Xml', xml)
|
43
43
|
# find the note entity we want to link
|
44
|
-
linked_note =
|
44
|
+
linked_note = wait_for(:Weekly).entity
|
45
45
|
|
46
46
|
# don't add the note link if it is already there
|
47
47
|
unless xml.search("a[href='#{internal_url_for(linked_note)}']").size.zero?
|
@@ -27,7 +27,7 @@ module Evertils
|
|
27
27
|
# include the XML element builder
|
28
28
|
xml_helper = Evertils::Helper.load('Xml', xml)
|
29
29
|
# find the note entity we want to link
|
30
|
-
linked_note =
|
30
|
+
linked_note = wait_for(:Daily).entity
|
31
31
|
|
32
32
|
# don't add the note link if it is already there
|
33
33
|
unless xml.search("a[href='#{internal_url_for(linked_note)}']").size.zero?
|
data/lib/evertils/version.rb
CHANGED