holiday_jp 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 536be0ebf5f29df642ea4f62587484bb3f280270
4
- data.tar.gz: 9099b2a10cc4230018211aa146e52e4704c6e64c
3
+ metadata.gz: 7e3026947427429ae959f278c0aa185fd10bb224
4
+ data.tar.gz: 709ea9befe598f1c537c2e3cd63961d774b01752
5
5
  SHA512:
6
- metadata.gz: ad706d06df13eaa214795636392a4865f1e53c7ceed9c599589928bffb54142a0bb1f5553486c9d614566a334dc36bdb776de8efe20df55eff14bb18ae618a57
7
- data.tar.gz: a316fe06c09e4bc7e3697c5afa9318a8de2c6015697ce8ace8a6dcb529e2695b9d870074e4f540da281668f6f4bdef057dadf3bd60ca2abe4dcca36f4dbd8639
6
+ metadata.gz: f24f8a7b2091f9bc8bff2e3207ddfd474182441dcac1e6816a26de970949b39507bc96861c1046c770acd06364888efcc08980f5f044c5875da2992428a03323
7
+ data.tar.gz: 9a457e405db33da36b2f9958fdff5299189274eeea9cb7f0aebf2ee9a83d2432e89eeab9cd3a9496a8353620acd0087f2fabb8431f0a09d86fc9446d5d03e390
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.2.3
7
7
  - 2.2.5
8
8
  - 2.3.1
9
+ - 2.4.1
9
10
  before_install:
10
11
  - sudo apt-get update
11
12
  - gem update bundler
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # holiday_jp [<img src="https://secure.travis-ci.org/komagata/holiday_jp.png"/>](http://travis-ci.org/komagata/holiday_jp)
1
+ # holiday_jp [![Build Status](https://travis-ci.org/holiday-jp/holiday_jp-ruby.svg?branch=master)](https://travis-ci.org/holiday-jp/holiday_jp-ruby)
2
2
 
3
3
  Get holidays in Japan.
4
4
 
data/holidays.yml CHANGED
@@ -737,7 +737,6 @@
737
737
  2018-01-08: 成人の日
738
738
  2018-02-11: 建国記念の日
739
739
  2018-02-12: 振替休日
740
- 2018-02-23: 天皇誕生日
741
740
  2018-03-21: 春分の日
742
741
  2018-04-29: 昭和の日
743
742
  2018-04-30: 振替休日
@@ -752,6 +751,7 @@
752
751
  2018-10-08: 体育の日
753
752
  2018-11-03: 文化の日
754
753
  2018-11-23: 勤労感謝の日
754
+ 2018-12-23: 天皇誕生日
755
755
  2018-12-24: 振替休日
756
756
  2019-01-01: 元日
757
757
  2019-01-14: 成人の日
data/lib/holiday_jp.rb CHANGED
@@ -1,6 +1,5 @@
1
- # -*- coding: utf-8 -*-
2
- require 'holiday_jp/holiday'
3
- require 'holiday_jp/holidays'
1
+ require "holiday_jp/holiday"
2
+ require "holiday_jp/holidays"
4
3
 
5
4
  module HolidayJp
6
5
  def self.between(start, last)
@@ -11,8 +10,6 @@ module HolidayJp
11
10
  holidays.holiday?(date)
12
11
  end
13
12
 
14
- private
15
-
16
13
  def self.holidays
17
14
  @@_holidays ||= Holidays.new
18
15
  end
@@ -1,31 +1,32 @@
1
1
  # -*- coding: utf-8 -*-
2
- require 'date'
2
+ require "date"
3
+
3
4
  module HolidayJp
4
5
  class Holiday
5
6
  WDAY_NAMES = %w(日 月 火 水 木 金 土)
6
7
 
7
8
  EN_HOLIDAY_NAMES = {
8
- '元日' => "New Year's Day",
9
- '成人の日' => 'Coming of Age Day',
10
- '建国記念の日' => 'National Foundation Day',
11
- '春分の日' => 'Vernal Equinox Day',
12
- '憲法記念日' => 'Constitution Memorial Day',
13
- 'みどりの日' => 'Greenery Day',
14
- 'こどもの日' => "Children's Day",
15
- '海の日' => 'Marine Day',
16
- '山の日' => 'Mountain Day',
17
- '敬老の日' => 'Respect for the Aged Day',
18
- '秋分の日' => 'Autumnal Equinox Day',
19
- '体育の日' => 'Health and Sports Day',
20
- '文化の日' => 'National Culture Day',
21
- '勤労感謝の日' => 'Labor Thanksgiving Day',
22
- '天皇誕生日' => "Emperor's Birthday",
23
- '昭和の日' => 'Showa Day',
24
- '振替休日' => 'Holiday in lieu',
25
- '国民の休日' => "Citizen's Holiday",
26
- '即位礼正殿の儀' => 'The Ceremony of the Enthronement of His Majesty th Emperor (at the Seiden)',
27
- '昭和天皇の大喪の礼' => 'The Funeral Ceremony of Emperor Showa.',
28
- '皇太子徳仁親王の結婚の儀' => 'The Rite of Wedding of HIH Crown Prince Naruhito'
9
+ "元日" => "New Year's Day",
10
+ "成人の日" => "Coming of Age Day",
11
+ "建国記念の日" => "National Foundation Day",
12
+ "春分の日" => "Vernal Equinox Day",
13
+ "憲法記念日" => "Constitution Memorial Day",
14
+ "みどりの日" => "Greenery Day",
15
+ "こどもの日" => "Children's Day",
16
+ "海の日" => "Marine Day",
17
+ "山の日" => "Mountain Day",
18
+ "敬老の日" => "Respect for the Aged Day",
19
+ "秋分の日" => "Autumnal Equinox Day",
20
+ "体育の日" => "Health and Sports Day",
21
+ "文化の日" => "National Culture Day",
22
+ "勤労感謝の日" => "Labor Thanksgiving Day",
23
+ "天皇誕生日" => "Emperor's Birthday",
24
+ "昭和の日" => "Showa Day",
25
+ "振替休日" => "Holiday in lieu",
26
+ "国民の休日" => "Citizen's Holiday",
27
+ "即位礼正殿の儀" => "The Ceremony of the Enthronement of His Majesty th Emperor (at the Seiden)",
28
+ "昭和天皇の大喪の礼" => "The Funeral Ceremony of Emperor Showa.",
29
+ "皇太子徳仁親王の結婚の儀" => "The Rite of Wedding of HIH Crown Prince Naruhito"
29
30
  }
30
31
 
31
32
  attr_reader :date, :name
@@ -1,5 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- require 'yaml'
1
+ require "yaml"
3
2
 
4
3
  module HolidayJp
5
4
  class Holidays
@@ -7,7 +6,7 @@ module HolidayJp
7
6
 
8
7
  def initialize
9
8
  @holidays = {}
10
- yaml = YAML.load_file(File.expand_path('../../../holidays.yml', __FILE__))
9
+ yaml = YAML.load_file(File.expand_path("../../../holidays.yml", __FILE__))
11
10
  yaml.map do |key, value|
12
11
  @holidays[key] = Holiday.new(key, value)
13
12
  end
@@ -1,3 +1,3 @@
1
1
  module HolidayJp
2
- VERSION = '0.5.1'
2
+ VERSION = "0.6.1"
3
3
  end
@@ -36,11 +36,11 @@ class TestHolidayJp < Test::Unit::TestCase
36
36
  assert HolidayJp.holiday?(Date.new(year, 4, 29))
37
37
  end
38
38
 
39
- 1989.upto(2016) do |year|
39
+ 1989.upto(2018) do |year|
40
40
  assert HolidayJp.holiday?(Date.new(year, 12, 23))
41
41
  end
42
42
 
43
- 2018.upto(2050) do |year|
43
+ 2019.upto(2050) do |year|
44
44
  assert HolidayJp.holiday?(Date.new(year, 2, 23))
45
45
  end
46
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holiday_jp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Komagata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project: holiday_jp
98
- rubygems_version: 2.5.1
98
+ rubygems_version: 2.6.13
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Japanese Holidays.