time_range_extractor 0.1.3 → 0.2.3

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: 5fa0a534c7c9a6102514520292a6ce86a0d6896961d4886315231683407d4bf9
4
- data.tar.gz: ebe57a9034aa3c80886b918605aa95b79c56ce633fd57957d716b21e759e3b8d
3
+ metadata.gz: 4dfb2e9f8bbc4e60f202ead653a032e8d049e0f930c7671d27795417e5a325ae
4
+ data.tar.gz: 2c7e454395476fcd3c488801fde084fb638bf74101ea758c4245dee77cc9a916
5
5
  SHA512:
6
- metadata.gz: '08ecbd4a6fc791d9720486efa66fa4f0e82aa7c9c9c0e6f24fc98a50e4814a8a4be4b5e7620d23e2e27fd5495b4eb47395ce706397679326f3fa8f3c34172a6b'
7
- data.tar.gz: 9a14db87419b1f7a1cd40f8aae5f7eaa97332c4f14f27fe29a28333b6a4e2cc768d1d3073bb79785a7a7bea1ca6d54bbe1b41ae987e04c93a9d1c14e077ce16f
6
+ metadata.gz: 72507f02f55d7d995f61f69e61dfa5e2ff3e5e9ae2b82a20d9a237c4388f137ac11625ee892421560a8a75b17dc995c4d6c61fd13ab2ab24d510c340123fe2b0
7
+ data.tar.gz: 7dc407b9e440a2a81a7d74d12dba0156d345f2668f2dd6182fbb08c3484d2dbe53eebdda5597d6c21325a0df4de920a2a0f07fb0fb26db49f754ff561c3fbc4b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- time_range_extractor (0.1.3)
4
+ time_range_extractor (0.2.3)
5
5
  activesupport (> 2.0)
6
6
 
7
7
  GEM
@@ -6,7 +6,7 @@ class MatchResult
6
6
  end
7
7
 
8
8
  def valid?
9
- @match_data && (start_time.present? || end_time.present?)
9
+ @match_data && (start_time.present? && end_time.present?)
10
10
  end
11
11
 
12
12
  def start_time
@@ -32,16 +32,10 @@ class MatchResult
32
32
  end
33
33
 
34
34
  def start_time_string
35
- if range?
36
- [start_time, start_period, time_zone].compact.join(' ')
37
- else
38
- end_time && [end_time, end_period, time_zone].compact.join(' ')
39
- end
35
+ [start_time, start_period, time_zone].compact.join(' ')
40
36
  end
41
37
 
42
38
  def end_time_string
43
- return start_time_string unless range?
44
-
45
39
  [end_time, end_period, time_zone].compact.join(' ')
46
40
  end
47
41
 
@@ -8,8 +8,8 @@ class Parser
8
8
  (
9
9
  (?<start_time>(2[0-4]|1[0-9]|[1-9]):?([0-5][0-9])?)\s?
10
10
  (?<start_period>am|pm)?\s?
11
- (to|-|until)\s?
12
- )?
11
+ (to|-|until|\s)\s?
12
+ )
13
13
  (?<end_time>(2[0-4]|1[0-9]|[1-9]):?([0-5][0-9])?)?\s?
14
14
  (?<end_period>am|pm)\s?
15
15
  (?<time_zone>(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TimeRangeExtractor
4
- VERSION = '0.1.3'
4
+ VERSION = '0.2.3'
5
5
  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.3
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Baker