ruby_lunardate 0.0.6 → 0.0.7

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: d2d4a3f8dd0e16ee050fea3d77bae6e3965a0ce1
4
- data.tar.gz: 1107f26640819db8d0997fac9fc1541022f5bf4d
3
+ metadata.gz: 3982761f8a047576b3f1fbef2665397a3986bd68
4
+ data.tar.gz: f05ea450e7dea591ce5b3f88f2c5bafa376db893
5
5
  SHA512:
6
- metadata.gz: d4d678c8d317ad5f2ab42f5da0c852a8da22920c561c808572a0512e9e738e71e45cfbb89cbb6c34de7a92d5c834e15f6d2be7582e3697475eb6a81be73d189d
7
- data.tar.gz: 983544452b663aa2d8690e5b1c2f65706a497fbe8572aca467f1dbddaabd17aace8596f46a4d2f35e66153e06c33c57b3105ad3e35ad5dc21b80a6e0fc68e68e
6
+ metadata.gz: 389adbfa69caf9e06ebda5aaec0f2961c2bf7705eacca751e8f0f186d736d67099b535816b5f23655cebe70af14b5030d55b45bae26604b03c11cfec9552c318
7
+ data.tar.gz: 390716a6d4caa79388984318333bb49dd8ce5c56617eaa3025749d7ba28522e853178b3c3cf3f6e3754e0944f3e7ddb4e6798d31e1df0e2751f9e82909ef0d9a
@@ -211,7 +211,7 @@ class LunarDate
211
211
  return (solar_date - @start_date).to_i
212
212
  end
213
213
 
214
- def self.to_lunar(year, month, day)
214
+ def self.from_solar(year, month, day)
215
215
  solar_date = Date.new(year, month, day)
216
216
  days = self.get_dates(solar_date)
217
217
  return self.lunar_from_days(days, self)
@@ -2,8 +2,8 @@ require 'minitest/autorun'
2
2
  require 'ruby_lunardate'
3
3
 
4
4
  class TestRubyLunarDate < Minitest::Test
5
- def test_to_lunar_19790922_from_solar_19791111
6
- date = LunarDate.to_lunar(1979, 11, 11)
5
+ def test_from_solar_19790922_from_solar_19791111
6
+ date = LunarDate.from_solar(1979, 11, 11)
7
7
  assert_equal(date.year, 1979)
8
8
  assert_equal(date.month, 9)
9
9
  assert_equal(date.day, 22)
@@ -15,8 +15,8 @@ class TestRubyLunarDate < Minitest::Test
15
15
  assert_equal(lunar_date.day, 11)
16
16
  end
17
17
 
18
- def test_to_lunar_19000101_from_solar_19000131
19
- date = LunarDate.to_lunar(1900, 1, 31)
18
+ def test_from_solar_19000101_from_solar_19000131
19
+ date = LunarDate.from_solar(1900, 1, 31)
20
20
  assert_equal(date.year, 1900)
21
21
  assert_equal(date.month, 1)
22
22
  assert_equal(date.day, 1)
@@ -28,8 +28,8 @@ class TestRubyLunarDate < Minitest::Test
28
28
  assert_equal(lunar_date.day, 31)
29
29
  end
30
30
 
31
- def test_to_lunar_19020101_from_solar_19020208
32
- date = LunarDate.to_lunar(1902, 2, 8)
31
+ def test_from_solar_19020101_from_solar_19020208
32
+ date = LunarDate.from_solar(1902, 2, 8)
33
33
  assert_equal(date.year, 1902)
34
34
  assert_equal(date.month, 1)
35
35
  assert_equal(date.day, 1)
@@ -41,8 +41,8 @@ class TestRubyLunarDate < Minitest::Test
41
41
  assert_equal(lunar_date.day, 8)
42
42
  end
43
43
 
44
- def test_to_lunar_19040101_from_solar_19040216
45
- date = LunarDate.to_lunar(1904, 2, 16)
44
+ def test_from_solar_19040101_from_solar_19040216
45
+ date = LunarDate.from_solar(1904, 2, 16)
46
46
  assert_equal(date.year, 1904)
47
47
  assert_equal(date.month, 1)
48
48
  assert_equal(date.day, 1)
@@ -54,8 +54,8 @@ class TestRubyLunarDate < Minitest::Test
54
54
  assert_equal(lunar_date.day, 16)
55
55
  end
56
56
 
57
- def test_to_lunar_20140930_from_solar_20141023
58
- date = LunarDate.to_lunar(2014, 10, 23)
57
+ def test_from_solar_20140930_from_solar_20141023
58
+ date = LunarDate.from_solar(2014, 10, 23)
59
59
  assert_equal(date.year, 2014)
60
60
  assert_equal(date.month, 9)
61
61
  assert_equal(date.day, 30)
@@ -67,8 +67,8 @@ class TestRubyLunarDate < Minitest::Test
67
67
  assert_equal(lunar_date.day, 23)
68
68
  end
69
69
 
70
- def test_to_lunar_19870621_from_solar_19870815_leap
71
- date = LunarDate.to_lunar(1987, 8, 15)
70
+ def test_from_solar_19870621_from_solar_19870815_leap
71
+ date = LunarDate.from_solar(1987, 8, 15)
72
72
  assert_equal(date.year, 1987)
73
73
  assert_equal(date.month, 6)
74
74
  assert_equal(date.day, 21)
@@ -81,8 +81,8 @@ class TestRubyLunarDate < Minitest::Test
81
81
  end
82
82
 
83
83
  # 3rd MONTHTYPE test case
84
- def test_to_lunar_20171025_from_solar_20171212
85
- date = LunarDate.to_lunar(2017, 12, 12)
84
+ def test_from_solar_20171025_from_solar_20171212
85
+ date = LunarDate.from_solar(2017, 12, 12)
86
86
  assert_equal(date.year, 2017)
87
87
  assert_equal(date.month, 10)
88
88
  assert_equal(date.day, 25)
@@ -95,8 +95,8 @@ class TestRubyLunarDate < Minitest::Test
95
95
  end
96
96
 
97
97
  # 4th MONTHTYPE test case
98
- def test_to_lunar_19870729_from_solar_19870921
99
- date = LunarDate.to_lunar(1987, 9, 21)
98
+ def test_from_solar_19870729_from_solar_19870921
99
+ date = LunarDate.from_solar(1987, 9, 21)
100
100
  assert_equal(date.year, 1987)
101
101
  assert_equal(date.month, 7)
102
102
  assert_equal(date.day, 29)
@@ -109,8 +109,8 @@ class TestRubyLunarDate < Minitest::Test
109
109
  end
110
110
 
111
111
  # 5th MONTHTYPE test case
112
- def test_to_lunar_19551119_from_solar_19560101
113
- date = LunarDate.to_lunar(1956, 1, 1)
112
+ def test_from_solar_19551119_from_solar_19560101
113
+ date = LunarDate.from_solar(1956, 1, 1)
114
114
  assert_equal(date.year, 1955)
115
115
  assert_equal(date.month, 11)
116
116
  assert_equal(date.day, 19)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_lunardate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - sunsidew