increments-schedule 0.9.0 → 0.10.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 -0
- data/Rakefile +1 -1
- data/lib/increments/schedule.rb +5 -1
- 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: 1895b52bd9cf3713cf61d9f5cbbee9ef44ca01ff
|
4
|
+
data.tar.gz: 29f8f43f0c44fdd54da625207b238244725b6c2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95ce81dcb2ea14251631ee0cf56697a330b3e04d91c587976e80fb11d7ac51bada38f127425da13c035bc6d5136671127482c884e1619ab0aa5e831b79711c16
|
7
|
+
data.tar.gz: 91145075410130e50b16d2673dec8cca93c5c6c4bc09c3689fac7936d631cdb10c837e29f4aaf9cd5ca4692317e61105eec94d25ae361a703272f00b801fe167
|
data/README.md
CHANGED
@@ -30,6 +30,7 @@ $ gem install increments-schedule
|
|
30
30
|
|
31
31
|
### Predicate Methods
|
32
32
|
|
33
|
+
* `Increments::Schedule.foundation_anniversary?(date = Date.today)`
|
33
34
|
* `Increments::Schedule.super_hanakin?(date = Date.today)`
|
34
35
|
* `Increments::Schedule.pay_day?(date = Date.today)`
|
35
36
|
* `Increments::Schedule.work_day?(date = Date.today)`
|
@@ -44,6 +45,7 @@ $ gem install increments-schedule
|
|
44
45
|
|
45
46
|
### Enumeration Methods
|
46
47
|
|
48
|
+
* `Increments::Schedule.each_foundation_anniversary(max_date = Date.today + 365)`
|
47
49
|
* `Increments::Schedule.each_super_hanakin(max_date = Date.today + 365)`
|
48
50
|
* `Increments::Schedule.each_pay_day(max_date = Date.today + 365)`
|
49
51
|
* `Increments::Schedule.each_work_day(max_date = Date.today + 365)`
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ namespace :readme do
|
|
20
20
|
puts 'Validating README.md...'
|
21
21
|
|
22
22
|
unless File.read('README.md') == generate_readme
|
23
|
-
|
23
|
+
raise <<-END.gsub(/^\s+\|/, '').chomp
|
24
24
|
|README.md and README.md.erb are out of sync!
|
25
25
|
|If you need to modify the content of README.md:
|
26
26
|
| * Edit README.md.erb.
|
data/lib/increments/schedule.rb
CHANGED
@@ -8,6 +8,10 @@ module Increments
|
|
8
8
|
INFINITY_FUTURE = Date.new(10_000, 1, 1)
|
9
9
|
INFINITY_PAST = Date.new(0, 1, 1)
|
10
10
|
|
11
|
+
def foundation_anniversary?(date = Date.today)
|
12
|
+
date.month == 2 && date.day == 29
|
13
|
+
end
|
14
|
+
|
11
15
|
def super_hanakin?(date = Date.today)
|
12
16
|
date.friday? && pay_day?(date)
|
13
17
|
end
|
@@ -88,7 +92,7 @@ module Increments
|
|
88
92
|
end
|
89
93
|
|
90
94
|
def find_date(date, direction)
|
91
|
-
|
95
|
+
raise ArgumentError unless [:upto, :downto].include?(direction)
|
92
96
|
limit_date = direction == :upto ? INFINITY_FUTURE : INFINITY_PAST
|
93
97
|
date.send(direction, limit_date) do |d|
|
94
98
|
break d if yield d
|
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.10.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-
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holiday_japan
|