event_nlp 0.2.5 → 0.2.6

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: 8318d97128aaad3a6386324073c58f18a46366c2
4
- data.tar.gz: 60a1627ce370b3a5a417f0a15abca3c1ab400ac6
3
+ metadata.gz: 3c93ee0375545f7575bb9964ef18ab00d85acd57
4
+ data.tar.gz: 6fc42b1f54e3bdb3707ab249509ab2a6347e8347
5
5
  SHA512:
6
- metadata.gz: 63175df72699714f5464bfa6689c979694e039ddcb9d7773a0345233c664329316036df8a79630e8f7b3aa54d26379ee85eac5c5ab174b0ac0aab864b0b00ff8
7
- data.tar.gz: fc4497042f69e9c4bf7b5b4c8618b460de67cccaee955ad008c2976f979649ba7ecc338d429545ef2b8b3eb1453fe69739b669a31cebd19b7e4a583acd3732dc
6
+ metadata.gz: 8b8eaa9f79b809aecf758bfec2e1ef87e5f5a41e81e29ce3c0d75a17828e20f53d408f8074a6ed047efa6eef74158b01b8d4cbcbf1ebf4e314d2ff71d78ed501
7
+ data.tar.gz: 7bc79074a73a76bc21bddb55ebe65cb1756451bb95c873cc56ae8ec210ce29e40264232d7b11b69f313dab210dde20ead75d8f8f05de45e7ec0c2d066dcdadac
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/event_nlp.rb CHANGED
@@ -61,9 +61,10 @@ class EventNlp
61
61
  weekday = Date::DAYNAMES.join('|').downcase
62
62
  months = (Date::MONTHNAMES[1..-1] + Date::ABBR_MONTHNAMES[1..-1])
63
63
  .join('|').downcase
64
+ time = /(?: (?:at )?(\d+(?::\d+)?am) )?/
64
65
 
65
66
 
66
- get /^(.*)\s+(every \d\w+ \w+(?: (?:at )?(\d+(?::\d+)?am) )?)\s*#{starting}/ do \
67
+ get /^(.*)\s+(every \d\w+ \w+#{time})\s*#{starting}/ do \
67
68
  |title, recurring, time, raw_date, end_date|
68
69
 
69
70
  d = Chronic.parse(raw_date + ' ' + time.to_s)
@@ -225,10 +226,11 @@ class EventNlp
225
226
  { title: title, date: d, recurring: recurring }
226
227
  end
227
228
 
229
+ # some event Wednesday
228
230
  # some event Wednesday 11am
229
231
 
230
232
  relative_day = '|today|tomorrow|tonight'
231
- get /^(.*)\s+((?:#{weekday+relative_day}) \d{1,2}(?::\d{2})?[ap]m)/i do |title, raw_date|
233
+ get /^(.*)\s+((?:#{weekday+relative_day})(?: \d{1,2}(?::\d{2})?[ap]m)?)/i do |title, raw_date|
232
234
 
233
235
  d = Chronic.parse(raw_date)
234
236
 
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.5
4
+ version: 0.2.6
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-07-11 00:00:00.000000000 Z
34
+ date: 2017-07-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