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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d7e3034c8853e9c5cf290df2cf51453d0055096
4
- data.tar.gz: a28ec247dd1b0ff5336a693b2b2087938ffca1e9
3
+ metadata.gz: 6bd9a6b003b83fabdbfb37df4d54f4932e9051ea
4
+ data.tar.gz: 113e30fd33d313e9ed61b55fe3258fb68460061e
5
5
  SHA512:
6
- metadata.gz: 457aa3c3a82dd5a56f7438a26d50c771c482b80db63e95de91060cf306799ad553584351377261169f18516d4b50111c02fd82a4af8e9190a87e968b9f845fbc
7
- data.tar.gz: 7b033a4448f31e79f11d8ca4d499789d8c89d032b7eb348b2093035f598ec8d913a5918117e4f448ecde3c121035960282bf38143dd222631425900bdcf8ae39
6
+ metadata.gz: 6c002b124fcd22e531c0344db5bc3d7918ddc57aed68b773116a31b4401fbdfda90473deb6e88baa147970a08b07139be20d045e5fcd6a2e7e1129771b83341b
7
+ data.tar.gz: 3ba82b3bd4b8da082b8fb72b1c424acb263dc21be544ec9acf07f35d83263da500678b4b43190517992dbe84912007d95b354c065e80eb11a2a888e4609f2ec8
data/.rubocop.yml CHANGED
@@ -1,6 +1,9 @@
1
1
  Metrics/LineLength:
2
2
  Max: 100
3
3
 
4
+ Metrics/ModuleLength:
5
+ Enabled: false
6
+
4
7
  Style/Documentation:
5
8
  Enabled: false
6
9
 
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)`
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Increments
2
2
  module Schedule
3
- VERSION = '0.6.0'
3
+ VERSION = '0.7.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.6.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-05-12 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holiday_japan