gnu-remind 0.1.2 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6149e372ee4292afde897782c7359cc3fe6876159f91b66d6dea2660d5595530
4
- data.tar.gz: 1eea367f28f107f4c99743db6a2e1539c1415dd05276a3115c1de7edc656f6f0
3
+ metadata.gz: 0b779171299941272c40a69f2c88d4b34bc5fc85dc239a75ae0d9e8a7f8eccb4
4
+ data.tar.gz: 44e7b58ad3a0ff1cae715438f216761eb345c0a2966da71a499e59b8998eef59
5
5
  SHA512:
6
- metadata.gz: ab7dfbe16607ce43ed601e818d901eeea7981253566632f5fbc2d7f4106783ed0571d306d3d2324bc59114a8a7b3ebd30cf3aa4581a1331c661b1eb4ca2bbbc0
7
- data.tar.gz: 25f6632fd16aa9010e8e97ebaaebafa960647ade45b24967483f382a76f4d562b464905362834c20783b676f86b0051f15a48fa1d055cdfbe52456f7ec358adc
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 %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.2"
4
+ VERSION = "0.1.4"
5
5
  end
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.[]= x, u
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
- r[e.what].attr = h
29
- @@REM[e.what].attr = h
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!
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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson