gnu-remind 0.1.2 → 0.1.4
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 +25 -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: 0b779171299941272c40a69f2c88d4b34bc5fc85dc239a75ae0d9e8a7f8eccb4
|
4
|
+
data.tar.gz: 44e7b58ad3a0ff1cae715438f216761eb345c0a2966da71a499e59b8998eef59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633cadf0e0eec59b72bdd8611ed087329ad98f00ddb3bf92da7b81bb9b0748bef7c87b48c49de7798b293619c3429990374beab768ac0e8a48c0eb3e4d75b1ec
|
7
|
+
data.tar.gz: 0d6a7e51f5236a36038ce5605a8332183cd1c145e05540feef9984e3106c8ceab6bd3babe712b9ae8548c525cbd7745d2daf69bca3dc43873eecdbb6a11f851a
|
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,30 @@ 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
|
+
lead: 30
|
33
|
+
}
|
34
|
+
r[e.what].attr = h
|
35
|
+
@@REM[e.what].attr = h
|
36
|
+
end
|
37
|
+
end
|
20
38
|
CAL.from_url(u).each do |e|
|
39
|
+
d = e.when[:begin].to_time.localtime.strftime("%Y/%m/%d-%R")
|
21
40
|
h = {
|
22
41
|
date: e.when[:begin].to_time.localtime.strftime("%-d %b %Y"),
|
23
42
|
hour: e.when[:begin].to_time.localtime.strftime("%k"),
|
@@ -25,8 +44,11 @@ module Remind
|
|
25
44
|
at: e.where,
|
26
45
|
type: e.who
|
27
46
|
}
|
28
|
-
|
29
|
-
|
47
|
+
|
48
|
+
k = %[#{e.what} #{h[:type]} #{d}]
|
49
|
+
puts "#{k}: #{h}"
|
50
|
+
r[k].attr = h
|
51
|
+
@@REM[k].attr = h
|
30
52
|
end
|
31
53
|
r.to_rem!
|
32
54
|
@@REM.to_rem!
|