mcalendar 0.5.1 → 0.5.2

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
  SHA256:
3
- metadata.gz: 106df652910d9257dddfa3814af1ab493c2ead746ed454c94ce4aa9950014f16
4
- data.tar.gz: 6889c7be1874699ac9c86bd96ee7e48f1d61a566c90a78dfb2f398163e86dcda
3
+ metadata.gz: 01d1ff265098d4230e22ea2fc37fa0abc0eb0beab77d4ed599b4d3b9d5010ba1
4
+ data.tar.gz: e4690991dcd510c5b6586d1ccb84a6504c6774962c1a0def325cb5464bdbb152
5
5
  SHA512:
6
- metadata.gz: 953e8b02928a44b6129fc716858aceaf0d29288bd473b3f2e9e2e6dd2a3f7a8276fc1948e403840acb7640b83a68e4f733100c93d2fdc114843c33412823e629
7
- data.tar.gz: 027ba073a3567099bf0f18378726925754097826ea8066c1c99b1776e87e90b816f9f6fc9af1cf03b41b1656ade0dc61c1bc2cfbe5e54fb4ffca8680d40d7801
6
+ metadata.gz: 49c1671c2e46bccae55d446fa2ef6a81cbb2b690d806bb7f909a9e0f6ef7a6b8ba8544cf7ec19cc503fa873692b4ab6f6485d4bd25293e4185f12ffcb789e0f9
7
+ data.tar.gz: 3db78a0da8022da712daa53a2c61a34b0e7aa986abf8a71ade7e2827c92cea320f263d03173cae21c26751640de3cfb204eaba4703fc5aa9a5f357e508eab0b3
data/README.md CHANGED
@@ -74,7 +74,7 @@ mcalendar 2021/02 -n my_calendar.pdf
74
74
 
75
75
  ### Configure mcalendar schedule
76
76
 
77
- mcalendar reads mcalendar.yml in the current working directory as mcalendar's schedule file. It can contain the following settings:
77
+ mcalendar reads `~/.mcalendar.yml` or `mcalendar.yml` in the current working directory as mcalendar's schedule file. It can contain the following settings:
78
78
  * holiday
79
79
  * anniversary
80
80
 
@@ -23,5 +23,6 @@ module Mcalendar
23
23
  DEFAULT_PDF_NAME = "calendar.pdf".freeze
24
24
 
25
25
  DEFAULT_CONFIG_FILE = "mcalendar.yml".freeze
26
-
26
+ GLOBAL_CONFIG_FILE = File.expand_path("~/.mcalendar.yml").freeze
27
+ BUILT_IN_CONFIG_FILE = File.expand_path("../../mcalendar.yml", __dir__).freeze
27
28
  end
@@ -7,14 +7,17 @@ module Mcalendar
7
7
  :anniversary => {}
8
8
  }
9
9
 
10
- # If mcalendar.yml is not found, load the built-in mcalendar.yml.
10
+ # If mcalendar.yml or ~/.mcalendar.yml is not found, load the built-in mcalendar.yml.
11
11
  if File.exist?(Mcalendar::DEFAULT_CONFIG_FILE)
12
- load_config(Mcalendar::DEFAULT_CONFIG_FILE)
12
+ config_yaml = Mcalendar::DEFAULT_CONFIG_FILE
13
+ elsif File.exist?(Mcalendar::GLOBAL_CONFIG_FILE)
14
+ config_yaml = Mcalendar::GLOBAL_CONFIG_FILE
13
15
  else
14
- config_file = File.expand_path("../../mcalendar.yml",__dir__)
15
- load_config(config_file)
16
+ config_yaml = Mcalendar::BUILT_IN_CONFIG_FILE
16
17
  end
17
18
 
19
+ load_config(config_yaml)
20
+
18
21
  end
19
22
 
20
23
  def hash_key_to_sym(h)
@@ -1,3 +1,3 @@
1
1
  module Mcalendar
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
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.1
4
+ version: 0.5.2
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-18 00:00:00.000000000 Z
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn