gnu-remind 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remind/remind.rb +2 -5
- data/lib/remind/version.rb +1 -1
- data/lib/remind.rb +24 -3
- 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: 46e172556837650d117663d4dc02b9e3a12a40929da5ac8af29d6f8020f7628b
|
4
|
+
data.tar.gz: 743ba42e615aec2ddd988784e94ff4130ab2446a8799e683fd3fd9c8cefb2e76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fd661422f0d7132ff199aba2f58480fa4f195f597d96a04000a05bfeea68ac1e99c68f01f657f0c83a0e18df08d323bf5a7db181672daf4adaf742f293cf06d
|
7
|
+
data.tar.gz: 7a06720a9dcd705fe04b5f63e53f2bd60f28023c90565edf5fe025da9be8e071aa6892f8c75c5681ede735a60beb757351b2f8df7732cefb815038b26afc5653
|
data/lib/remind/remind.rb
CHANGED
@@ -45,12 +45,9 @@ class R
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def id; @id; end
|
48
|
-
|
48
|
+
|
49
49
|
def to_rem
|
50
50
|
a, i = [], [ @id ]
|
51
|
-
if @attr.has_key? :type
|
52
|
-
i << %[#{@attr[:type]}]
|
53
|
-
end
|
54
51
|
if @attr.has_key? :date
|
55
52
|
a << %[#{@attr[:date]}]
|
56
53
|
if @attr.has_key? :lead
|
@@ -76,7 +73,7 @@ class R
|
|
76
73
|
if @attr.has_key? :at
|
77
74
|
i << %[at #{@attr[:at]}]
|
78
75
|
end
|
79
|
-
return %[REM #{a.join(" ")} MSG
|
76
|
+
return %[REM #{a.join(" ")} MSG #{i.join(" ")}]
|
80
77
|
end
|
81
78
|
end
|
82
79
|
|
data/lib/remind/version.rb
CHANGED
data/lib/remind.rb
CHANGED
@@ -13,11 +13,29 @@ require_relative "remind/calendar"
|
|
13
13
|
module Remind
|
14
14
|
class Error < StandardError; end
|
15
15
|
@@REM = REM['reminders']
|
16
|
-
def self.
|
16
|
+
def self.make x, u, *i
|
17
17
|
r = REM[x]
|
18
18
|
r.clear!
|
19
19
|
@@REM.clear!
|
20
|
+
[i].flatten.each do |x|
|
21
|
+
r[x[:what]].attr = { date: x[:when] }
|
22
|
+
@@REM[x[:what]].attr = { date: x[:when] }
|
23
|
+
end
|
24
|
+
if ENV.has_key? 'ICS'
|
25
|
+
CAL.from_url(ENV['ICS']).each do |e|
|
26
|
+
h = {
|
27
|
+
date: e.when[:begin].to_time.localtime.strftime("%-d %b %Y"),
|
28
|
+
hour: e.when[:begin].to_time.localtime.strftime("%k"),
|
29
|
+
minute: e.when[:begin].to_time.localtime.strftime("%M"),
|
30
|
+
at: e.where,
|
31
|
+
type: e.who
|
32
|
+
}
|
33
|
+
r[e.what].attr = h
|
34
|
+
@@REM[e.what].attr = h
|
35
|
+
end
|
36
|
+
end
|
20
37
|
CAL.from_url(u).each do |e|
|
38
|
+
d = e.when[:begin].to_time.localtime.strftime("%Y/%m/%d-%R")
|
21
39
|
h = {
|
22
40
|
date: e.when[:begin].to_time.localtime.strftime("%-d %b %Y"),
|
23
41
|
hour: e.when[:begin].to_time.localtime.strftime("%k"),
|
@@ -25,8 +43,11 @@ module Remind
|
|
25
43
|
at: e.where,
|
26
44
|
type: e.who
|
27
45
|
}
|
28
|
-
|
29
|
-
|
46
|
+
|
47
|
+
k = %[#{e.what} #{h[:type]} #{d}]
|
48
|
+
puts "#{k}: #{h}"
|
49
|
+
r[k].attr = h
|
50
|
+
@@REM[k].attr = h
|
30
51
|
end
|
31
52
|
r.to_rem!
|
32
53
|
@@REM.to_rem!
|