holidays_in_month 0.1.5 → 0.1.6

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: 4004d063bd3e7790c5a8b13aa54f962ac6dbf24e
4
- data.tar.gz: 7219b1983f096e3ae26466a9ddadff635adf333c
3
+ metadata.gz: d975839586892b78cfae940d01070bbdc9505a28
4
+ data.tar.gz: c21a647aadf470be2ed97d869c91af235a916169
5
5
  SHA512:
6
- metadata.gz: fac6992dd6bf6a71d9fc453d5dfa2439b04d8fbd169c5b9b235a03d43274e8a3b300e250e402f28463dd25f42e1200572f5f16a8049084e585ea5c4f04062268
7
- data.tar.gz: 21d82c3135ea7394fb56af6c99433d8ec729db455f2ae139cf5dadaed6dbb3e21e75dce5cb8146f8ea2234c62dc2765b53282717bf8e0ed7545a37e6d8f8fb9e
6
+ metadata.gz: 58be1c67e9e82fa4b54684fbf352c9e20397e26f3289a872053c938b4f75023d15770831240bde97a47c93317213dfae2cad1780a8efdcf9c67d29a354773de1
7
+ data.tar.gz: 2c16ad072faaef045880b54e8322186eba264f09e12f691f0739d65821fc8e298460510923835e52424c4be893e830ea61cccae08dba1328793ba549ce42e987
@@ -1,3 +1,3 @@
1
1
  module Holidays
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -1,36 +1,37 @@
1
- class Holidays
2
- def initialize
3
- @nationaldays = {}
4
- @holidays = []
5
- end
1
+ module JP
2
+ class Holidays
3
+ def initialize
4
+ @nationaldays = {}
5
+ @holidays = []
6
+ end
6
7
 
7
- def in_month(year, month)
8
- holidays(year, month) << nationaldays.select { |n| n.match(/#{year}-#{"%02d" % month}-*/) }
9
- end
8
+ def in_month(year, month)
9
+ holidays(year, month) << nationaldays.select { |n| n.match(/#{year}-#{"%02d" % month}-*/) }
10
+ end
10
11
 
11
- private
12
+ private
12
13
 
13
- def nationaldays
14
- yaml = YAML.load_file(File.expand_path('./../../holidays.yml', __FILE__))
15
- yaml.each do |date, name|
16
- @nationaldays.store(date.strftime("%Y-%m-%d"), name)
14
+ def nationaldays
15
+ yaml = YAML.load_file(File.expand_path('./../../holidays.yml', __FILE__))
16
+ yaml.each do |date, name|
17
+ @nationaldays.store(date.strftime("%Y-%m-%d"), name)
18
+ end
19
+ @nationaldays
17
20
  end
18
- @nationaldays
19
- end
20
21
 
21
- def holidays(year, month)
22
- num_days_of_month = Date.new(year, month).end_of_month.day
22
+ def holidays(year, month)
23
+ num_days_of_month = Date.new(year, month).end_of_month.day
23
24
 
24
- 1.upto(num_days_of_month) do |day|
25
- wday = Date.new(year, month, day).wday
26
- @holidays << "%04d-%02d-%02d" % [year, month, day] if wday == 6 || wday == 0
25
+ 1.upto(num_days_of_month) do |day|
26
+ wday = Date.new(year, month, day).wday
27
+ @holidays << "%04d-%02d-%02d" % [year, month, day] if wday == 6 || wday == 0
28
+ end
29
+ @holidays
27
30
  end
28
- @holidays
29
31
  end
30
- end
31
32
 
32
- require 'holidays_in_month/version'
33
- require 'active_support'
34
- require 'active_support/time'
35
- require 'time'
36
- require 'yaml'
33
+ require 'holidays_in_month/version'
34
+ require 'active_support'
35
+ require 'active_support/time'
36
+ require 'time'
37
+ require 'yaml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holidays_in_month
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuta Hasada