event_nlp 0.5.1 → 0.5.2

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: 6cfeae1554c39f4b0829c15b6878a4214b45353b614ba1321540285980d9d722
4
- data.tar.gz: 43502f60e11fd431026da2c82b303818f1ae98e973ed29e7b7cc0e254ae3030b
3
+ metadata.gz: 124158eaa2d190a018ac080544f817c23aa5b204a2077bcf9c6b763384be0c68
4
+ data.tar.gz: ce967c58f45480fbb66462f6cf9bac6445c82a4a2d6b69d95654262f794b3b2b
5
5
  SHA512:
6
- metadata.gz: 6d56b0824eabf0189b84a5284cf28470a36ed4ae255e79564ffcdb2d23b16e830458d82fccf97bc7fc80c0708f5535f7f3f969018f271a26f43112ba6027e0dc
7
- data.tar.gz: 9b09a7ce76de7dc2fed5100e6cf16279901798b514e22303f239024a4e49e0a28dc22dc8972dd6adaa63180141caa5b8c67d46b2b0f324b862f6974c63ce2078
6
+ metadata.gz: 734b60be3195c82512801cb0680a3c7965afefd567722f2870c0efc2ad030dc4b348d81e5672c489c64b3c9150f5d5b1746f1e8c998f9592eecc9a517c0297e6
7
+ data.tar.gz: 744bc3868f73a02a28b88b040c11beeb2af9d374e33f6427ae31ef29ce332110b3a1a79be5344cf0a4c12e29b05c05e1bf29bcdca1f9a5c7097113a7cce70614
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/event_nlp.rb CHANGED
@@ -454,6 +454,32 @@ class EventNlp
454
454
 
455
455
  end
456
456
 
457
+ # some important day 11 Oct *
458
+ #
459
+ get /^(.*) +(\d+) +#{months} *(\*)?/i \
460
+ do |title, day, month, annualar|
461
+
462
+ raw_date = day + ' ' + month
463
+
464
+ d = Chronic.parse(raw_date,
465
+ :endian_precedence => :little)
466
+ recurring = nil
467
+
468
+ if annualar then
469
+
470
+ recurring = 'yearly'
471
+ if d < @now then
472
+ d = Chronic.parse(raw_date,
473
+ now: Time.local(@now.year + 1, 1, 1))
474
+ end
475
+ end
476
+
477
+
478
+ puts [6, title, raw_date].inspect.debug if @debug
479
+ { title: title, date: d, recurring: recurring }
480
+ end
481
+
482
+
457
483
 
458
484
  # Tuesday 3rd October gas service at Barbara's house morning 9am-1pm
459
485
  #
@@ -494,7 +520,7 @@ class EventNlp
494
520
  end
495
521
  end
496
522
 
497
- puts [6, title, raw_date, time1].inspect.debug if @debug
523
+ puts [10, title, raw_date, time1].inspect.debug if @debug
498
524
  { title: title, date: d, end_date: end_date, recurring: recurring }
499
525
  end
500
526
 
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -30,7 +30,7 @@ cert_chain:
30
30
  hfzP67fp+s/TI6Tk+IvaEWBcfX7AV2XjfhS+q3uCBvQRjmbbRg3JO4XdjAQI3q8d
31
31
  +P4=
32
32
  -----END CERTIFICATE-----
33
- date: 2019-03-09 00:00:00.000000000 Z
33
+ date: 2019-03-10 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: chronic_cron
metadata.gz.sig CHANGED
Binary file