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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 553ac09e770c776c84b069f61c6ede408ac12b12
4
- data.tar.gz: 1cac7a0f9ae21ce10545a60b33ce7c1d13300c4b
3
+ metadata.gz: 1895b52bd9cf3713cf61d9f5cbbee9ef44ca01ff
4
+ data.tar.gz: 29f8f43f0c44fdd54da625207b238244725b6c2a
5
5
  SHA512:
6
- metadata.gz: 47d2ccd9b3db19c912f42c2e2d0e4887606d0857868acc29f74a237a77ceb0cafc9ef623007ec3c340ad3d4c6cd1b750d593546345dc0150dd78f3fdae332899
7
- data.tar.gz: bcdc9e77961dd73e6200714660f38d1ad0ae48a2bce3c6b62e42de4efb95a630190698e2d4d9ddaa4078ca3ab2f1c8db40a80612644ab736c2cbf3ebf4ad3564
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
- fail <<-END.gsub(/^\s+\|/, '').chomp
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.
@@ -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
- fail ArgumentError unless [:upto, :downto].include?(direction)
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
@@ -1,5 +1,5 @@
1
1
  module Increments
2
2
  module Schedule
3
- VERSION = '0.9.0'
3
+ VERSION = '0.10.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.9.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-02-01 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holiday_japan