reminders_txt 0.3.7 → 0.3.8
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/reminders_txt.rb +10 -7
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0b16db43889591e5c776d8b7f79bcd8b5d7d7039
|
|
4
|
+
data.tar.gz: 07ed00f327fc580d3afc3892344ac9bc218565d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7455ef7df8b4c2fc2801af36369aad634cbf5d45b0ce328c5be02c2931036d176d23368e132c6356c93ef80d6761758aa7df663000929358798e4bc52c1a09a0
|
|
7
|
+
data.tar.gz: 1c3c7b39b49ad4525b4f4fc7a180bc5eae89b5aa074395c7e18cd4eddcf36b50a031dce63d7790c2d638ae7f71d05975786a2bed3ac810ffb0f1046b629b89f5
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/reminders_txt.rb
CHANGED
|
@@ -11,7 +11,7 @@ require 'chronic_cron'
|
|
|
11
11
|
|
|
12
12
|
module Ordinals
|
|
13
13
|
|
|
14
|
-
refine
|
|
14
|
+
refine Integer do
|
|
15
15
|
def ordinal
|
|
16
16
|
self.to_s + ( (10...20).include?(self) ? 'th' :
|
|
17
17
|
%w{ th st nd rd th th th th th th }[self % 10] )
|
|
@@ -27,23 +27,26 @@ class RemindersTxt
|
|
|
27
27
|
|
|
28
28
|
attr_reader :reminders
|
|
29
29
|
|
|
30
|
-
def initialize(
|
|
30
|
+
def initialize(raw_s='reminders.txt', now: Time.now)
|
|
31
31
|
|
|
32
32
|
super()
|
|
33
33
|
|
|
34
34
|
@now = now
|
|
35
|
-
@filepath =
|
|
35
|
+
@filepath = raw_s
|
|
36
36
|
|
|
37
|
-
if
|
|
38
|
-
|
|
37
|
+
if raw_s.lines.length > 1 then
|
|
38
|
+
@filepath = 'reminders.xml'
|
|
39
|
+
@dx = Dynarex.new raw_s
|
|
40
|
+
elsif File.extname(@filepath) == '.txt'
|
|
41
|
+
import_txt(@filepath)
|
|
39
42
|
refresh()
|
|
40
43
|
else
|
|
41
|
-
@dx = Dynarex.new filepath
|
|
44
|
+
@dx = Dynarex.new @filepath
|
|
42
45
|
end
|
|
43
46
|
end
|
|
44
47
|
|
|
45
48
|
def upcoming(ndays=5, days: ndays)
|
|
46
|
-
@dx.filter {|x| Date.parse(x.date) <=
|
|
49
|
+
@dx.filter {|x| Date.parse(x.date) <= @now.to_date + days.to_i}
|
|
47
50
|
end
|
|
48
51
|
|
|
49
52
|
def updated?()
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: reminders_txt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
n+SSd9dm8JjhZ2pqHtX+bgMZ18hrN06xfR+UPtk5BKC8v1PC0FWxaVR4lom39rFU
|
|
32
32
|
seDxJNsJgamAKg==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2016-12-
|
|
34
|
+
date: 2016-12-25 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: dynarex
|
metadata.gz.sig
CHANGED
|
Binary file
|