lunar_calendar 0.1.0 → 0.1.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 +4 -4
- data/Gemfile.lock +25 -23
- data/lib/lunar_calendar/lunar.rb +21 -0
- data/lib/lunar_calendar/version.rb +1 -1
- data/lib/lunar_calendar.rb +6 -0
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 882b9f94fa4001e0c799eb6997bc917cd9fc1953504bbeadfaa25b8c8598240a
|
|
4
|
+
data.tar.gz: bbf28363fa1c0c45c17a8eec93cfad3bd52f9986af470680713a008c9c29b8df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a699e6dbbd350cbe592e1e2088e7c000406dcae25ddab829df4af04bdc4dd67932a92984776ea3f65be247a16a5de4817ce63d7d8486f9a86892e33aa8f441b
|
|
7
|
+
data.tar.gz: 1e88a39c86c61fbc582839826d9e10cfc98077fdf77e4f35933f5bd1d665429790f9188b26b61f16ff3655a7faeea8728aee8203f92196d55b8f637d038f16e1
|
data/Gemfile.lock
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
lunar_calendar (0.1.
|
|
4
|
+
lunar_calendar (0.1.1)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
ast (2.4.
|
|
10
|
-
diff-lcs (1.
|
|
11
|
-
jaro_winkler (1.5.
|
|
12
|
-
parallel (1.
|
|
13
|
-
parser (
|
|
14
|
-
ast (~> 2.4.
|
|
15
|
-
|
|
9
|
+
ast (2.4.3)
|
|
10
|
+
diff-lcs (1.6.2)
|
|
11
|
+
jaro_winkler (1.5.6)
|
|
12
|
+
parallel (1.27.0)
|
|
13
|
+
parser (3.3.10.0)
|
|
14
|
+
ast (~> 2.4.1)
|
|
15
|
+
racc
|
|
16
|
+
racc (1.8.1)
|
|
17
|
+
rainbow (3.1.1)
|
|
16
18
|
rake (12.3.3)
|
|
17
|
-
rexml (3.
|
|
18
|
-
rspec (3.
|
|
19
|
-
rspec-core (~> 3.
|
|
20
|
-
rspec-expectations (~> 3.
|
|
21
|
-
rspec-mocks (~> 3.
|
|
22
|
-
rspec-core (3.
|
|
23
|
-
rspec-support (~> 3.
|
|
24
|
-
rspec-expectations (3.
|
|
19
|
+
rexml (3.4.4)
|
|
20
|
+
rspec (3.13.2)
|
|
21
|
+
rspec-core (~> 3.13.0)
|
|
22
|
+
rspec-expectations (~> 3.13.0)
|
|
23
|
+
rspec-mocks (~> 3.13.0)
|
|
24
|
+
rspec-core (3.13.6)
|
|
25
|
+
rspec-support (~> 3.13.0)
|
|
26
|
+
rspec-expectations (3.13.5)
|
|
25
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
26
|
-
rspec-support (~> 3.
|
|
27
|
-
rspec-mocks (3.
|
|
28
|
+
rspec-support (~> 3.13.0)
|
|
29
|
+
rspec-mocks (3.13.7)
|
|
28
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
29
|
-
rspec-support (~> 3.
|
|
30
|
-
rspec-support (3.
|
|
31
|
+
rspec-support (~> 3.13.0)
|
|
32
|
+
rspec-support (3.13.6)
|
|
31
33
|
rubocop (0.80.1)
|
|
32
34
|
jaro_winkler (~> 1.5.1)
|
|
33
35
|
parallel (~> 1.10)
|
|
@@ -36,7 +38,7 @@ GEM
|
|
|
36
38
|
rexml
|
|
37
39
|
ruby-progressbar (~> 1.7)
|
|
38
40
|
unicode-display_width (>= 1.4.0, < 1.7)
|
|
39
|
-
ruby-progressbar (1.
|
|
41
|
+
ruby-progressbar (1.13.0)
|
|
40
42
|
unicode-display_width (1.6.1)
|
|
41
43
|
|
|
42
44
|
PLATFORMS
|
|
@@ -45,8 +47,8 @@ PLATFORMS
|
|
|
45
47
|
DEPENDENCIES
|
|
46
48
|
lunar_calendar!
|
|
47
49
|
rake (~> 12.0)
|
|
48
|
-
rspec (~> 3.0)
|
|
50
|
+
rspec (~> 3.0, >= 0)
|
|
49
51
|
rubocop (~> 0.80.1)
|
|
50
52
|
|
|
51
53
|
BUNDLED WITH
|
|
52
|
-
|
|
54
|
+
4.0.1
|
data/lib/lunar_calendar/lunar.rb
CHANGED
|
@@ -22,5 +22,26 @@ module LunarCalendar
|
|
|
22
22
|
def leap?
|
|
23
23
|
@leap == true
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
# @return [String] The Chinese Era
|
|
27
|
+
#
|
|
28
|
+
# @since 0.1.0
|
|
29
|
+
def chinese_era
|
|
30
|
+
"#{heavenly}#{earthly}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# @return [String] Heavenly Stems
|
|
34
|
+
#
|
|
35
|
+
# @since 0.1.0
|
|
36
|
+
def heavenly
|
|
37
|
+
LunarCalendar::HEAVENLY_STEMS[(@year - 4) % 10]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @return [String] Earthly Stems
|
|
41
|
+
#
|
|
42
|
+
# @since 0.1.0
|
|
43
|
+
def earthly
|
|
44
|
+
LunarCalendar::EARTHLY_STEMS[(@year - 4) % 12]
|
|
45
|
+
end
|
|
25
46
|
end
|
|
26
47
|
end
|
data/lib/lunar_calendar.rb
CHANGED
|
@@ -9,6 +9,12 @@ module LunarCalendar
|
|
|
9
9
|
# @since 0.1.0
|
|
10
10
|
SUPPORT_YEARS = (1888..2100).freeze
|
|
11
11
|
|
|
12
|
+
# @since 0.1.0
|
|
13
|
+
HEAVENLY_STEMS = %w[甲 乙 丙 丁 戊 己 庚 辛 壬 癸].freeze
|
|
14
|
+
|
|
15
|
+
# @since 0.1.0
|
|
16
|
+
EARTHLY_STEMS = %w[子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥].freeze
|
|
17
|
+
|
|
12
18
|
# Convert Solar to Lunar
|
|
13
19
|
#
|
|
14
20
|
# @param year [Number] year
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lunar_calendar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 蒼時弦也
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rspec
|
|
@@ -72,7 +71,6 @@ licenses: []
|
|
|
72
71
|
metadata:
|
|
73
72
|
homepage_uri: https://github.com/elct9620/lunar_calendar
|
|
74
73
|
source_code_uri: https://github.com/elct9620/lunar_calendar
|
|
75
|
-
post_install_message:
|
|
76
74
|
rdoc_options: []
|
|
77
75
|
require_paths:
|
|
78
76
|
- lib
|
|
@@ -87,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
87
85
|
- !ruby/object:Gem::Version
|
|
88
86
|
version: '0'
|
|
89
87
|
requirements: []
|
|
90
|
-
rubygems_version: 3.
|
|
91
|
-
signing_key:
|
|
88
|
+
rubygems_version: 3.6.9
|
|
92
89
|
specification_version: 4
|
|
93
90
|
summary: The calculator to calculate lunar calendar
|
|
94
91
|
test_files: []
|