when_exe 0.4.2 → 0.5.0

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.
Files changed (144) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.ja.txt +8 -21
  3. data/LICENSE.txt +5 -27
  4. data/README.md +25 -79
  5. data/bin/.pryrc +9 -0
  6. data/bin/make_ttl.rb +3 -2
  7. data/bin/make_ttl.rb.config +3 -3
  8. data/lib/when_exe.rb +101 -5
  9. data/lib/when_exe/basictypes.rb +47 -16
  10. data/lib/when_exe/calendarnote.rb +27 -18
  11. data/lib/when_exe/calendartypes.rb +12 -50
  12. data/lib/when_exe/coordinates.rb +37 -391
  13. data/lib/when_exe/ephemeris.rb +53 -14
  14. data/lib/when_exe/ephemeris/eclipse.rb +8 -8
  15. data/lib/when_exe/ephemeris/moon.rb +333 -333
  16. data/lib/when_exe/ephemeris/notes.rb +29 -17
  17. data/lib/when_exe/ephemeris/phase_table.rb +825 -0
  18. data/lib/when_exe/ephemeris/term_table.rb +603 -0
  19. data/lib/when_exe/events.rb +1888 -0
  20. data/lib/when_exe/google_api.rb +26 -31
  21. data/lib/when_exe/icalendar.rb +129 -12
  22. data/lib/when_exe/inspect.rb +5 -5
  23. data/lib/when_exe/linkeddata.rb +43 -23
  24. data/lib/when_exe/locales/akt.rb +63 -0
  25. data/lib/when_exe/locales/encoding_conversion.rb +134 -134
  26. data/lib/when_exe/locales/iast.rb +90 -90
  27. data/lib/when_exe/locales/locale.rb +88 -18
  28. data/lib/when_exe/locales/transliteration_table.rb +62 -62
  29. data/lib/when_exe/mini_application.rb +14 -8
  30. data/lib/when_exe/namespace.rb +42 -0
  31. data/lib/when_exe/parts/enumerator.rb +16 -5
  32. data/lib/when_exe/parts/geometric_complex.rb +52 -2
  33. data/lib/when_exe/parts/method_cash.rb +229 -224
  34. data/lib/when_exe/parts/resource.rb +65 -35
  35. data/lib/when_exe/parts/timezone.rb +25 -34
  36. data/lib/when_exe/region/balinese.rb +5 -3
  37. data/lib/when_exe/region/chinese.rb +39 -11
  38. data/lib/when_exe/region/chinese/calendars.rb +1016 -1016
  39. data/lib/when_exe/region/chinese/epochs.rb +7 -7
  40. data/lib/when_exe/region/chinese/notes.rb +3 -3
  41. data/lib/when_exe/region/chinese/twins.rb +134 -11
  42. data/lib/when_exe/region/dee.rb +4 -4
  43. data/lib/when_exe/region/discordian.rb +1 -1
  44. data/lib/when_exe/region/geologicalage.rb +139 -128
  45. data/lib/when_exe/region/hanke_henry.rb +4 -4
  46. data/lib/when_exe/region/indian.rb +77 -8
  47. data/lib/when_exe/region/international_fixed.rb +3 -3
  48. data/lib/when_exe/region/islamic.rb +1 -1
  49. data/lib/when_exe/region/japanese.rb +12 -8
  50. data/lib/when_exe/region/japanese/calendars.rb +397 -397
  51. data/lib/when_exe/region/japanese/eclipses.rb +1194 -1194
  52. data/lib/when_exe/region/japanese/epochs.rb +8 -4
  53. data/lib/when_exe/region/japanese/location.rb +93 -0
  54. data/lib/when_exe/region/japanese/nihon_shoki.rb +70 -70
  55. data/lib/when_exe/region/japanese/notes.rb +57 -18
  56. data/lib/when_exe/region/japanese/residues.rb +33 -11
  57. data/lib/when_exe/region/japanese/twins.rb +27 -14
  58. data/lib/when_exe/region/japanese/weeks.rb +7 -7
  59. data/lib/when_exe/region/korean.rb +384 -384
  60. data/lib/when_exe/region/location.rb +40 -0
  61. data/lib/when_exe/region/martian.rb +1 -1
  62. data/lib/when_exe/region/mayan.rb +2 -2
  63. data/lib/when_exe/region/roman.rb +2 -2
  64. data/lib/when_exe/region/ryukyu.rb +101 -101
  65. data/lib/when_exe/region/saudi_arabian.rb +57 -0
  66. data/lib/when_exe/region/shire.rb +1 -1
  67. data/lib/when_exe/region/world.rb +3 -3
  68. data/lib/when_exe/region/zoroastrian.rb +1 -1
  69. data/lib/when_exe/spatial.rb +611 -0
  70. data/lib/when_exe/timestandard.rb +9 -7
  71. data/lib/when_exe/tmobjects.rb +34 -2
  72. data/lib/when_exe/tmposition.rb +225 -1322
  73. data/lib/when_exe/tmptypes.rb +1279 -0
  74. data/lib/when_exe/tmreference.rb +42 -7
  75. data/lib/when_exe/version.rb +3 -3
  76. data/test/events/example-datasets +6 -0
  77. data/test/events/history-dataset.csv +22 -0
  78. data/test/events/japanese-holiday-index.csv +28 -0
  79. data/test/events/japanese-holiday.csv +94 -0
  80. data/test/events/japanese-holiday.ttl +948 -0
  81. data/test/events/make_events_ttl.rb +18 -0
  82. data/test/events/mori_wikichoshi.csv +14 -0
  83. data/test/events/ndl_koyomi.csv +220 -0
  84. data/test/events/ndl_koyomi_index.csv +44 -0
  85. data/test/events/primeminister-dataset.csv +19 -0
  86. data/test/events/shogun-dataset.csv +22 -0
  87. data/test/events/test-history-dataset-edge-sparql.csv +26 -0
  88. data/test/events/test-history-dataset-edge.csv +27 -0
  89. data/test/events/test-history-dataset-sparql.csv +22 -0
  90. data/test/events/test-history-dataset.csv +23 -0
  91. data/test/events/test-history-events-edge.ttl +89 -0
  92. data/test/events/test-history-events.csv +6 -0
  93. data/test/examples/JapanHolidays.ics +2 -2
  94. data/test/examples/JapanHolidaysRFC6350.ics +3 -3
  95. data/test/examples/Residue.m17n +2 -2
  96. data/test/examples/Spatial.m17n +3 -3
  97. data/test/examples/Terms.m17n +3 -3
  98. data/test/scripts/8.ext.rb +6 -6
  99. data/test/scripts/8.rb +6 -6
  100. data/test/scripts/geometric_complex.rb +41 -41
  101. data/test/scripts/korea.rb +59 -59
  102. data/test/scripts/thai.rb +36 -36
  103. data/test/test.rb +6 -0
  104. data/test/test/basictypes.rb +431 -431
  105. data/test/test/calendarnote.rb +86 -86
  106. data/test/test/calendartypes.rb +97 -97
  107. data/test/test/coordinates.rb +399 -397
  108. data/test/test/ephemeris.rb +115 -115
  109. data/test/test/ephemeris/moon.rb +14 -14
  110. data/test/test/ephemeris/planets.rb +14 -14
  111. data/test/test/ephemeris/sun.rb +14 -14
  112. data/test/test/events.rb +32 -0
  113. data/test/test/google_api.rb +45 -32
  114. data/test/test/inspect.rb +153 -153
  115. data/test/test/parts.rb +488 -488
  116. data/test/test/region/armenian.rb +20 -20
  117. data/test/test/region/bahai.rb +58 -58
  118. data/test/test/region/balinese.rb +34 -34
  119. data/test/test/region/chinese.rb +229 -229
  120. data/test/test/region/christian.rb +226 -226
  121. data/test/test/region/coptic.rb +27 -27
  122. data/test/test/region/discordian.rb +20 -20
  123. data/test/test/region/french.rb +33 -33
  124. data/test/test/region/geologicalage.rb +17 -17
  125. data/test/test/region/indian.rb +14 -1
  126. data/test/test/region/iran.rb +54 -54
  127. data/test/test/region/islamic.rb +64 -54
  128. data/test/test/region/japanese.rb +281 -261
  129. data/test/test/region/jewish.rb +63 -63
  130. data/test/test/region/m17n.rb +21 -21
  131. data/test/test/region/mayan.rb +17 -16
  132. data/test/test/region/reforms.rb +2 -2
  133. data/test/test/region/residue.rb +7 -7
  134. data/test/test/region/shire.rb +58 -58
  135. data/test/test/region/swedish.rb +45 -45
  136. data/test/test/region/thai.rb +116 -116
  137. data/test/test/region/tibetan.rb +30 -30
  138. data/test/test/region/vietnamese.rb +102 -102
  139. data/test/test/region/zoroastrian.rb +58 -58
  140. data/test/test/timestandard.rb +81 -81
  141. data/test/test/tmobjects.rb +402 -402
  142. data/test/test/tmposition.rb +66 -4
  143. data/test/test/tmreference.rb +157 -157
  144. metadata +36 -93
@@ -1,63 +1,63 @@
1
- # -*- coding: utf-8 -*-
2
- =begin
3
- Copyright (C) 2011-2014 Takashi SUGA
4
-
5
- You may use and/or modify this file according to the license
6
- described in the LICENSE.txt file included in this archive.
7
- =end
8
-
9
- module MiniTest
10
-
11
- class Jewish < MiniTest::TestCase
12
- def test__jewish
13
- date = When.when? 'HY5700.1.1'
14
- [["HY5700.01.01", 2429521],
15
- ["HY5700.02.01", 2429551],
16
- ["HY5700.03.01", 2429581],
17
- ["HY5700.04.01", 2429611],
18
- ["HY5700.05.01", 2429640],
19
- ["HY5700.06*01", 2429670],
20
- ["HY5700.06=01", 2429700],
21
- ["HY5700.07.01", 2429729],
22
- ["HY5700.08.01", 2429759],
23
- ["HY5700.09.01", 2429788],
24
- ["HY5700.10.01", 2429818],
25
- ["HY5700.11.01", 2429847],
26
- ["HY5700.12.01", 2429877]].each do |sample|
27
- assert_equal(sample, [date.to_s, date.to_i])
28
- date += When.Duration('P1M')
29
- end
30
-
31
- date = When.when? 'HY5773.1.1'
32
- [["HY5773.01.01", 2456188],
33
- ["HY5774.01.01", 2456541],
34
- ["HY5775.01.01", 2456926],
35
- ["HY5776.01.01", 2457280],
36
- ["HY5777.01.01", 2457665],
37
- ["HY5778.01.01", 2458018],
38
- ["HY5779.01.01", 2458372],
39
- ["HY5780.01.01", 2458757],
40
- ["HY5781.01.01", 2459112],
41
- ["HY5782.01.01", 2459465],
42
- ["HY5783.01.01", 2459849],
43
- ["HY5784.01.01", 2460204],
44
- ["HY5785.01.01", 2460587],
45
- ["HY5786.01.01", 2460942],
46
- ["HY5787.01.01", 2461296],
47
- ["HY5788.01.01", 2461681],
48
- ["HY5789.01.01", 2462036],
49
- ["HY5790.01.01", 2462390],
50
- ["HY5791.01.01", 2462773],
51
- ["HY5792.01.01", 2463128]].each do |sample|
52
- assert_equal(sample, [date.to_s, date.to_i])
53
- date += When.Duration('P1Y')
54
- end
55
-
56
- assert_equal("BCE3761(-3760).10.07",
57
- (When.era('BCE')[0] ^ When.Calendar('Jewish').domain[''].first).to_s)
58
-
59
- date = When.when?('4861-06-21^^Jewish')
60
- assert_equal('4862-06*21', (date + When::P1Y).to_s)
61
- end
62
- end
63
- end
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2011-2014 Takashi SUGA
4
+
5
+ You may use and/or modify this file according to the license
6
+ described in the LICENSE.txt file included in this archive.
7
+ =end
8
+
9
+ module MiniTest
10
+
11
+ class Jewish < MiniTest::TestCase
12
+ def test__jewish
13
+ date = When.when? 'HY5700.1.1'
14
+ [["HY5700.01.01", 2429521],
15
+ ["HY5700.02.01", 2429551],
16
+ ["HY5700.03.01", 2429581],
17
+ ["HY5700.04.01", 2429611],
18
+ ["HY5700.05.01", 2429640],
19
+ ["HY5700.06*01", 2429670],
20
+ ["HY5700.06=01", 2429700],
21
+ ["HY5700.07.01", 2429729],
22
+ ["HY5700.08.01", 2429759],
23
+ ["HY5700.09.01", 2429788],
24
+ ["HY5700.10.01", 2429818],
25
+ ["HY5700.11.01", 2429847],
26
+ ["HY5700.12.01", 2429877]].each do |sample|
27
+ assert_equal(sample, [date.to_s, date.to_i])
28
+ date += When.Duration('P1M')
29
+ end
30
+
31
+ date = When.when? 'HY5773.1.1'
32
+ [["HY5773.01.01", 2456188],
33
+ ["HY5774.01.01", 2456541],
34
+ ["HY5775.01.01", 2456926],
35
+ ["HY5776.01.01", 2457280],
36
+ ["HY5777.01.01", 2457665],
37
+ ["HY5778.01.01", 2458018],
38
+ ["HY5779.01.01", 2458372],
39
+ ["HY5780.01.01", 2458757],
40
+ ["HY5781.01.01", 2459112],
41
+ ["HY5782.01.01", 2459465],
42
+ ["HY5783.01.01", 2459849],
43
+ ["HY5784.01.01", 2460204],
44
+ ["HY5785.01.01", 2460587],
45
+ ["HY5786.01.01", 2460942],
46
+ ["HY5787.01.01", 2461296],
47
+ ["HY5788.01.01", 2461681],
48
+ ["HY5789.01.01", 2462036],
49
+ ["HY5790.01.01", 2462390],
50
+ ["HY5791.01.01", 2462773],
51
+ ["HY5792.01.01", 2463128]].each do |sample|
52
+ assert_equal(sample, [date.to_s, date.to_i])
53
+ date += When.Duration('P1Y')
54
+ end
55
+
56
+ assert_equal("BCE3761(-3760).10.07",
57
+ (When.era('BCE')[0] ^ When.Calendar('Jewish').domain[''].first).to_s)
58
+
59
+ date = When.when?('4861-06-21^^Jewish')
60
+ assert_equal('4862-06*21', (date + When::P1Y).to_s)
61
+ end
62
+ end
63
+ end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  =begin
3
- Copyright (C) 2011-2015 Takashi SUGA
3
+ Copyright (C) 2011-2020 Takashi SUGA
4
4
 
5
5
  You may use and/or modify this file according to the license
6
6
  described in the LICENSE.txt file included in this archive.
@@ -12,24 +12,24 @@ module MiniTest
12
12
 
13
13
  First = [
14
14
  ["Calendar", "Calendar", nil],
15
- ["Month", "月の名前", "http://ja.wikipedia.org/wiki/%E6%9C%88_(%E6%9A%A6)"],
16
- ["Month", "月の名前", "http://ja.wikipedia.org/wiki/%E6%9C%88_(%E6%9A%A6)"],
17
- ["January", "1月", "http://ja.wikipedia.org/wiki/1%E6%9C%88"]
15
+ ["Month", "月の名前", "https://ja.wikipedia.org/wiki/%E6%9C%88_%28%E6%9A%A6%29"],
16
+ ["Month", "月の名前", "https://ja.wikipedia.org/wiki/%E6%9C%88_%28%E6%9A%A6%29"],
17
+ ["January", "1月", "https://ja.wikipedia.org/wiki/1%E6%9C%88"]
18
18
  ]
19
19
 
20
20
  Second = [
21
- ["January", "1月", "http://ja.wikipedia.org/wiki/1%E6%9C%88" ],
22
- ["February", "2月", "http://ja.wikipedia.org/wiki/2%E6%9C%88" ],
23
- ["March", "3月", "http://ja.wikipedia.org/wiki/3%E6%9C%88" ],
24
- ["April", "4月", "http://ja.wikipedia.org/wiki/4%E6%9C%88" ],
25
- ["May", "5月", "http://ja.wikipedia.org/wiki/5%E6%9C%88" ],
26
- ["June", "6月", "http://ja.wikipedia.org/wiki/6%E6%9C%88" ],
27
- ["July", "7月", "http://ja.wikipedia.org/wiki/7%E6%9C%88" ],
28
- ["August", "8月", "http://ja.wikipedia.org/wiki/8%E6%9C%88" ],
29
- ["September", "9月", "http://ja.wikipedia.org/wiki/9%E6%9C%88" ],
30
- ["October", "10月", "http://ja.wikipedia.org/wiki/10%E6%9C%88"],
31
- ["November", "11月", "http://ja.wikipedia.org/wiki/11%E6%9C%88"],
32
- ["December", "12月", "http://ja.wikipedia.org/wiki/12%E6%9C%88"]
21
+ ["January", "1月", "https://ja.wikipedia.org/wiki/1%E6%9C%88" ],
22
+ ["February", "2月", "https://ja.wikipedia.org/wiki/2%E6%9C%88" ],
23
+ ["March", "3月", "https://ja.wikipedia.org/wiki/3%E6%9C%88" ],
24
+ ["April", "4月", "https://ja.wikipedia.org/wiki/4%E6%9C%88" ],
25
+ ["May", "5月", "https://ja.wikipedia.org/wiki/5%E6%9C%88" ],
26
+ ["June", "6月", "https://ja.wikipedia.org/wiki/6%E6%9C%88" ],
27
+ ["July", "7月", "https://ja.wikipedia.org/wiki/7%E6%9C%88" ],
28
+ ["August", "8月", "https://ja.wikipedia.org/wiki/8%E6%9C%88" ],
29
+ ["September", "9月", "https://ja.wikipedia.org/wiki/9%E6%9C%88" ],
30
+ ["October", "10月", "https://ja.wikipedia.org/wiki/10%E6%9C%88"],
31
+ ["November", "11月", "https://ja.wikipedia.org/wiki/11%E6%9C%88"],
32
+ ["December", "12月", "https://ja.wikipedia.org/wiki/12%E6%9C%88"]
33
33
  ]
34
34
 
35
35
  def test__m17n_1
@@ -59,12 +59,12 @@ module MiniTest
59
59
 
60
60
  def test__m17n_2
61
61
  march = When.m17n(['en:March=en_ns:', 'ja:3月=ja_ns:'],
62
- {'en_ns'=>'http://en.wikipedia.org/wiki/',
63
- 'ja_ns'=>'http://ja.wikipedia.org/wiki/'})
62
+ {'en_ns'=>'https://en.wikipedia.org/wiki/',
63
+ 'ja_ns'=>'https://ja.wikipedia.org/wiki/'})
64
64
 
65
65
  [
66
- ['ja', ["3月", "3月", "http://ja.wikipedia.org/wiki/3%E6%9C%88"]],
67
- ['en', ["March", "March", "http://en.wikipedia.org/wiki/March" ]]
66
+ ['ja', ["3月", "3月", "https://ja.wikipedia.org/wiki/3%E6%9C%88"]],
67
+ ['en', ["March", "March", "https://en.wikipedia.org/wiki/March" ]]
68
68
  ].each do |sample|
69
69
  assert_equal(sample[1], [march.translate(sample[0]), march.translate(sample[0]), march.reference(sample[0])])
70
70
  end
@@ -171,7 +171,7 @@ module MiniTest
171
171
  date, verify = sample
172
172
  list = When.when?(date).to_h({:method=>:to_m17n, :locale=>verify[:locale], :prefix=>true})
173
173
  [:calendar, :cal_date, :sdn, :clk_time].each do |key|
174
- assert_equal(verify[key], list[key])
174
+ assert_equal([verify[key]], [list[key]])
175
175
  end
176
176
  verify[:notes].each_index do |i|
177
177
  verify[:notes][i].each_index do |k|
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  =begin
3
- Copyright (C) 2011-2015 Takashi SUGA
3
+ Copyright (C) 2011-2016 Takashi SUGA
4
4
 
5
5
  You may use and/or modify this file according to the license
6
6
  described in the LICENSE.txt file included in this archive.
@@ -48,10 +48,10 @@ module MiniTest
48
48
  # No offset
49
49
  haab = When.Resource("_co:Mayan::Haab'")
50
50
  assert_equal("ハアブ", haab.label.translate('ja'))
51
- assert_equal("http://en.wikipedia.org/wiki/Haab'", haab.label.reference)
51
+ assert_equal("https://en.wikipedia.org/wiki/Haab%27", haab.label.reference)
52
52
  pop = When.Resource("_co:Mayan::Haab'::Pop")
53
53
  assert_equal("Pop", pop.label.translate('en'))
54
- assert_equal("http://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
54
+ assert_equal("https://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
55
55
  date0 = When.when?('2011-05-16T12:34:56Z')
56
56
  sample = [
57
57
  "2012-04-12T12:34:56Z",
@@ -68,10 +68,10 @@ module MiniTest
68
68
  # offset 0B
69
69
  haab = When.Resource("_co:Mayan?Epoch=0D::Haab'")
70
70
  assert_equal("ハアブ", haab.label.translate('ja'))
71
- assert_equal("http://en.wikipedia.org/wiki/Haab'", haab.label.reference)
71
+ assert_equal("https://en.wikipedia.org/wiki/Haab%27", haab.label.reference)
72
72
  pop = When.Resource("_co:Mayan?Epoch=0D::Haab'::Pop")
73
73
  assert_equal("Pop", pop.label.translate('en'))
74
- assert_equal("http://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
74
+ assert_equal("https://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
75
75
  date0 = When.when?('2011-05-16T12:34:56Z')
76
76
  sample = [
77
77
  "2012-04-12T12:34:56Z",
@@ -84,14 +84,15 @@ module MiniTest
84
84
  assert_equal(42, When.when?('2011-05-15') % haab)
85
85
  h = haab % When.when?('2011-05-15')
86
86
  assert_equal(["Sip", 2], [h.label.to_s, h.difference])
87
+ assert_equal("13.00.03.05.17", When.when?('13.00.03.02.05{Pop}', {:frame=>'LongCount'}).to_s)
87
88
 
88
89
  # offset 2B
89
90
  haab = When.Resource("_co:Mayan?Epoch=2D::Haab'")
90
91
  assert_equal("ハアブ", haab.label.translate('ja'))
91
- assert_equal("http://en.wikipedia.org/wiki/Haab'", haab.label.reference)
92
+ assert_equal("https://en.wikipedia.org/wiki/Haab%27", haab.label.reference)
92
93
  pop = When.Resource("_co:Mayan?Epoch=2D::Haab'::Pop")
93
94
  assert_equal("Pop", pop.label.translate('en'))
94
- assert_equal("http://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
95
+ assert_equal("https://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
95
96
  date0 = When.when?('2011-05-16T12:34:56Z')
96
97
  sample = [
97
98
  "2012-04-14T12:34:56Z",
@@ -110,16 +111,16 @@ module MiniTest
110
111
  # No offset
111
112
  trecena = When.Resource("_co:Mayan::Trecena::Trecena")
112
113
  assert_equal("トレセナ", trecena.label.translate('ja'))
113
- assert_equal("http://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
114
+ assert_equal("https://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
114
115
  assert_equal(2, When.when?('2011-05-15') % trecena)
115
116
 
116
117
 
117
118
  tzolkin = When.Resource("_co:Mayan::Tzolk'in")
118
119
  assert_equal("ツォルキン", tzolkin.label.translate('ja'))
119
- assert_equal("http://en.wikipedia.org/wiki/Tzolk'in", tzolkin.label.reference)
120
+ assert_equal("https://en.wikipedia.org/wiki/Tzolk%27in", tzolkin.label.reference)
120
121
  ajaw = When.Resource("_co:Mayan::Tzolk'in::Ajaw")
121
122
  assert_equal("Ajaw", ajaw.label.translate('en'))
122
- assert_equal("http://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
123
+ assert_equal("https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
123
124
  date0 = When.when?('2011-05-16T12:34:56Z')
124
125
  sample = [
125
126
  "2011-05-21T12:34:56Z",
@@ -138,16 +139,16 @@ module MiniTest
138
139
  # offset 0B
139
140
  trecena = When.Resource("_co:Mayan?Epoch=0D::Trecena::Trecena")
140
141
  assert_equal("トレセナ", trecena.label.translate('ja'))
141
- assert_equal("http://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
142
+ assert_equal("https://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
142
143
  assert_equal(2, When.when?('2011-05-15') % trecena)
143
144
 
144
145
 
145
146
  tzolkin = When.Resource("_co:Mayan?Epoch=0D::Tzolk'in")
146
147
  assert_equal("ツォルキン", tzolkin.label.translate('ja'))
147
- assert_equal("http://en.wikipedia.org/wiki/Tzolk'in", tzolkin.label.reference)
148
+ assert_equal("https://en.wikipedia.org/wiki/Tzolk%27in", tzolkin.label.reference)
148
149
  ajaw = When.Resource("_co:Mayan?Epoch=0D::Tzolk'in::Ajaw")
149
150
  assert_equal("Ajaw", ajaw.label.translate('en'))
150
- assert_equal("http://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
151
+ assert_equal("https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
151
152
  date0 = When.when?('2011-05-16T12:34:56Z')
152
153
  sample = [
153
154
  "2011-05-21T12:34:56Z",
@@ -166,16 +167,16 @@ module MiniTest
166
167
  # offset 2B
167
168
  trecena = When.Resource("_co:Mayan?Epoch=2D::Trecena::Trecena")
168
169
  assert_equal("トレセナ", trecena.label.translate('ja'))
169
- assert_equal("http://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
170
+ assert_equal("https://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
170
171
  assert_equal(2, When.when?('2011-05-17') % trecena)
171
172
 
172
173
 
173
174
  tzolkin = When.Resource("_co:Mayan?Epoch=2D::Tzolk'in")
174
175
  assert_equal("ツォルキン", tzolkin.label.translate('ja'))
175
- assert_equal("http://en.wikipedia.org/wiki/Tzolk'in", tzolkin.label.reference)
176
+ assert_equal("https://en.wikipedia.org/wiki/Tzolk%27in", tzolkin.label.reference)
176
177
  ajaw = When.Resource("_co:Mayan?Epoch=2D::Tzolk'in::Ajaw")
177
178
  assert_equal("Ajaw", ajaw.label.translate('en'))
178
- assert_equal("http://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
179
+ assert_equal("https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
179
180
  date0 = When.when?('2011-05-16T12:34:56Z')
180
181
  sample = [
181
182
  "2011-05-23T12:34:56Z",
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  =begin
3
- Copyright (C) 2014 Takashi SUGA
3
+ Copyright (C) 2014-2017 Takashi SUGA
4
4
 
5
5
  You may use and/or modify this file according to the license
6
6
  described in the LICENSE.txt file included in this archive.
@@ -103,7 +103,7 @@ module MiniTest
103
103
 
104
104
  class HankeHenry < MiniTest::TestCase
105
105
  def test_hanke_henry
106
- assert_equal(When.when?('2012.1.1').to_i, When.when?('2012.1.1^^HankeHenry').to_i)
106
+ assert_equal(When.when?('2018.1.1').to_i, When.when?('2018.1.1^^HankeHenry').to_i)
107
107
  count = 0
108
108
  (2000...2400).each do |year|
109
109
  first = When.tm_pos(year, 1, 1)
@@ -41,13 +41,13 @@ module MiniTest
41
41
  assert_equal("日曜日", When.Resource(iri + '::Week::Sunday::Sunday').translate('ja'))
42
42
 
43
43
  sample = [
44
- ["Monday", "月曜日", "http://en.wikipedia.org/wiki/Monday"],
45
- ["Tuesday", "火曜日", "http://en.wikipedia.org/wiki/Tuesday"],
46
- ["Wednesday", "水曜日", "http://en.wikipedia.org/wiki/Wednesday"],
47
- ["Thursday", "木曜日", "http://en.wikipedia.org/wiki/Thursday"],
48
- ["Friday", "金曜日", "http://en.wikipedia.org/wiki/Friday"],
49
- ["Saturday", "土曜日", "http://en.wikipedia.org/wiki/Saturday"],
50
- ["Sunday", "日曜日", "http://en.wikipedia.org/wiki/Sunday"]
44
+ ["Monday", "月曜日", "https://en.wikipedia.org/wiki/Monday"],
45
+ ["Tuesday", "火曜日", "https://en.wikipedia.org/wiki/Tuesday"],
46
+ ["Wednesday", "水曜日", "https://en.wikipedia.org/wiki/Wednesday"],
47
+ ["Thursday", "木曜日", "https://en.wikipedia.org/wiki/Thursday"],
48
+ ["Friday", "金曜日", "https://en.wikipedia.org/wiki/Friday"],
49
+ ["Saturday", "土曜日", "https://en.wikipedia.org/wiki/Saturday"],
50
+ ["Sunday", "日曜日", "https://en.wikipedia.org/wiki/Sunday"]
51
51
  ]
52
52
  assert_equal(7, When::Parts::Resource[iri + '::Week'].child.size)
53
53
  When::Parts::Resource[iri + '::Week'].child.each do |obj|
@@ -1,58 +1,58 @@
1
- # -*- coding: utf-8 -*-
2
- =begin
3
- Copyright (C) 2014 Takashi SUGA
4
-
5
- You may use and/or modify this file according to the license
6
- described in the LICENSE.txt file included in this archive.
7
- =end
8
-
9
- module MiniTest
10
-
11
- class Shire < MiniTest::TestCase
12
- def test_shire
13
- date = When.when? '2001.1.1^^Shire?time_basis=+09:00'
14
- [["2001-01-01", 2451901],
15
- ["2002-01-01", 2452266],
16
- ["2003-01-01", 2452632],
17
- ["2004-01-01", 2452997],
18
- ["2005-01-01", 2453362],
19
- ["2006-01-01", 2453727],
20
- ["2007-01-01", 2454093],
21
- ["2008-01-01", 2454458],
22
- ["2009-01-01", 2454823],
23
- ["2010-01-01", 2455188],
24
- ["2011-01-01", 2455554],
25
- ["2012-01-01", 2455919],
26
- ["2013-01-01", 2456284],
27
- ["2014-01-01", 2456649],
28
- ["2015-01-01", 2457015],
29
- ["2016-01-01", 2457380],
30
- ["2017-01-01", 2457745],
31
- ["2018-01-01", 2458110],
32
- ["2019-01-01", 2458476],
33
- ["2020-01-01", 2458841],
34
- ["2021-01-01", 2459206],
35
- ["2022-01-01", 2459571],
36
- ["2023-01-01", 2459936],
37
- ["2024-01-01", 2460302],
38
- ["2025-01-01", 2460667],
39
- ["2026-01-01", 2461032],
40
- ["2027-01-01", 2461397],
41
- ["2028-01-01", 2461763],
42
- ["2029-01-01", 2462128],
43
- ["2030-01-01", 2462493],
44
- ["2031-01-01", 2462858],
45
- ["2032-01-01", 2463224],
46
- ["2033-01-01", 2463589]].each do |sample|
47
- assert_equal(sample, [date.to_s, date.to_i])
48
- date += When::P1Y
49
- end
50
-
51
- date = When.when? '2001.1.1'
52
- 400.times do
53
- assert_equal([1,9], (When.Calendar('Shire') ^ date).cal_date[1..2])
54
- date += When::P1Y
55
- end
56
- end
57
- end
58
- end
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2014 Takashi SUGA
4
+
5
+ You may use and/or modify this file according to the license
6
+ described in the LICENSE.txt file included in this archive.
7
+ =end
8
+
9
+ module MiniTest
10
+
11
+ class Shire < MiniTest::TestCase
12
+ def test_shire
13
+ date = When.when? '2001.1.1^^Shire?time_basis=+09:00'
14
+ [["2001-01-01", 2451901],
15
+ ["2002-01-01", 2452266],
16
+ ["2003-01-01", 2452632],
17
+ ["2004-01-01", 2452997],
18
+ ["2005-01-01", 2453362],
19
+ ["2006-01-01", 2453727],
20
+ ["2007-01-01", 2454093],
21
+ ["2008-01-01", 2454458],
22
+ ["2009-01-01", 2454823],
23
+ ["2010-01-01", 2455188],
24
+ ["2011-01-01", 2455554],
25
+ ["2012-01-01", 2455919],
26
+ ["2013-01-01", 2456284],
27
+ ["2014-01-01", 2456649],
28
+ ["2015-01-01", 2457015],
29
+ ["2016-01-01", 2457380],
30
+ ["2017-01-01", 2457745],
31
+ ["2018-01-01", 2458110],
32
+ ["2019-01-01", 2458476],
33
+ ["2020-01-01", 2458841],
34
+ ["2021-01-01", 2459206],
35
+ ["2022-01-01", 2459571],
36
+ ["2023-01-01", 2459936],
37
+ ["2024-01-01", 2460302],
38
+ ["2025-01-01", 2460667],
39
+ ["2026-01-01", 2461032],
40
+ ["2027-01-01", 2461397],
41
+ ["2028-01-01", 2461763],
42
+ ["2029-01-01", 2462128],
43
+ ["2030-01-01", 2462493],
44
+ ["2031-01-01", 2462858],
45
+ ["2032-01-01", 2463224],
46
+ ["2033-01-01", 2463589]].each do |sample|
47
+ assert_equal(sample, [date.to_s, date.to_i])
48
+ date += When::P1Y
49
+ end
50
+
51
+ date = When.when? '2001.1.1'
52
+ 400.times do
53
+ assert_equal([1,9], (When.Calendar('Shire') ^ date).cal_date[1..2])
54
+ date += When::P1Y
55
+ end
56
+ end
57
+ end
58
+ end