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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6149e372ee4292afde897782c7359cc3fe6876159f91b66d6dea2660d5595530
4
- data.tar.gz: 1eea367f28f107f4c99743db6a2e1539c1415dd05276a3115c1de7edc656f6f0
3
+ metadata.gz: 46e172556837650d117663d4dc02b9e3a12a40929da5ac8af29d6f8020f7628b
4
+ data.tar.gz: 743ba42e615aec2ddd988784e94ff4130ab2446a8799e683fd3fd9c8cefb2e76
5
5
  SHA512:
6
- metadata.gz: ab7dfbe16607ce43ed601e818d901eeea7981253566632f5fbc2d7f4106783ed0571d306d3d2324bc59114a8a7b3ebd30cf3aa4581a1331c661b1eb4ca2bbbc0
7
- data.tar.gz: 25f6632fd16aa9010e8e97ebaaebafa960647ade45b24967483f382a76f4d562b464905362834c20783b676f86b0051f15a48fa1d055cdfbe52456f7ec358adc
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 %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.3"
5
5
  end
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.[]= 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
+ }
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
- r[e.what].attr = h
29
- @@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
30
51
  end
31
52
  r.to_rem!
32
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson