opening_hours_converter 1.7.16 → 1.7.17

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: 155b7aac41a7152e21770e707af7008fdaaa5581420c7261f5b3ef3cfc55691a
4
- data.tar.gz: b7c29d41d26e4faff8e7313a1125b007d73374c35ce6d21f0b56884df23a09d0
3
+ metadata.gz: c4a03e7d17a5d774ac652859401fd14a553e01adeea342d5f7eacf16eb26441e
4
+ data.tar.gz: 9ee63c4280ff6731567b44e9b86e2c6031542df8477792843c62fb75d70239fa
5
5
  SHA512:
6
- metadata.gz: adb85ecaeebe483930687bd69123d10ca3c21df411d2760fb510edc6068392b8ba42b9c9af54912e83eaed08329276fece95af0f0849595d675796b6aca6b034
7
- data.tar.gz: a280b23b27c0e7e303ce6d80195e866033f0c9c40de00483da2e734b69f06ec5f8cf42eb754de213d0195b7f54d8510e165e17fa55f63614a03f9aec704bf474
6
+ metadata.gz: c63fd94f4a109121e92f6b827cf6872fd13a9661695437e0cab83e372bc950dbae7d5eda6396414f05609cb409c6f359dddf0dc3f3912d88890a36336cea5a8a
7
+ data.tar.gz: '08c025db9a9c50bbc28ace75531272fc62593e89eb2655671af708c8f004535d2d2dbc7b9d24675d07ab1a20a4cee7df6564419c6bd5d072ab578943f0ea6c6b'
@@ -52,12 +52,12 @@ module OpeningHoursConverter
52
52
  day.each_with_index do |minute, minute_index|
53
53
  if day_index == 0 && minute_index == 0
54
54
  if minute
55
- off = true if minute == "off"
55
+ off = minute == "off"
56
56
  day_start = day_index
57
57
  minute_start = minute_index
58
58
  end
59
59
  elsif minute && day_index == DAYS_MAX && minute_index == day.length - 1
60
- off = true if minute == "off"
60
+ off = minute == "off"
61
61
  if day_start >= 0
62
62
  intervals << OpeningHoursConverter::Interval.new(day_start, minute_start, day_index, minute_index, off)
63
63
  else
@@ -65,9 +65,14 @@ module OpeningHoursConverter
65
65
  end
66
66
  else
67
67
  if minute && day_start < 0
68
- off = true if minute == "off"
68
+ off = minute == "off"
69
69
  day_start = day_index
70
70
  minute_start = minute_index
71
+ elsif off && minute != "off"
72
+ intervals << OpeningHoursConverter::Interval.new(day_start, minute_start, day_index - 1, MINUTES_MAX, off)
73
+ off = false
74
+ day_start = minute ? day_index : -1
75
+ minute_start = minute ? minute_index : -1
71
76
  elsif !minute && day_start >= 0
72
77
  if minute_index == 0
73
78
  intervals << OpeningHoursConverter::Interval.new(day_start, minute_start, day_index - 1, MINUTES_MAX, off)
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.7.16
4
+ version: 1.7.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2018-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json