gnu-remind 0.1.4 → 0.1.5
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/remind/version.rb +1 -1
- data/lib/remind.rb +27 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8302802a937430ef1ad975d6616ec60e3426f571ab67362f618396623184469
|
4
|
+
data.tar.gz: bab3dbb5c8cec7b55e84caa4e30bb7f31fccf60feb9ebfec9232c796d98cc438
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432e323c67bb3b876db61bc967bb2dedabee7ff5ed2f73a3fce029f9c2f1efb00b28464c7ebf6d4a64827fa8345ce1da5b3163e81956cca1fb796c7c999b9921
|
7
|
+
data.tar.gz: f7757d9b561d015faa63880d888447739b2a6317e462cc1b65a9f794309e81ebe11f8ff45fba35b76b519ae4e0fa35fe9e0949ee1c687cf5440e8a3252d80927
|
data/lib/remind/version.rb
CHANGED
data/lib/remind.rb
CHANGED
@@ -13,28 +13,42 @@ require_relative "remind/calendar"
|
|
13
13
|
module Remind
|
14
14
|
class Error < StandardError; end
|
15
15
|
@@REM = REM['reminders']
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
@@INIT = []
|
17
|
+
@@URL = []
|
18
|
+
def self.init h={}
|
19
|
+
@@INIT << h
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.url u
|
23
|
+
@@URL << u
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.rebuild!
|
19
27
|
@@REM.clear!
|
20
|
-
[
|
21
|
-
r[x[:what]].attr = { date: x[:when] }
|
28
|
+
[@@INIT].flatten.each do |x|
|
22
29
|
@@REM[x[:what]].attr = { date: x[:when] }
|
23
30
|
end
|
24
|
-
|
25
|
-
CAL.from_url(
|
31
|
+
@@URL.each do |u|
|
32
|
+
CAL.from_url(u).each do |e|
|
33
|
+
d = e.when[:begin].to_time.localtime.strftime("%Y/%m/%d-%R")
|
26
34
|
h = {
|
27
35
|
date: e.when[:begin].to_time.localtime.strftime("%-d %b %Y"),
|
28
36
|
hour: e.when[:begin].to_time.localtime.strftime("%k"),
|
29
37
|
minute: e.when[:begin].to_time.localtime.strftime("%M"),
|
30
38
|
at: e.where,
|
31
39
|
type: e.who,
|
32
|
-
lead:
|
40
|
+
lead: 1
|
33
41
|
}
|
34
|
-
|
35
|
-
@@REM[
|
42
|
+
k = %[#{e.what} #{h[:type]} #{d}]
|
43
|
+
@@REM[k].attr = h
|
36
44
|
end
|
37
45
|
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.remote x, u
|
49
|
+
r = REM[x]
|
50
|
+
r.clear!
|
51
|
+
Remind.rebuild!
|
38
52
|
CAL.from_url(u).each do |e|
|
39
53
|
d = e.when[:begin].to_time.localtime.strftime("%Y/%m/%d-%R")
|
40
54
|
h = {
|
@@ -54,10 +68,13 @@ module Remind
|
|
54
68
|
@@REM.to_rem!
|
55
69
|
return nil
|
56
70
|
end
|
71
|
+
|
57
72
|
def self.[] k
|
58
73
|
REM[k].agenda[1..-1]
|
59
74
|
end
|
75
|
+
|
60
76
|
def self.all
|
77
|
+
@@REM.to_rem!
|
61
78
|
@@REM.agenda[1..-1]
|
62
79
|
end
|
63
80
|
end
|