opening_hours_converter 1.7.18 → 1.7.19

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: 6608fab419a381eb17a49872e38d1d13d0e612ecfecfa4f30e87935e37356659
4
- data.tar.gz: f3e3321ce3346626776e418d488132d817c8bc640042ecbe45cd6a650421e672
3
+ metadata.gz: aeaea66e8c4dc56c2789ffe800537d732ed77db3f2af9680d674d65d854333a0
4
+ data.tar.gz: 3184691bb45258453cf39e72daa97bf15e395b180889426071c04739f678cfec
5
5
  SHA512:
6
- metadata.gz: 01c5239d36117dcd08f31e4592b8f633117b874cdb52186b81428325702086fc38db70fe49c336def54e7e9cbc6933ffa6a9fa39102f42e69d93a7ebf19e0c82
7
- data.tar.gz: e303a0c434d536e916c9282403ba6fe8a26cf1cff9b6e1769c12e1c4bbe40ba3864f90660ad0cd6404d22a363fccc4b7fa7b2dc0a22e17d10e28c051f601534e
6
+ metadata.gz: 76c0cdfb4243a7c5d98a0e028842f9ff476449aaed4e16b0bfb6772be554ebe4462cc60c15a7a408dd7483b5c007d59d167df1b9ba2704305c006a4aacfb1b6b
7
+ data.tar.gz: 201014a6ce2df90e339ab482787410c448e6303327a660af330b0424a11557c62096ea76b557a2858a1c883ee79aba04e61a6c4aa1ae54e91e03dfe22d3b06a5
@@ -14,22 +14,65 @@ module OpeningHoursConverter
14
14
 
15
15
  @intervals.each do |interval|
16
16
  if !interval.nil?
17
- for day in interval.day_start..interval.day_end
18
- start_minute = (day == interval.day_start) ? interval.start : 0
19
- end_minute = (day == interval.day_end) ? interval.end : MINUTES_MAX
20
- if interval.is_off
21
- if start_minute && end_minute
22
- for minute in 0..MINUTES_MAX
23
- minute_array[day][minute] = "off"
17
+ if interval.day_start > interval.day_end
18
+ for day in 0..interval.day_end
19
+ start_minute = 0
20
+ end_minute = (day == interval.day_end) ? interval.end : MINUTES_MAX
21
+ if interval.is_off
22
+ if start_minute && end_minute
23
+ for minute in 0..MINUTES_MAX
24
+ minute_array[day][minute] = "off"
25
+ end
26
+ end
27
+ else
28
+ if start_minute && end_minute
29
+ if minute_array[day][0] == "off"
30
+ minute_array[day] = Array.new(MINUTES_MAX + 1, false)
31
+ end
32
+ for minute in start_minute..end_minute
33
+ minute_array[day][minute] = true
34
+ end
24
35
  end
25
36
  end
26
- else
27
- if start_minute && end_minute
28
- if minute_array[day][0] == "off"
29
- minute_array[day] = Array.new(MINUTES_MAX + 1, false)
37
+ end
38
+ for day in interval.day_start..6
39
+ start_minute = (day == interval.day_start) ? interval.start : 0
40
+ end_minute = MINUTES_MAX
41
+ if interval.is_off
42
+ if start_minute && end_minute
43
+ for minute in 0..MINUTES_MAX
44
+ minute_array[day][minute] = "off"
45
+ end
46
+ end
47
+ else
48
+ if start_minute && end_minute
49
+ if minute_array[day][0] == "off"
50
+ minute_array[day] = Array.new(MINUTES_MAX + 1, false)
51
+ end
52
+ for minute in start_minute..end_minute
53
+ minute_array[day][minute] = true
54
+ end
30
55
  end
31
- for minute in start_minute..end_minute
32
- minute_array[day][minute] = true
56
+ end
57
+ end
58
+ else
59
+ for day in interval.day_start..interval.day_end
60
+ start_minute = (day == interval.day_start) ? interval.start : 0
61
+ end_minute = (day == interval.day_end) ? interval.end : MINUTES_MAX
62
+ if interval.is_off
63
+ if start_minute && end_minute
64
+ for minute in 0..MINUTES_MAX
65
+ minute_array[day][minute] = "off"
66
+ end
67
+ end
68
+ else
69
+ if start_minute && end_minute
70
+ if minute_array[day][0] == "off"
71
+ minute_array[day] = Array.new(MINUTES_MAX + 1, false)
72
+ end
73
+ for minute in start_minute..end_minute
74
+ minute_array[day][minute] = true
75
+ end
33
76
  end
34
77
  end
35
78
  end
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.18
4
+ version: 1.7.19
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-06 00:00:00.000000000 Z
11
+ date: 2018-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json