time_range_extractor 0.1.0 → 0.1.1

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: 8e17089d12415100a06670d2ba9ceb8b47427a5e62130dc5eb10731a2848ffa8
4
- data.tar.gz: b042513dea3c4f1e90b160455fb3952e716815d473aa39e40fabb6ed749d95b7
3
+ metadata.gz: 1ae3fd0114820e0c7e12998845f431cc773db52560cd687b96d7d77cfd69fdb5
4
+ data.tar.gz: 6886b6b01041131120e3eb1255f0bcf3276b3c8b261b4063eb733347eddea671
5
5
  SHA512:
6
- metadata.gz: 81a5b69e52bd8ee93dd5f5e16e5646bb5b209cf1da30b88723e9b0bdf41ed56d28b63f5e77535bfe35f44543563041ac161a42e4ae9db588c5a99eceae4e8af1
7
- data.tar.gz: 71bae72527430763653b3f8d6f32b3caea965bb403db4c574c75b2c4af07506678e11138da4106e0c86c4b4dd99d127afc06ecab372b1589583f3256780ebab8
6
+ metadata.gz: 331bd280feae421065c43a354f23c827093ecb6b947848a88e1802d1ea5fdc60277399127edb5673c4b9c344178db6b2897401f08e0aad1b14f305f5b953ea8a
7
+ data.tar.gz: ab0785859f3f17a665124698a47c85463aa40d76592c7b365e84b1fafe7351ad0535df45c61b7c325e4e90c46e7918f9f27f90e50857ce016006ef649d29ee1f
@@ -15,7 +15,7 @@ class MatchResult
15
15
  if end_period.casecmp("pm") == 0 && (start_t > end_t || (end_t == 12 && start_t < end_t))
16
16
  "am"
17
17
  else
18
- "pm"
18
+ end_period
19
19
  end
20
20
  end
21
21
  end
@@ -18,7 +18,11 @@ class Parser
18
18
  start_time = time_from_string(match_result.start_time_string)
19
19
  end_time = time_from_string(match_result.end_time_string)
20
20
 
21
- start_time..end_time
21
+ if start_time <= end_time
22
+ start_time..end_time
23
+ elsif start_time > end_time
24
+ start_time..(end_time + 1.day)
25
+ end
22
26
  end
23
27
 
24
28
  private
@@ -1,3 +1,3 @@
1
1
  module TimeRangeExtractor
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_range_extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Baker