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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fe27edbd3d6bb9e8321a6ae62acb19e31fc75d2
4
- data.tar.gz: d4ac0b3633b9f485d2af3246e5d558d3f8639871
3
+ metadata.gz: e0a24943947c51605b2638b194eac012e7389cc7
4
+ data.tar.gz: dbbd7b8e04170cadbd8e85c2e2c5f85db6d95e34
5
5
  SHA512:
6
- metadata.gz: 8bc42c8b190cacd4a9829e71a494aeea0aa7264a8ddb75e6a4db7cd1de5c488879551bc1485611c2b813cd5ab617b27e7b6ec4541eeba08ae73497ea3a6fac5a
7
- data.tar.gz: 803f794edd1d5fddcc116dba974b601772215e3342678b2f68505380a7d5cea812464789a85f62687bffb1d29775146bef7c637effb1e71a2809becaec4b5f8b
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`
@@ -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
- normal_office_work_day?(date) && !remote_work_day?(date)
48
+ !rest_day?(date) && !remote_work_day?(date)
39
49
  end
40
50
 
41
51
  def rest_day?(date)
@@ -1,5 +1,5 @@
1
1
  module Increments
2
2
  module Schedule
3
- VERSION = '0.1.2'
3
+ VERSION = '0.2.0'
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.1.2
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 00:00:00.000000000 Z
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: