increments-schedule 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/increments/schedule.rb +1 -20
- 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: c4f4d11215e5e04c912ce6d9dfd5d147dc58edee
|
4
|
+
data.tar.gz: 7a2d18a7f97da8386e03d24b866dfdc261a508a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 224a58fad8a3760e692fa0db80871ad76fd637c29864de304221dae770abb5865af9ac1bb0d7ea23c8d595a38a9feae628d6a41d64378f31199c9b222fe23c69
|
7
|
+
data.tar.gz: 4ad981dd2b182779d385c979409f02efe89bc79805cfdae45d97dc94667dc81c2b9087522590e4bf27bb0f337c8118e44ca17b37ca32678cafe1d52d6b964e90
|
data/lib/increments/schedule.rb
CHANGED
@@ -29,22 +29,7 @@ module Increments
|
|
29
29
|
!rest_day?(date)
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
work_day?(date) && !remote_work_day?(date)
|
34
|
-
end
|
35
|
-
|
36
|
-
def remote_work_day?(date = Date.today)
|
37
|
-
normal_remote_work_day?(date) || special_remote_work_day?(date)
|
38
|
-
end
|
39
|
-
|
40
|
-
def normal_remote_work_day?(date = Date.today)
|
41
|
-
date.monday? && work_day?(date)
|
42
|
-
end
|
43
|
-
|
44
|
-
def special_remote_work_day?(date = Date.today)
|
45
|
-
normal_office_work_day?(date) &&
|
46
|
-
!normal_office_work_day?(date - 1) && !normal_office_work_day?(date + 1)
|
47
|
-
end
|
32
|
+
alias_method :remote_work_day?, :work_day?
|
48
33
|
|
49
34
|
def rest_day?(date = Date.today)
|
50
35
|
weekend?(date) || holiday?(date) || winter_vacation?(date)
|
@@ -87,10 +72,6 @@ module Increments
|
|
87
72
|
|
88
73
|
private
|
89
74
|
|
90
|
-
def normal_office_work_day?(date = Date.today)
|
91
|
-
work_day?(date) && !normal_remote_work_day?(date)
|
92
|
-
end
|
93
|
-
|
94
75
|
def find_date(date, direction)
|
95
76
|
raise ArgumentError unless [:upto, :downto].include?(direction)
|
96
77
|
limit_date = direction == :upto ? INFINITY_FUTURE : INFINITY_PAST
|
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.11.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: 2016-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holiday_japan
|