timelord 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5155bc20aeb42f6a425662afb50e602404bf288
|
4
|
+
data.tar.gz: 620672c681562bddd15f34ae4d1dce1f33124595
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a05dcad148204053e8d4ce6e0ccae8d89d3be17c1a1d27215cf8f7d18d073acee203da254978afc94fc58697fa837e5df5cb077168512b483da6b78e6e51a216
|
7
|
+
data.tar.gz: 06a94a35fef19b24734eb99d20903a9517bbeab86eb7655261725324a6c6b3954a25773df3adc489c582b400dce60f20a19c11bd0d658c43ab5e9f7dcecf8fb3
|
data/lib/timelord.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Timelord
|
2
|
+
class LongMonthYearMatcher < Matcher
|
3
|
+
REGEX = /\b(#{LONG_MATCHER})\s+(\d{4})\b/i
|
4
|
+
|
5
|
+
def to_date
|
6
|
+
Future.new(parse_date).to_date
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def parse_date
|
12
|
+
Date.civil(match[2].to_i, LONG_MONTHS.index(match[1].downcase) + 1)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Timelord
|
2
|
+
class ShortMonthYearMatcher < Matcher
|
3
|
+
REGEX = /\b(#{SHORT_MATCHER})\s+(\d{4})\b/i
|
4
|
+
|
5
|
+
def to_date
|
6
|
+
Future.new(parse_date).to_date
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def parse_date
|
12
|
+
Date.civil(match[2].to_i, SHORT_MONTHS.index(match[1].downcase) + 1)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timelord
|
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
|
- Matthew Mongeau
|
@@ -74,12 +74,14 @@ files:
|
|
74
74
|
- lib/timelord/matchers/day_short_month_matcher.rb
|
75
75
|
- lib/timelord/matchers/long_month_day_matcher.rb
|
76
76
|
- lib/timelord/matchers/long_month_matcher.rb
|
77
|
+
- lib/timelord/matchers/long_month_year_matcher.rb
|
77
78
|
- lib/timelord/matchers/next_thursday_matcher.rb
|
78
79
|
- lib/timelord/matchers/next_tuesday_matcher.rb
|
79
80
|
- lib/timelord/matchers/next_weekday_matcher.rb
|
80
81
|
- lib/timelord/matchers/ordinal_matcher.rb
|
81
82
|
- lib/timelord/matchers/short_month_day_matcher.rb
|
82
83
|
- lib/timelord/matchers/short_month_matcher.rb
|
84
|
+
- lib/timelord/matchers/short_month_year_matcher.rb
|
83
85
|
- lib/timelord/matchers/today_matcher.rb
|
84
86
|
- lib/timelord/matchers/tomorrow_matcher.rb
|
85
87
|
- lib/timelord/matchers/year_first_matcher.rb
|