increments-schedule 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/README.md +2 -0
- data/lib/increments/schedule.rb +11 -0
- data/lib/increments/schedule/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bd9a6b003b83fabdbfb37df4d54f4932e9051ea
|
4
|
+
data.tar.gz: 113e30fd33d313e9ed61b55fe3258fb68460061e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c002b124fcd22e531c0344db5bc3d7918ddc57aed68b773116a31b4401fbdfda90473deb6e88baa147970a08b07139be20d045e5fcd6a2e7e1129771b83341b
|
7
|
+
data.tar.gz: 3ba82b3bd4b8da082b8fb72b1c424acb263dc21be544ec9acf07f35d83263da500678b4b43190517992dbe84912007d95b354c065e80eb11a2a888e4609f2ec8
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -31,6 +31,7 @@ $ gem install increments-schedule
|
|
31
31
|
### Predicate Methods
|
32
32
|
|
33
33
|
* `Increments::Schedule.super_hanakin?(date = Date.today)`
|
34
|
+
* `Increments::Schedule.tgif_party_day?(date = Date.today)`
|
34
35
|
* `Increments::Schedule.pay_day?(date = Date.today)`
|
35
36
|
* `Increments::Schedule.work_day?(date = Date.today)`
|
36
37
|
* `Increments::Schedule.office_work_day?(date = Date.today)`
|
@@ -44,6 +45,7 @@ $ gem install increments-schedule
|
|
44
45
|
### Enumeration Methods
|
45
46
|
|
46
47
|
* `Increments::Schedule.each_super_hanakin(max_date = Date.today + 365)`
|
48
|
+
* `Increments::Schedule.each_tgif_party_day(max_date = Date.today + 365)`
|
47
49
|
* `Increments::Schedule.each_pay_day(max_date = Date.today + 365)`
|
48
50
|
* `Increments::Schedule.each_work_day(max_date = Date.today + 365)`
|
49
51
|
* `Increments::Schedule.each_office_work_day(max_date = Date.today + 365)`
|
data/lib/increments/schedule.rb
CHANGED
@@ -5,10 +5,21 @@ module Increments
|
|
5
5
|
module Schedule
|
6
6
|
extend self # rubocop:disable ModuleFunction
|
7
7
|
|
8
|
+
DATE_OF_SPECIAL_TGIF_PARTY = Date.new(2015, 6, 19)
|
9
|
+
START_DATE_OF_NORMAL_TGIF_PARTY_SCHEDULE = Date.new(2015, 7, 1)
|
10
|
+
|
8
11
|
def super_hanakin?(date = Date.today)
|
9
12
|
date.friday? && pay_day?(date)
|
10
13
|
end
|
11
14
|
|
15
|
+
def tgif_party_day?(date = Date.today)
|
16
|
+
if date >= START_DATE_OF_NORMAL_TGIF_PARTY_SCHEDULE
|
17
|
+
date.friday? && (date.day / 7).odd? && work_day?(date)
|
18
|
+
else
|
19
|
+
date == DATE_OF_SPECIAL_TGIF_PARTY
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
12
23
|
def pay_day?(date = Date.today)
|
13
24
|
return work_day?(date) if date.day == 25
|
14
25
|
next_basic_pay_day = Date.new(date.year, date.month, 25)
|
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.
|
4
|
+
version: 0.7.0
|
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-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holiday_japan
|