holidays_from_google_calendar 0.4.4 → 0.4.5
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6153b8303d8c2ed10bd01777d2a12220e7068741
|
4
|
+
data.tar.gz: 098761555465b0d8a7e91f8948c60ba724e0055f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d306a10df8000079761dcf39a6e5c43a2005be859cc2586789c58238fc5e8b06f9a6747f506f58c17cf4c5fdbf45127a783f79b6ac637f6065c1a445befd0641
|
7
|
+
data.tar.gz: fb9c764618e7f03a183371cca109b16671c79e463c521272a9c4236b1bddafd7b4384fca177bc8610eb812d539761d847cc2e0dfc66d6d9720e8ddb8e8fd1bd0
|
data/README.md
CHANGED
@@ -80,7 +80,7 @@ usa_holidays.holiday?(Date.parse("Aug 2 2016")) # Weekday (Tuesday)
|
|
80
80
|
```
|
81
81
|
|
82
82
|
## Development
|
83
|
-
Need to set the following environment variable to run rspec
|
83
|
+
Need to set the following environment variable to run rspec:
|
84
84
|
|
85
85
|
```bash
|
86
86
|
GOOGLE_API_KEY="YOUR OWN GOOGLE API KEY"
|
@@ -21,18 +21,14 @@ module HolidaysFromGoogleCalendar
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def overlapped?(other)
|
24
|
-
(date_min <= other.date_max && other.date_min <= date_max) ||
|
25
|
-
(other.date_min <= date_max && date_min <= other.date_max)
|
24
|
+
(date_min <= other.date_max && other.date_min <= date_max + 1) ||
|
25
|
+
(other.date_min <= date_max && date_min <= other.date_max + 1)
|
26
26
|
end
|
27
27
|
|
28
28
|
def combine(other)
|
29
29
|
return unless overlapped?(other)
|
30
|
-
|
31
|
-
|
32
|
-
date_min = other.date_min # rubocop:disable Lint/UselessAssignment
|
33
|
-
elsif other.date_min <= date_max
|
34
|
-
date_max = other.date_max # rubocop:disable Lint/UselessAssignment
|
35
|
-
end
|
30
|
+
date_min = [date_min, other.date_min].min
|
31
|
+
date_max = [date_max, other.date_max].max
|
36
32
|
@holidays =
|
37
33
|
@holidays.concat(other.holidays).uniq.sort { |a, b| a.date <=> b.date }
|
38
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: holidays_from_google_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- necojackarc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|