gnu-remind 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19f351fdad385e0cef56e9aa6fac54ce5824a17069287e27402d9fd43471079b
4
- data.tar.gz: fcb66234ebdb7061d1a89003d79d972bcf539bee5ab9b26d2d8a9d4338125aa0
3
+ metadata.gz: 46e172556837650d117663d4dc02b9e3a12a40929da5ac8af29d6f8020f7628b
4
+ data.tar.gz: 743ba42e615aec2ddd988784e94ff4130ab2446a8799e683fd3fd9c8cefb2e76
5
5
  SHA512:
6
- metadata.gz: 812a96c7d7f7adeb7fcd47ec25144c19fa557ad91cfebed8a3be6966ad0b9821b89ee536db561707362fcbb2fd5755b0bce346b9f755edabef67debe167ceb42
7
- data.tar.gz: d3e5c1d41099d465ae6b7f998a71578c802398c6ccd058448c1374a669d7159ef934122c513201db183dcd80aefe5a06ae5a919e209c5e07f51c1fbc0b25d644
6
+ metadata.gz: 4fd661422f0d7132ff199aba2f58480fa4f195f597d96a04000a05bfeea68ac1e99c68f01f657f0c83a0e18df08d323bf5a7db181672daf4adaf742f293cf06d
7
+ data.tar.gz: 7a06720a9dcd705fe04b5f63e53f2bd60f28023c90565edf5fe025da9be8e071aa6892f8c75c5681ede735a60beb757351b2f8df7732cefb815038b26afc5653
data/lib/remind/remind.rb CHANGED
@@ -17,7 +17,7 @@ class E
17
17
  end
18
18
 
19
19
  def clear!
20
- @red = []
20
+ @rem = []
21
21
  end
22
22
 
23
23
  def to_rem
@@ -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 %b %2 #{i.join(" ")}]
76
+ return %[REM #{a.join(" ")} MSG #{i.join(" ")}]
80
77
  end
81
78
  end
82
79
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Remind
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/remind.rb CHANGED
@@ -13,9 +13,29 @@ require_relative "remind/calendar"
13
13
  module Remind
14
14
  class Error < StandardError; end
15
15
  @@REM = REM['reminders']
16
- def self.[]= x, u
16
+ def self.make x, u, *i
17
17
  r = REM[x]
18
+ r.clear!
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
18
37
  CAL.from_url(u).each do |e|
38
+ d = e.when[:begin].to_time.localtime.strftime("%Y/%m/%d-%R")
19
39
  h = {
20
40
  date: e.when[:begin].to_time.localtime.strftime("%-d %b %Y"),
21
41
  hour: e.when[:begin].to_time.localtime.strftime("%k"),
@@ -23,8 +43,11 @@ module Remind
23
43
  at: e.where,
24
44
  type: e.who
25
45
  }
26
- r[e.what].attr = h
27
- @@REM[e.what].attr = h
46
+
47
+ k = %[#{e.what} #{h[:type]} #{d}]
48
+ puts "#{k}: #{h}"
49
+ r[k].attr = h
50
+ @@REM[k].attr = h
28
51
  end
29
52
  r.to_rem!
30
53
  @@REM.to_rem!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnu-remind
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson