event_nlp 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/event_nlp.rb +12 -1
- data.tar.gz.sig +0 -0
- 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: 947e5f9695c93cc625ad9007c61ff80afa8191ff
|
4
|
+
data.tar.gz: 9199d0152c313cc0fdbfd11a8b68c020e6398f82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8caf2256f0923e0a33ba35a14e648023a39dd1eb9300b0b1d00cf30d911c02073ec1a0e313ab7d9590f8fa4b801d48a11795d9657f12649106e2b6151db85d50
|
7
|
+
data.tar.gz: 3be7a1c81e86f5a664e0678865b9cc97cba0e4eacc602a12f46db7085a976aa097281f7fa0b5162119a3f52bb4fe6bf0ecc20626798b3b784cf0f8257d5d3844
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/event_nlp.rb
CHANGED
@@ -146,6 +146,8 @@ class EventNlp
|
|
146
146
|
# some event every 2nd Monday (starting 7th Nov 2016)
|
147
147
|
# some event every 2nd Monday (starting 7th Nov until 3rd Dec)
|
148
148
|
# some event every 2 weeks (starting 02/11/17)
|
149
|
+
# some event every Wednesday 1pm-4pm
|
150
|
+
#
|
149
151
|
get /^(.*)(every .*)/ do |title, recurring|
|
150
152
|
|
151
153
|
raw_start_date = recurring[/(?<=starting )[^\)]+/]
|
@@ -159,12 +161,19 @@ class EventNlp
|
|
159
161
|
cf = CronFormat.new(exp, start_date - 1)
|
160
162
|
#cf.next until cf.to_time >= start_date
|
161
163
|
else
|
164
|
+
exp = ChronicCron.new(recurring).to_expression
|
162
165
|
cf = CronFormat.new(exp, @now)
|
163
166
|
end
|
167
|
+
|
164
168
|
d = cf.to_time
|
165
169
|
|
170
|
+
if recurring =~ /-/ then
|
171
|
+
end_date = Chronic.parse d.to_date.to_s + ' ' +
|
172
|
+
recurring[/(?<=-)\d+(?::\d+)?(?:[ap]m)?/]
|
173
|
+
end
|
174
|
+
|
166
175
|
puts [0.5, title, recurring, d].inspect if @debug
|
167
|
-
{title: title.rstrip, recurring: recurring, date: d }
|
176
|
+
{title: title.rstrip, recurring: recurring, date: d, end_date: end_date }
|
168
177
|
|
169
178
|
end
|
170
179
|
|
@@ -277,6 +286,7 @@ class EventNlp
|
|
277
286
|
|
278
287
|
get /^(.*) (#{days}) (#{months}) from (#{times2})/i do |title, day, month, xtimes|
|
279
288
|
|
289
|
+
puts 'before xtimes : ' + xtimes.inspect
|
280
290
|
t1, t2 = xtimes.split(/-/,2)
|
281
291
|
|
282
292
|
d1 = Chronic.parse([month, day, t1].join(' '))
|
@@ -291,6 +301,7 @@ class EventNlp
|
|
291
301
|
|
292
302
|
get '*' do
|
293
303
|
|
304
|
+
puts 'or else'
|
294
305
|
s = params[:input]
|
295
306
|
|
296
307
|
time1, time2, month, weekday, day, end_date, annualar = nil, nil, nil,
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_nlp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
/WtgKLMzCAKTHZ2OpN3OTs6j+vsUBIwCb/Ki17Z4YULtRaGg7I8nTjTrHIIJ0yNm
|
32
32
|
kbRihMTezaC+4A==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-11-
|
34
|
+
date: 2017-11-19 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: chronic_cron
|
metadata.gz.sig
CHANGED
Binary file
|