opening_hours_converter 1.13.3 → 1.13.4

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: 268e7ffab47efc4323b08abbc6fbea645ea6011de6c592c2fe77d96e180de001
4
- data.tar.gz: 7f486e9379c76092e4a22cdfafb37d43fbf54fe21d137b743c041fda6d5d8f97
3
+ metadata.gz: a3aa4f100c0d94af234e082bb2bb80b023ae5abff4a1a6931243f8bd038c722c
4
+ data.tar.gz: 85e5efa4f22f7d9415a0f7f823a0cb1295d4b73e2949972d2a244c732f936b26
5
5
  SHA512:
6
- metadata.gz: 27fe9fa2cebe6cddd4604aa0e82eedbdb997e8e7447a4289969a0e66a3318a1ca9331502a779009faea88226fa46a87056e08524db669f9a6fd5c8e2c424e94c
7
- data.tar.gz: 4748eb3d65eda40b3017f64e196f35086869abb5e2c831f89b2aee5244bf892a029c8ed42263059ce6991537df034e9181d6fce22ca897058f65851f70bbd41b
6
+ metadata.gz: 1e59e894e699683857bdc242bb3d9225d94272ab23b97566a182f5278aff04a447b7a608a6bc5fd78bb25b9a0eb3d990d036361b3da9aa9208dfb67a741768eb
7
+ data.tar.gz: 2dda598800d025afe4a40363487efb07e6635cb5aebbd09b06640f7f24541619b2f5a02d24865f0bd7b2aa1235b27f9f7a9838e556aa87c405afbde212a5539d
@@ -427,16 +427,21 @@ module OpeningHoursConverter
427
427
  end
428
428
 
429
429
  def current_token_is_all_time?
430
- current_token? &&
431
-
432
- # check if current token is 24 or / or 7 in 24/7
433
- current_token.integer? &&
434
- previous_token? && previous_token.slash? && current_token.value == '7' ||
435
- next_token? && next_token.slash? && current_token.value == '24' ||
430
+ return false unless current_token?
431
+ return false unless ['24', '7', '/'].include?(current_token.value)
432
+
433
+ if current_token.value == '24'
434
+ return false unless next_token? && next_token.slash?
435
+ return false unless !@unhandled_tokens[@index + 2].nil? && @unhandled_tokens[@index + 2].value == '7'
436
+ elsif current_token.slash?
437
+ return false unless previous_token? && previous_token.value == '24'
438
+ return false unless next_token? && next_token.value == '7'
439
+ else # current token is 7
440
+ return false unless previous_token? && previous_token.slash?
441
+ return false unless !@unhandled_tokens[@index - 2].nil? && @unhandled_tokens[@index - 2].value == '24'
442
+ end
436
443
 
437
- current_token.slash? &&
438
- previous_token? && previous_token.value == '24' &&
439
- next_token? && next_token.value == '7'
444
+ true
440
445
  end
441
446
 
442
447
  def current_token
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opening_hours_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.3
4
+ version: 1.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-24 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json