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 +4 -4
- data/lib/opening_hours_converter/week.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4a03e7d17a5d774ac652859401fd14a553e01adeea342d5f7eacf16eb26441e
|
4
|
+
data.tar.gz: 9ee63c4280ff6731567b44e9b86e2c6031542df8477792843c62fb75d70239fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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 =
|
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 =
|
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.
|
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-
|
11
|
+
date: 2018-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|