increments-schedule 0.7.0 → 0.7.1

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: 6bd9a6b003b83fabdbfb37df4d54f4932e9051ea
4
- data.tar.gz: 113e30fd33d313e9ed61b55fe3258fb68460061e
3
+ metadata.gz: 896c5a2aaa961ba5c696feebb86504fca89ee8e1
4
+ data.tar.gz: 1c80dc20d90b41a84a4a871db71a052c3913d176
5
5
  SHA512:
6
- metadata.gz: 6c002b124fcd22e531c0344db5bc3d7918ddc57aed68b773116a31b4401fbdfda90473deb6e88baa147970a08b07139be20d045e5fcd6a2e7e1129771b83341b
7
- data.tar.gz: 3ba82b3bd4b8da082b8fb72b1c424acb263dc21be544ec9acf07f35d83263da500678b4b43190517992dbe84912007d95b354c065e80eb11a2a888e4609f2ec8
6
+ metadata.gz: 5692346d9fb38b22d08fe691e4e6f205f1754dfb7d09e809d966bb74a5591b340eab7dd56e27d7088c20057aff7912da6b93385c0c87298618092d13df44f560
7
+ data.tar.gz: dd55cb509d0d26e9c219baf8b7b874d00b43c8451c8a3677b44865322f10938fa2d3dcfde2034475761fe908089572985c2770d674d2bcceec2d766b357c325b
@@ -7,6 +7,7 @@ module Increments
7
7
 
8
8
  DATE_OF_SPECIAL_TGIF_PARTY = Date.new(2015, 6, 19)
9
9
  START_DATE_OF_NORMAL_TGIF_PARTY_SCHEDULE = Date.new(2015, 7, 1)
10
+ DATE_RANGE_OF_YAPC_ASIA = Date.new(2015, 8, 20)..Date.new(2015, 8, 22)
10
11
 
11
12
  def super_hanakin?(date = Date.today)
12
13
  date.friday? && pay_day?(date)
@@ -14,7 +15,11 @@ module Increments
14
15
 
15
16
  def tgif_party_day?(date = Date.today)
16
17
  if date >= START_DATE_OF_NORMAL_TGIF_PARTY_SCHEDULE
17
- date.friday? && (date.day / 7).odd? && work_day?(date)
18
+ if second_or_fourth_friday_in_month?(date)
19
+ !cancelled_tgif_party_day?(date)
20
+ else
21
+ cancelled_tgif_party_day?(date - 7) && !cancelled_tgif_party_day?(date)
22
+ end
18
23
  else
19
24
  date == DATE_OF_SPECIAL_TGIF_PARTY
20
25
  end
@@ -90,6 +95,18 @@ module Increments
90
95
  !rest_day?(date) && !normal_remote_work_day?(date)
91
96
  end
92
97
 
98
+ def second_or_fourth_friday_in_month?(date)
99
+ date.friday? && (date.day / 7).odd?
100
+ end
101
+
102
+ def cancelled_tgif_party_day?(date)
103
+ rest_day?(date) || yapc_asia_day?(date)
104
+ end
105
+
106
+ def yapc_asia_day?(date)
107
+ DATE_RANGE_OF_YAPC_ASIA.include?(date)
108
+ end
109
+
93
110
  def opening_time_of_date(date)
94
111
  date.to_time + 10 * 60 * 60
95
112
  end
@@ -1,5 +1,5 @@
1
1
  module Increments
2
2
  module Schedule
3
- VERSION = '0.7.0'
3
+ VERSION = '0.7.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: increments-schedule
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-11 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holiday_japan
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  requirements: []
81
81
  rubyforge_project:
82
- rubygems_version: 2.4.6
82
+ rubygems_version: 2.4.8
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Increments' schedule