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: 2a8916afe622596bf9311273eb56740d3615eade
4
- data.tar.gz: e0cf6e4174857b76dfdec9b4f7ca5a0a8a99a1e0
3
+ metadata.gz: 6153b8303d8c2ed10bd01777d2a12220e7068741
4
+ data.tar.gz: 098761555465b0d8a7e91f8948c60ba724e0055f
5
5
  SHA512:
6
- metadata.gz: 5b974f06482b715f7a6f1dcc96bea081b8a6a89980e84ecc943e16efed67625c95c6541c2a2967537ee9266c700c2a884e020680869d44a994733ab7fe5573fe
7
- data.tar.gz: c54480c4df9bc58eaf7167122bd414be990ae65a9bd9d5a4a727db34e2b946e9f74b30cf30dee33dc52ecc5d5f46aee8d54f7992d35c0f3ca8022147c28b1dbf
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
- if date_min <= other.date_max
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
@@ -1,3 +1,3 @@
1
1
  module HolidaysFromGoogleCalendar
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  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
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-06 00:00:00.000000000 Z
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