event_nlp 0.2.12 → 0.2.13

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: b6bd12bdaa5603fec5552ea339467cdabce44a47
4
- data.tar.gz: aa8534ac2c9cbaa2caaeb5cb8711a011a4fc9f54
3
+ metadata.gz: 5d5bbf4a56bcfe0d8bbc9ca0c85161017a4f8974
4
+ data.tar.gz: f0c27a31ea7f6336e9ab2b2246ad72ca78fc2e8c
5
5
  SHA512:
6
- metadata.gz: e9483586440445991c2e6745ea364702636e1a16c123bd122ae7a393a33405d0164f7345d53bb4dc930b6338536a16684c46fceb8c16bbb6c2da1ee25f0899e1
7
- data.tar.gz: cb980603815f2da3409446e34fa56beb03f06dc508533058b38db2f0a03938c643402c30248e0c55cfe8b35c5be7e2f7eeb18df8ad8fd3c72d48bc21706905ad
6
+ metadata.gz: f0224cf316e4c22dfa784c9586f26a3f8c47e89769fa0a19b8b34f167aa99f3c6711a82789624c10bcad7603afd9dfa3fd6ac55543a13d2f899ecd9877e7e782
7
+ data.tar.gz: 8271a2e8d337d5c3389bcc93187b72a3590620b706645c41700277724bf08d13ca2498f9ce73bbeca6571fa2541e15ce3e6936373d25544bee89c17104b431ec
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/event_nlp.rb CHANGED
@@ -51,11 +51,7 @@ class EventNlp
51
51
 
52
52
  def expressions(params)
53
53
 
54
- # some event every 2 weeks
55
- # some event every 2 weeks at 6am starting from 14th Jan
56
- # some event every 2 weeks at 6am starting from 18th Feb until 28th Oct
57
- # some event every 2nd Monday (starting 7th Nov 2016)
58
- # some event every 2nd Monday (starting 7th Nov until 3rd Dec)
54
+
59
55
 
60
56
 
61
57
  starting = /(?:\(?\s*starting (\d+\w{2} \w+\s*\w*)(?: until (.*))?\s*\))?/
@@ -143,17 +139,23 @@ class EventNlp
143
139
  end_date}
144
140
 
145
141
  end
146
-
147
- get /^(.*)(every .*)/ do |title, recurring|
148
142
 
149
- exp = ChronicCron.new(recurring).to_expression
143
+ # some event every 2 weeks
144
+ # some event every 2 weeks at 6am starting from 14th Jan
145
+ # some event every 2 weeks at 6am starting from 18th Feb until 28th Oct
146
+ # some event every 2nd Monday (starting 7th Nov 2016)
147
+ # some event every 2nd Monday (starting 7th Nov until 3rd Dec)
148
+ # some event every 2 weeks (starting 02/11/17)
149
+ get /^(.*)(every .*)/ do |title, recurring|
150
150
 
151
151
  raw_start_date = recurring[/(?<=starting )[^\)]+/]
152
-
153
152
 
154
153
  if raw_start_date then
155
- start_date = Chronic.parse(raw_start_date, now: @now - 1)
154
+ start_date = Chronic.parse(raw_start_date, now: @now - 1,
155
+ :endian_precedence => :little)
156
156
 
157
+ exp = ChronicCron.new(recurring, start_date).to_expression
158
+
157
159
  cf = CronFormat.new(exp, start_date - 1)
158
160
  #cf.next until cf.to_time >= start_date
159
161
  else
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.12
4
+ version: 0.2.13
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-14 00:00:00.000000000 Z
34
+ date: 2017-11-15 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chronic_cron
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '0.3'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.3.6
45
+ version: 0.3.7
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  version: '0.3'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.3.6
55
+ version: 0.3.7
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: app-routes
58
58
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file