timing 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/timing/natural_time_language.rb +520 -369
- data/lib/timing/natural_time_language.treetop +1 -1
- data/lib/timing/natural_time_language_interpreters.rb +2 -0
- data/lib/timing/version.rb +1 -1
- metadata +2 -2
@@ -26,7 +26,7 @@ module Timing
|
|
26
26
|
end
|
27
27
|
|
28
28
|
rule last_next_day_name
|
29
|
-
direction:last_next space* day_name:day_name <LastNextDayName>
|
29
|
+
direction:last_next space* day_name:day_name space* including_today:'including today'? <LastNextDayName>
|
30
30
|
end
|
31
31
|
|
32
32
|
rule day_month_name_year
|
@@ -51,6 +51,8 @@ module Timing
|
|
51
51
|
def evaluate(zone_offset)
|
52
52
|
today = TimeInZone.now(zone_offset).beginning_of_day
|
53
53
|
|
54
|
+
return today if !including_today.empty? && today.wday == day_name.value
|
55
|
+
|
54
56
|
if direction.last?
|
55
57
|
if today.wday > day_name.value
|
56
58
|
today - Interval.days(today.wday - day_name.value)
|
data/lib/timing/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|