increments-schedule 0.5.0 → 0.6.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 +1 -0
- data/lib/increments/schedule.rb +16 -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: 2d7e3034c8853e9c5cf290df2cf51453d0055096
|
4
|
+
data.tar.gz: a28ec247dd1b0ff5336a693b2b2087938ffca1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 457aa3c3a82dd5a56f7438a26d50c771c482b80db63e95de91060cf306799ad553584351377261169f18516d4b50111c02fd82a4af8e9190a87e968b9f845fbc
|
7
|
+
data.tar.gz: 7b033a4448f31e79f11d8ca4d499789d8c89d032b7eb348b2093035f598ec8d913a5918117e4f448ecde3c121035960282bf38143dd222631425900bdcf8ae39
|
data/README.md
CHANGED
@@ -53,6 +53,7 @@ $ gem install increments-schedule
|
|
53
53
|
* `Increments::Schedule.each_rest_day(max_date = Date.today + 365)`
|
54
54
|
* `Increments::Schedule.each_weekend(max_date = Date.today + 365)`
|
55
55
|
* `Increments::Schedule.each_holiday(max_date = Date.today + 365)`
|
56
|
+
* `Increments::Schedule.each_work_time_range(max_date = Date.today + 365)`
|
56
57
|
|
57
58
|
## Development
|
58
59
|
|
data/lib/increments/schedule.rb
CHANGED
@@ -65,10 +65,26 @@ module Increments
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
def each_work_time_range(max_date = nil)
|
69
|
+
return to_enum(__method__, max_date) unless block_given?
|
70
|
+
|
71
|
+
each_work_day(max_date) do |work_day|
|
72
|
+
yield opening_time_of_date(work_day)..closing_time_of_date(work_day)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
68
76
|
private
|
69
77
|
|
70
78
|
def normal_office_work_day?(date = Date.today)
|
71
79
|
!rest_day?(date) && !normal_remote_work_day?(date)
|
72
80
|
end
|
81
|
+
|
82
|
+
def opening_time_of_date(date)
|
83
|
+
date.to_time + 10 * 60 * 60
|
84
|
+
end
|
85
|
+
|
86
|
+
def closing_time_of_date(date)
|
87
|
+
date.to_time + 19 * 60 * 60
|
88
|
+
end
|
73
89
|
end
|
74
90
|
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.
|
4
|
+
version: 0.6.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-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holiday_japan
|