increments-schedule 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/increments/schedule.rb +11 -1
- data/lib/increments/schedule/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a24943947c51605b2638b194eac012e7389cc7
|
4
|
+
data.tar.gz: dbbd7b8e04170cadbd8e85c2e2c5f85db6d95e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b440916d7672e029446af372f70a8eb171cccda0814d830e909025d1b0566d57c6003bab41fb36446f035fa256c4214ab6c70c453d82f2513c7c4dfa14afa8cf
|
7
|
+
data.tar.gz: afb13986236c066736d5e8c086a12b0fc0072f5f3b0618f8008556fabf6171b76aa512de17c0befbc018940bfea28456fc221103ff59dd8155d6633f73f16f3c
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# Increments::Schedule
|
6
6
|
|
7
|
-
Find out our special remote days and eagerly wait them!
|
7
|
+
Find out our special remote days and eagerly wait for them!
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -24,6 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
+
* `Increments::Schedule.each_pay_day`
|
27
28
|
* `Increments::Schedule.each_remote_work_day`
|
28
29
|
* `Increments::Schedule.each_normal_remote_work_day`
|
29
30
|
* `Increments::Schedule.each_special_remote_work_day`
|
data/lib/increments/schedule.rb
CHANGED
@@ -6,6 +6,7 @@ module Increments
|
|
6
6
|
extend self # rubocop:disable ModuleFunction
|
7
7
|
|
8
8
|
[
|
9
|
+
[:each_pay_day, :pay_day?],
|
9
10
|
[:each_remote_work_day, :remote_work_day?],
|
10
11
|
[:each_normal_remote_work_day, :normal_remote_work_day?],
|
11
12
|
[:each_special_remote_work_day, :special_remote_work_day?]
|
@@ -21,6 +22,15 @@ module Increments
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
25
|
+
def pay_day?(date)
|
26
|
+
return !rest_day?(date) if date.day == 25
|
27
|
+
next_basic_pay_day = Date.new(date.year, date.month, 25)
|
28
|
+
next_basic_pay_day = next_basic_pay_day.next_month if date > next_basic_pay_day
|
29
|
+
date.next_day.upto(next_basic_pay_day).all? do |date_until_basic_pay_day|
|
30
|
+
rest_day?(date_until_basic_pay_day)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
24
34
|
def remote_work_day?(date)
|
25
35
|
normal_remote_work_day?(date) || special_remote_work_day?(date)
|
26
36
|
end
|
@@ -35,7 +45,7 @@ module Increments
|
|
35
45
|
end
|
36
46
|
|
37
47
|
def office_work_day?(date)
|
38
|
-
|
48
|
+
!rest_day?(date) && !remote_work_day?(date)
|
39
49
|
end
|
40
50
|
|
41
51
|
def rest_day?(date)
|
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.2.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-04-
|
11
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holiday_japan
|
@@ -83,3 +83,4 @@ signing_key:
|
|
83
83
|
specification_version: 4
|
84
84
|
summary: Increments' schedule
|
85
85
|
test_files: []
|
86
|
+
has_rdoc:
|