reminders_txt 0.3.4 → 0.3.5

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
  SHA1:
3
- metadata.gz: cdef8b14487344306d7c51cbca1b0c4762d84cca
4
- data.tar.gz: 8a0834e882eff028e90948ee1578e6c47bd72eac
3
+ metadata.gz: 3b9339ce4b39359e3a81880f3ebd5c811b809a21
4
+ data.tar.gz: 1cf904cf2c0c51e93b18404f12e6ab69790ff3f4
5
5
  SHA512:
6
- metadata.gz: 69c5d2c7f3d7894b3ab9092bebda0eef028ae0179f4574c89eda0b258ecc118b6088d046d53fc015302391340b3f70f38ac667373dc58003c0b83ea661a42d48
7
- data.tar.gz: 3088b001e9cfa5aaaa13856f2265d1c2f862d1b49b992f74697dd56bf7e170a451353f9eccc9b9b75772cbab1052b21eb8cd91245f84e8a874e15e9ed69dbdf1
6
+ metadata.gz: 59290dc4cff2795294046bff630e66e01b51ed70e7752b5bf16af1db484fc41785c9ff4b48186bf85773f0b79f8d2d572a3f8a2986d52860f10f3c5a8617d47d
7
+ data.tar.gz: 2e04c0522eef08da8618b3072c0d722e2236c983af4b93fae1d8e2a5e412677ce76f4dadc8fdea4ec992bf277fddb5d96d64b90eb34cf47bad340a20df419d17
@@ -1 +1,3 @@
1
- uL[�sUnI�j�N>$��6}��s5��F��܆���G��{�]���G�T��ʖ}
1
+ zh�^���P?&����5Nt���R��Wy�
2
+ �T�����d&���o\w���(bFA�U��|wE78E�.�x“qN��ٸת�R�u\3���UL+;Bz`��%�oL3�y��<���k��J�^�Vw�+ѧ��¡�:c�edNTI �k���O�C��Z:;��w�5�9�+��}��_����G����!����
3
+ �q��p���
data.tar.gz.sig CHANGED
Binary file
@@ -91,7 +91,7 @@ class RemindersTxt
91
91
  end
92
92
 
93
93
  # delete expired non-recurring reminders
94
- @reminders.reject! {|x| x.date.to_time < @now if not x.recurring }
94
+ #@reminders.reject! {|x| x.date.to_time < @now if not x.recurring }
95
95
 
96
96
  @reminders.sort_by!(&:date)
97
97
 
@@ -137,6 +137,7 @@ class RemindersTxt
137
137
 
138
138
 
139
139
  starting = /(?:\(?\s*starting (\d+\w{2} \w+\s*\w*)(?: until (.*))?\s*\))?/
140
+ weekday = Date::DAYNAMES.join('|').downcase
140
141
 
141
142
  get /^(.*)(every \w+ \w+(?: at (\d+am) )?)\s*#{starting}/ do \
142
143
  |title, recurring, time, raw_date, end_date|
@@ -160,19 +161,32 @@ class RemindersTxt
160
161
  end
161
162
 
162
163
 
164
+ #puts [0, title, recurring, time, raw_date, end_date].inspect
163
165
  OpenStruct.new input: input, title: title, recurring: recurring,
164
166
  date: d, end_date: end_date
165
- #[0, title, recurring, time, date, end_date].inspect
167
+
166
168
  end
167
169
 
168
170
  # some meeting 3rd thursday of the month at 7:30pm
169
171
  # some meeting First thursday of the month at 7:30pm
170
172
  get /(.*)\s+(\w+ \w+day of (?:the|every) month at .*)/ do |title, recurring|
171
-
173
+
174
+ #puts [1, title, recurring].inspect
172
175
  OpenStruct.new input: params[:input], title: title, recurring: recurring
173
- #[1, title, recurring].inspect
174
- end
176
+
177
+ end
178
+
179
+ # hall 2 friday at 11am
180
+ get /(.*)\s+(#{weekday})\s+at\s+(.*)/i do |title, raw_day, time|
181
+
182
+ d = Chronic.parse(raw_day + ' ' + time)
183
+
184
+ #puts [1.5, title, raw_day].inspect
185
+ OpenStruct.new input: params[:input], title: title, date: d
186
+
187
+ end
175
188
 
189
+ # hall 2 friday at 11am
176
190
  # some important day 24th Mar
177
191
  get /(.*)\s+(\d+[^\*]+)(\*)?/ do |title, raw_date, annualar|
178
192
 
@@ -188,9 +202,9 @@ class RemindersTxt
188
202
  end
189
203
  end
190
204
 
205
+ #puts [2, title, raw_date].inspect
191
206
  OpenStruct.new input: params[:input], title: title, date: d,
192
- recurring: recurring
193
- #[2, title, date].inspect
207
+ recurring: recurring
194
208
  end
195
209
 
196
210
  # 27-Mar@1436 some important day
@@ -208,9 +222,9 @@ class RemindersTxt
208
222
  end
209
223
 
210
224
 
225
+ #puts [3, title, raw_date].inspect
211
226
  OpenStruct.new input: params[:input], title: title, date: d,
212
- recurring: recurring
213
- #[3, title, date].inspect
227
+ recurring: recurring
214
228
  end
215
229
 
216
230
  # e.g. 04-Aug@12:34
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
4
+ version: 0.3.5
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-11-14 00:00:00.000000000 Z
34
+ date: 2016-11-15 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: dynarex
metadata.gz.sig CHANGED
Binary file