moonphases 1.0.2 → 1.0.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.
- data/lib/moonphases.rb +7 -7
- data/lib/moonphases/db/phases-0099.html +1 -0
- data/lib/moonphases/db/phases-0199.html +1 -0
- data/lib/moonphases/db/phases-0299.html +1 -0
- data/lib/moonphases/db/phases-0399.html +1 -0
- data/lib/moonphases/db/phases-0499.html +1 -0
- data/lib/moonphases/db/phases-0599.html +1 -0
- data/lib/moonphases/db/phases-0699.html +1 -0
- data/lib/moonphases/db/phases-0799.html +1 -0
- data/lib/moonphases/db/phases-0899.html +1 -0
- data/lib/moonphases/db/phases-0999.html +1 -0
- data/lib/moonphases/db/phases-1099.html +1 -100
- data/lib/moonphases/db/phases-1199.html +1 -100
- data/lib/moonphases/db/phases-1299.html +1 -100
- data/lib/moonphases/db/phases-1399.html +1 -100
- data/lib/moonphases/db/phases-1499.html +1 -100
- data/lib/moonphases/db/phases-1599.html +1 -100
- data/lib/moonphases/db/phases-1699.html +1 -100
- data/lib/moonphases/db/phases-1799.html +1 -100
- data/lib/moonphases/db/phases-1899.html +1 -100
- data/lib/moonphases/db/phases-1999.html +1 -100
- data/lib/moonphases/db/phases0001.html +1 -0
- data/lib/moonphases/db/phases0101.html +1 -0
- data/lib/moonphases/db/phases0201.html +1 -0
- data/lib/moonphases/db/phases0301.html +1 -0
- data/lib/moonphases/db/phases0401.html +1 -0
- data/lib/moonphases/db/phases0501.html +1 -0
- data/lib/moonphases/db/phases0601.html +1 -0
- data/lib/moonphases/db/phases0701.html +1 -0
- data/lib/moonphases/db/phases0801.html +1 -0
- data/lib/moonphases/db/phases0901.html +1 -0
- data/lib/moonphases/db/phases1001.html +1 -0
- data/lib/moonphases/db/phases1101.html +1 -0
- data/lib/moonphases/db/phases1201.html +1 -0
- data/lib/moonphases/db/phases1301.html +1 -0
- data/lib/moonphases/db/phases1401.html +1 -0
- data/lib/moonphases/db/phases1501.html +1 -0
- data/lib/moonphases/db/phases1601.html +1 -0
- data/lib/moonphases/db/phases1701.html +1 -0
- data/lib/moonphases/db/phases1801.html +1 -0
- data/lib/moonphases/db/phases1901.html +1 -0
- data/lib/moonphases/db/phases2001.html +1 -0
- data/lib/moonphases/db/phases2101.html +1 -0
- data/lib/moonphases/db/phases2201.html +1 -0
- data/lib/moonphases/db/phases2301.html +1 -0
- data/lib/moonphases/db/phases2401.html +1 -0
- data/lib/moonphases/db/phases2501.html +1 -0
- data/lib/moonphases/db/phases2601.html +1 -0
- data/lib/moonphases/db/phases2701.html +1 -0
- data/lib/moonphases/db/phases2801.html +1 -0
- data/lib/moonphases/db/phases2901.html +1 -0
- data/lib/moonphases/db/phases3001.html +1 -0
- data/lib/moonphases/db/phases3101.html +1 -0
- data/lib/moonphases/db/phases3201.html +1 -0
- data/lib/moonphases/db/phases3301.html +1 -0
- data/lib/moonphases/db/phases3401.html +1 -0
- data/lib/moonphases/db/phases3501.html +1 -0
- data/lib/moonphases/db/phases3601.html +1 -0
- data/lib/moonphases/db/phases3701.html +1 -0
- data/lib/moonphases/db/phases3801.html +1 -0
- data/lib/moonphases/db/phases3901.html +1 -0
- data/test/test_moonphases.rb +29 -24
- metadata +68 -17
data/test/test_moonphases.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'moonphases'
|
3
3
|
require 'date'
|
4
|
+
require 'pathname'
|
4
5
|
|
5
6
|
class MoonPhasesTest < Test::Unit::TestCase
|
6
7
|
|
@@ -9,16 +10,18 @@ class MoonPhasesTest < Test::Unit::TestCase
|
|
9
10
|
@moon = MoonPhases.new
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
assert_equal "
|
15
|
-
assert_equal "
|
16
|
-
assert_equal "
|
17
|
-
assert_equal "
|
18
|
-
assert_equal "
|
19
|
-
assert_equal "
|
20
|
-
assert_equal "
|
21
|
-
assert_equal "
|
13
|
+
resource_root = File.join(File.dirname(File.expand_path(__FILE__)), '../lib/moonphases/db' )
|
14
|
+
|
15
|
+
assert_equal Pathname.new( resource_root + "/phases0001.html" ).realpath, Pathname.new( @moon.lookupFilename( 1 ) ).realpath
|
16
|
+
assert_equal Pathname.new( resource_root + "/phases0001.html" ).realpath, Pathname.new( @moon.lookupFilename( 100 )).realpath
|
17
|
+
assert_equal Pathname.new( resource_root + "/phases0101.html" ).realpath, Pathname.new( @moon.lookupFilename( 101 )).realpath
|
18
|
+
assert_equal Pathname.new( resource_root + "/phases0101.html" ).realpath, Pathname.new( @moon.lookupFilename( 200 )).realpath
|
19
|
+
assert_equal Pathname.new( resource_root + "/phases0201.html" ).realpath, Pathname.new( @moon.lookupFilename( 201 )).realpath
|
20
|
+
assert_equal Pathname.new( resource_root + "/phases0201.html" ).realpath, Pathname.new( @moon.lookupFilename( 300 )).realpath
|
21
|
+
assert_equal Pathname.new( resource_root + "/phases0301.html" ).realpath, Pathname.new( @moon.lookupFilename( 301 )).realpath
|
22
|
+
assert_equal Pathname.new( resource_root + "/phases0901.html" ).realpath, Pathname.new( @moon.lookupFilename( 1000 )).realpath
|
23
|
+
assert_equal Pathname.new( resource_root + "/phases1001.html" ).realpath, Pathname.new( @moon.lookupFilename( 1001 )).realpath
|
24
|
+
assert_equal Pathname.new( resource_root + "/phases2001.html" ).realpath, Pathname.new( @moon.lookupFilename( 2012 )).realpath
|
22
25
|
end
|
23
26
|
|
24
27
|
def test_BC_Years
|
@@ -26,16 +29,18 @@ class MoonPhasesTest < Test::Unit::TestCase
|
|
26
29
|
@moon = MoonPhases.new
|
27
30
|
end
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
assert_equal "
|
32
|
-
assert_equal "
|
33
|
-
assert_equal "
|
34
|
-
assert_equal "
|
35
|
-
assert_equal "
|
36
|
-
assert_equal "
|
37
|
-
assert_equal "
|
38
|
-
assert_equal "
|
32
|
+
resource_root = File.join(File.dirname(File.expand_path(__FILE__)), '../lib/moonphases/db' )
|
33
|
+
|
34
|
+
assert_equal Pathname.new( resource_root + "/phases-0099.html" ).realpath, Pathname.new( @moon.lookupFilename( 0 )).realpath
|
35
|
+
assert_equal Pathname.new( resource_root + "/phases-0099.html" ).realpath, Pathname.new( @moon.lookupFilename( -1 )).realpath
|
36
|
+
assert_equal Pathname.new( resource_root + "/phases-0099.html" ).realpath, Pathname.new( @moon.lookupFilename( -99 )).realpath
|
37
|
+
assert_equal Pathname.new( resource_root + "/phases-0199.html" ).realpath, Pathname.new( @moon.lookupFilename( -100 )).realpath
|
38
|
+
assert_equal Pathname.new( resource_root + "/phases-0199.html" ).realpath, Pathname.new( @moon.lookupFilename( -199 )).realpath
|
39
|
+
assert_equal Pathname.new( resource_root + "/phases-0299.html" ).realpath, Pathname.new( @moon.lookupFilename( -200 )).realpath
|
40
|
+
assert_equal Pathname.new( resource_root + "/phases-0999.html" ).realpath, Pathname.new( @moon.lookupFilename( -900 )).realpath
|
41
|
+
assert_equal Pathname.new( resource_root + "/phases-0999.html" ).realpath, Pathname.new( @moon.lookupFilename( -999 )).realpath
|
42
|
+
assert_equal Pathname.new( resource_root + "/phases-1099.html" ).realpath, Pathname.new( @moon.lookupFilename( -1000 )).realpath
|
43
|
+
assert_equal Pathname.new( resource_root + "/phases-1099.html" ).realpath, Pathname.new( @moon.lookupFilename( -1099 )).realpath
|
39
44
|
end
|
40
45
|
|
41
46
|
def test_padding
|
@@ -54,11 +59,11 @@ class MoonPhasesTest < Test::Unit::TestCase
|
|
54
59
|
@moon = MoonPhases.new
|
55
60
|
end
|
56
61
|
|
57
|
-
assert_raise
|
62
|
+
assert_raise Errno::ENOENT do
|
58
63
|
@moon.getNASADoc( 50000 )
|
59
64
|
end
|
60
65
|
|
61
|
-
assert_nothing_raised
|
66
|
+
assert_nothing_raised Errno::ENOENT do
|
62
67
|
doc = @moon.getNASADoc 2012
|
63
68
|
assert_equal "NASA - Moon Phases: 2001 to 2100", doc.title
|
64
69
|
end
|
@@ -409,8 +414,8 @@ class MoonPhasesTest < Test::Unit::TestCase
|
|
409
414
|
assert_not_nil assert_equal 2, moon.getDocumentLogLength
|
410
415
|
|
411
416
|
#Make sure that the log contains what we think it should.
|
412
|
-
assert_equal moon.
|
413
|
-
assert_equal moon.
|
417
|
+
assert_equal moon.lookupFilename( 2011 ), moon.getDocumentLogItem( 1 )
|
418
|
+
assert_equal moon.lookupFilename( 1977 ), moon.getDocumentLogItem( 0 )
|
414
419
|
|
415
420
|
# Get a blob we've gotten before, and make sure that
|
416
421
|
# the log DOESN'T grow (because we went to the cache).
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moonphases
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 1.0.2
|
4
|
+
prerelease:
|
5
|
+
version: 1.0.3
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Curtis Lacy
|
@@ -14,18 +10,16 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2012-
|
18
|
-
default_executable:
|
13
|
+
date: 2012-05-17 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: nokogiri
|
22
17
|
prerelease: false
|
23
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
24
20
|
requirements:
|
25
21
|
- - ">="
|
26
22
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
23
|
version: "0"
|
30
24
|
type: :runtime
|
31
25
|
version_requirements: *id001
|
@@ -39,6 +33,66 @@ extra_rdoc_files: []
|
|
39
33
|
|
40
34
|
files:
|
41
35
|
- lib/moonphases/data_point.rb
|
36
|
+
- lib/moonphases/db/phases-0099.html
|
37
|
+
- lib/moonphases/db/phases-0199.html
|
38
|
+
- lib/moonphases/db/phases-0299.html
|
39
|
+
- lib/moonphases/db/phases-0399.html
|
40
|
+
- lib/moonphases/db/phases-0499.html
|
41
|
+
- lib/moonphases/db/phases-0599.html
|
42
|
+
- lib/moonphases/db/phases-0699.html
|
43
|
+
- lib/moonphases/db/phases-0799.html
|
44
|
+
- lib/moonphases/db/phases-0899.html
|
45
|
+
- lib/moonphases/db/phases-0999.html
|
46
|
+
- lib/moonphases/db/phases-1099.html
|
47
|
+
- lib/moonphases/db/phases-1199.html
|
48
|
+
- lib/moonphases/db/phases-1299.html
|
49
|
+
- lib/moonphases/db/phases-1399.html
|
50
|
+
- lib/moonphases/db/phases-1499.html
|
51
|
+
- lib/moonphases/db/phases-1599.html
|
52
|
+
- lib/moonphases/db/phases-1699.html
|
53
|
+
- lib/moonphases/db/phases-1799.html
|
54
|
+
- lib/moonphases/db/phases-1899.html
|
55
|
+
- lib/moonphases/db/phases-1999.html
|
56
|
+
- lib/moonphases/db/phases0001.html
|
57
|
+
- lib/moonphases/db/phases0101.html
|
58
|
+
- lib/moonphases/db/phases0201.html
|
59
|
+
- lib/moonphases/db/phases0301.html
|
60
|
+
- lib/moonphases/db/phases0401.html
|
61
|
+
- lib/moonphases/db/phases0501.html
|
62
|
+
- lib/moonphases/db/phases0601.html
|
63
|
+
- lib/moonphases/db/phases0701.html
|
64
|
+
- lib/moonphases/db/phases0801.html
|
65
|
+
- lib/moonphases/db/phases0901.html
|
66
|
+
- lib/moonphases/db/phases1001.html
|
67
|
+
- lib/moonphases/db/phases1101.html
|
68
|
+
- lib/moonphases/db/phases1201.html
|
69
|
+
- lib/moonphases/db/phases1301.html
|
70
|
+
- lib/moonphases/db/phases1401.html
|
71
|
+
- lib/moonphases/db/phases1501.html
|
72
|
+
- lib/moonphases/db/phases1601.html
|
73
|
+
- lib/moonphases/db/phases1701.html
|
74
|
+
- lib/moonphases/db/phases1801.html
|
75
|
+
- lib/moonphases/db/phases1901.html
|
76
|
+
- lib/moonphases/db/phases2001.html
|
77
|
+
- lib/moonphases/db/phases2101.html
|
78
|
+
- lib/moonphases/db/phases2201.html
|
79
|
+
- lib/moonphases/db/phases2301.html
|
80
|
+
- lib/moonphases/db/phases2401.html
|
81
|
+
- lib/moonphases/db/phases2501.html
|
82
|
+
- lib/moonphases/db/phases2601.html
|
83
|
+
- lib/moonphases/db/phases2701.html
|
84
|
+
- lib/moonphases/db/phases2801.html
|
85
|
+
- lib/moonphases/db/phases2901.html
|
86
|
+
- lib/moonphases/db/phases3001.html
|
87
|
+
- lib/moonphases/db/phases3101.html
|
88
|
+
- lib/moonphases/db/phases3201.html
|
89
|
+
- lib/moonphases/db/phases3301.html
|
90
|
+
- lib/moonphases/db/phases3401.html
|
91
|
+
- lib/moonphases/db/phases3501.html
|
92
|
+
- lib/moonphases/db/phases3601.html
|
93
|
+
- lib/moonphases/db/phases3701.html
|
94
|
+
- lib/moonphases/db/phases3801.html
|
95
|
+
- lib/moonphases/db/phases3901.html
|
42
96
|
- lib/moonphases/moon_data.rb
|
43
97
|
- lib/moonphases.rb
|
44
98
|
- test/test_moonphases.rb
|
@@ -46,7 +100,6 @@ files:
|
|
46
100
|
- Gemfile
|
47
101
|
- MIT-LICENSE
|
48
102
|
- README.md
|
49
|
-
has_rdoc: true
|
50
103
|
homepage:
|
51
104
|
licenses: []
|
52
105
|
|
@@ -56,25 +109,23 @@ rdoc_options: []
|
|
56
109
|
require_paths:
|
57
110
|
- lib
|
58
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
59
113
|
requirements:
|
60
114
|
- - ">="
|
61
115
|
- !ruby/object:Gem::Version
|
62
|
-
segments:
|
63
|
-
- 0
|
64
116
|
version: "0"
|
65
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
66
119
|
requirements:
|
67
120
|
- - ">="
|
68
121
|
- !ruby/object:Gem::Version
|
69
|
-
segments:
|
70
|
-
- 0
|
71
122
|
version: "0"
|
72
123
|
requirements: []
|
73
124
|
|
74
125
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.
|
126
|
+
rubygems_version: 1.8.22
|
76
127
|
signing_key:
|
77
128
|
specification_version: 3
|
78
|
-
summary: MoonPhases-1.0.
|
129
|
+
summary: MoonPhases-1.0.3
|
79
130
|
test_files: []
|
80
131
|
|