mcalendar 0.5.2 → 0.5.3

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
  SHA256:
3
- metadata.gz: 01d1ff265098d4230e22ea2fc37fa0abc0eb0beab77d4ed599b4d3b9d5010ba1
4
- data.tar.gz: e4690991dcd510c5b6586d1ccb84a6504c6774962c1a0def325cb5464bdbb152
3
+ metadata.gz: e0ba0d5eb52a4d7229c2a6e44d19b5d88cb48f429ee26756e94f5ff57c6da889
4
+ data.tar.gz: ff7860a811535caf70ddd900546ea0cffc1fa36c58b0bc53a7577ce020b82aa7
5
5
  SHA512:
6
- metadata.gz: 49c1671c2e46bccae55d446fa2ef6a81cbb2b690d806bb7f909a9e0f6ef7a6b8ba8544cf7ec19cc503fa873692b4ab6f6485d4bd25293e4185f12ffcb789e0f9
7
- data.tar.gz: 3db78a0da8022da712daa53a2c61a34b0e7aa986abf8a71ade7e2827c92cea320f263d03173cae21c26751640de3cfb204eaba4703fc5aa9a5f357e508eab0b3
6
+ metadata.gz: 694f1a3e42c289590ea5140b8f2959e5924fcd219f5b43a4123c3293b6468f80c3c162ba9667cb00d1f25c1ace2602e2685d38e2b610dd6adabaa448541246f4
7
+ data.tar.gz: 5eee6f4f6e9afb2fca6a8a028ddd983bb057015677e58d3ffc92b34cb0766277072a36ed526cafe22e3f427d4f1d307a0c8c7fb86b260476959dfa51dbe091a3
@@ -61,13 +61,14 @@ module Mcalendar
61
61
 
62
62
  begin
63
63
  remained = parser.parse!(argv)
64
- rescue OptionParser::InvalidArgument => e
65
- abort e.message
66
64
  rescue OptionParser::MissingArgument => e
67
65
  case e.args
68
66
  when ["-n"], ["--name"]
69
67
  @options[:name] = Mcalendar::DEFAULT_PDF_NAME
70
68
  end
69
+ rescue OptionParser::ParseError => e
70
+ puts parser
71
+ abort e.message
71
72
  end
72
73
 
73
74
  begin
@@ -18,16 +18,24 @@ module Mcalendar
18
18
  @days_config = Hash.new(nil)
19
19
  @holidays = @config_schedule[:holiday]
20
20
  @anniversaries = @config_schedule[:anniversary]
21
+ @date = @config_schedule[:date]
21
22
 
22
23
  setup_schedule
23
24
  end
24
25
 
26
+ def holidays_in_the_year(holidays)
27
+ holidays.map do |k,v|
28
+ year_of_key = Date.parse(k.to_s).year
29
+ "#{k}: #{v}" if year_of_key == Date.parse(@date.to_s).year
30
+ end.compact
31
+ end
32
+
25
33
  def show_holidays
26
- @holidays.map{|k,v| "#{k}: #{v}"}
34
+ holidays_in_the_year(@holidays)
27
35
  end
28
36
 
29
37
  def show_anniversaries
30
- @anniversaries.map{|k,v| "#{k}: #{v}"}
38
+ holidays_in_the_year(@anniversaries)
31
39
  end
32
40
 
33
41
  def setup_schedule
@@ -1,3 +1,3 @@
1
1
  module Mcalendar
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
data/mcalendar.yml CHANGED
@@ -1,4 +1,9 @@
1
+ # Japanese holidays in English
2
+ # https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html
3
+ # 2021 -> 2022
4
+
1
5
  holiday:
6
+ # 2021
2
7
  20210101: New Year's Day
3
8
  20210111: Coming-of-age Day
4
9
  20210211: National Foundation Day
@@ -16,10 +21,32 @@ holiday:
16
21
  20210923: Autumnal Equinox Day
17
22
  20211103: Culture Day
18
23
  20211123: Labour Thanksgiving Day
24
+ # 2022
25
+ 20220101: New Year's Day
26
+ 20220110: Coming-of-age Day
27
+ 20220211: National Foundation Day
28
+ 20220223: Emperor's Birthday
29
+ 20220321: Vernal Equinox Day
30
+ 20220429: Showa Day
31
+ 20220503: Constitution Memorial Day
32
+ 20220504: Greenery Day
33
+ 20220505: Children's Day
34
+ 20220718: Marine Day
35
+ 20220811: Mountain Day
36
+ 20220919: Respect for the Aged Day
37
+ 20220923: Autumnal Equinox Day
38
+ 20221010: Sports Day
39
+ 20221103: Culture Day
40
+ 20221123: Labour Thanksgiving Day
19
41
 
20
42
  anniversary:
43
+ # 2021
21
44
  20210224: Ruby's Birthday
22
45
  20210909: RubyKaigi Takeout 2021
23
46
  20210910: RubyKaigi Takeout 2021
24
47
  20210911: RubyKaigi Takeout 2021
25
-
48
+ # 2022
49
+ 20220224: Ruby's Birthday
50
+ # 2022xxxx: RubyKaigi
51
+ # 2022xxxx: RubyKaigi
52
+ # 2022xxxx: RubyKaigi
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcalendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - icm7216
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-20 00:00:00.000000000 Z
11
+ date: 2022-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn