Gooby 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +218 -0
- data/bin/forerunner_xml_parser.rb +28 -0
- data/bin/forerunner_xml_parser.sh +16 -0
- data/bin/forerunner_xml_splitter.rb +60 -0
- data/bin/gen_gmap.rb +30 -0
- data/bin/gen_gmap.sh +19 -0
- data/bin/tests_gen.rb +13 -0
- data/data/20041113_richmond_marathon.csv +1036 -0
- data/data/20041113_richmond_marathon.xml +8663 -0
- data/data/20050305_corporate_cup_hm.csv +251 -0
- data/data/20050305_corporate_cup_hm.xml +2208 -0
- data/data/20050430_nashville_marathon.csv +1208 -0
- data/data/20050430_nashville_marathon.xml +10043 -0
- data/data/20051119_dowd_ymca_hm.csv +251 -0
- data/data/20051119_dowd_ymca_hm.xml +2210 -0
- data/data/20051124_hyatt_turkey_trot_8K.csv +321 -0
- data/data/20051124_hyatt_turkey_trot_8K.xml +2651 -0
- data/data/forerunner_2005.xml +259620 -0
- data/data/forerunner_2006.xml +190853 -0
- data/data/forerunner_2007.xml +259014 -0
- data/data/geo_data.txt +171 -0
- data/data/phx.csv +1280 -0
- data/data/phx.xml +10620 -0
- data/data/run_2007_01_01_16_38_27.xml +2020 -0
- data/data/run_2007_01_06_15_27_31.xml +2020 -0
- data/data/run_2007_01_10_12_25_47.xml +820 -0
- data/data/run_2007_01_10_22_44_54.csv +112 -0
- data/data/run_2007_01_10_22_44_54.xml +908 -0
- data/data/run_2007_01_11_10_48_45.xml +1292 -0
- data/data/run_2007_01_13_15_37_06.xml +1964 -0
- data/data/run_2007_01_14_15_46_02.xml +1368 -0
- data/data/run_2007_01_15_14_01_48.xml +1868 -0
- data/data/run_2007_01_20_16_22_05.xml +1702 -0
- data/data/run_2007_01_27_17_32_13.xml +3626 -0
- data/data/run_2007_01_28_19_14_52.xml +2538 -0
- data/data/run_2007_02_03_14_30_20.xml +2016 -0
- data/data/run_2007_02_04_18_02_30.xml +1476 -0
- data/data/run_2007_02_17_16_29_35.xml +1236 -0
- data/data/run_2007_02_19_14_44_33.xml +1816 -0
- data/data/run_2007_02_23_15_53_55.xml +36 -0
- data/data/run_2007_02_23_15_55_20.xml +1296 -0
- data/data/run_2007_02_24_15_01_35.csv +484 -0
- data/data/run_2007_02_24_15_01_35.xml +3884 -0
- data/data/test1.txt +4 -0
- data/lib/cls_counter_hash.rb +83 -0
- data/lib/cls_delim_line.rb +40 -0
- data/lib/cls_dttm.rb +84 -0
- data/lib/cls_duration.rb +87 -0
- data/lib/cls_forerunner_xml_parser.rb +183 -0
- data/lib/cls_forerunner_xml_splitter.rb +113 -0
- data/lib/cls_geo_data.rb +186 -0
- data/lib/cls_gooby_object.rb +23 -0
- data/lib/cls_google_map_generator.rb +368 -0
- data/lib/cls_history.rb +38 -0
- data/lib/cls_lap.rb +27 -0
- data/lib/cls_line.rb +78 -0
- data/lib/cls_options.rb +74 -0
- data/lib/cls_position.rb +49 -0
- data/lib/cls_run.rb +199 -0
- data/lib/cls_simple_xml_parser.rb +46 -0
- data/lib/cls_test_regen.rb +187 -0
- data/lib/cls_track.rb +52 -0
- data/lib/cls_trackpoint.rb +205 -0
- data/lib/mod_introspect.rb +33 -0
- data/lib/mod_io.rb +65 -0
- data/lib/mod_project_info.rb +81 -0
- data/lib/mod_string.rb +26 -0
- data/lib/mod_test_helper.rb +22 -0
- data/samples/20041113_richmond_marathon.html +532 -0
- data/samples/20050305_corporate_cup_hm.html +448 -0
- data/samples/20050430_nashville_marathon.html +530 -0
- data/samples/gps_point_capture.html +54 -0
- data/samples/phoenix_marathon.html +542 -0
- data/samples/run_2007_01_10_22_44_54.html +146 -0
- data/samples/run_2007_02_24_15_01_35.html +298 -0
- data/tests/tst_cls_counter_hash.rb +105 -0
- data/tests/tst_cls_delim_line.rb +72 -0
- data/tests/tst_cls_dttm.rb +129 -0
- data/tests/tst_cls_duration.rb +49 -0
- data/tests/tst_cls_forerunner_xml_parser.rb +68 -0
- data/tests/tst_cls_geo_data.rb +69 -0
- data/tests/tst_cls_gooby_object.rb +24 -0
- data/tests/tst_cls_google_map_generator.rb +107 -0
- data/tests/tst_cls_history.rb +44 -0
- data/tests/tst_cls_lap.rb +36 -0
- data/tests/tst_cls_line.rb +108 -0
- data/tests/tst_cls_options.rb +77 -0
- data/tests/tst_cls_position.rb +64 -0
- data/tests/tst_cls_run.rb +140 -0
- data/tests/tst_cls_simple_xml_parser.rb +48 -0
- data/tests/tst_cls_track.rb +68 -0
- data/tests/tst_cls_trackpoint.rb +143 -0
- data/tests/tst_gooby.rb +28 -0
- data/tests/tst_mod_introspect.rb +30 -0
- data/tests/tst_mod_io.rb +51 -0
- data/tests/tst_mod_project_info.rb +77 -0
- data/tests/tst_mod_string.rb +56 -0
- metadata +142 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
class TestClassSimpleXmlParser < Test::Unit::TestCase
|
12
|
+
|
13
|
+
include Gooby::TestHelper
|
14
|
+
|
15
|
+
@debug = false
|
16
|
+
|
17
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
18
|
+
|
19
|
+
def test_class_SimpleXmlParser
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_SimpleXmlParser_dump
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_class_SimpleXmlParser_initialize
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_class_SimpleXmlParser_tag_end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_class_SimpleXmlParser_tag_start
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_class_SimpleXmlParser_text
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
# Warning: possible obsolete test method - test_stub
|
44
|
+
|
45
|
+
def test_stub
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
class TestClassTrack < Test::Unit::TestCase
|
12
|
+
|
13
|
+
include Gooby::TestHelper
|
14
|
+
|
15
|
+
@debug = false
|
16
|
+
|
17
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
18
|
+
|
19
|
+
def test_class_Track
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_Track_add_trackpoint
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_class_Track_dump
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
# Warning: possible obsolete test method - test_class_Track_firstTkpt
|
32
|
+
|
33
|
+
def test_class_Track_firstTkpt
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_class_Track_first_tkpt
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_class_Track_initialize
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
# Warning: possible obsolete test method - test_class_Track_lastTkpt
|
46
|
+
|
47
|
+
def test_class_Track_lastTkpt
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_class_Track_last_tkpt
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_class_Track_size
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_class_Track_to_s
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
# Warning: possible obsolete test method - test_stub
|
64
|
+
|
65
|
+
def test_stub
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
class TestClassTrackpoint < Test::Unit::TestCase
|
12
|
+
|
13
|
+
include Gooby::TestHelper
|
14
|
+
|
15
|
+
@debug = false
|
16
|
+
|
17
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
18
|
+
|
19
|
+
def test_class_Trackpoint
|
20
|
+
|
21
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
22
|
+
end
|
23
|
+
|
24
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_altitude_as_float
|
25
|
+
|
26
|
+
def test_class_Trackpoint_altitude_as_float
|
27
|
+
|
28
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
29
|
+
actual = tkpt.altitude_as_float
|
30
|
+
expected = 220.279
|
31
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_class_Trackpoint_as_glatlng
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_class_Trackpoint_as_info_window_html
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_as_overlay_finish_point
|
43
|
+
|
44
|
+
def test_class_Trackpoint_as_overlay_finish_point
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_as_overlay_point
|
49
|
+
|
50
|
+
def test_class_Trackpoint_as_overlay_point
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_as_overlay_start_point
|
55
|
+
|
56
|
+
def test_class_Trackpoint_as_overlay_start_point
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_class_Trackpoint_compute_cumulative_pace
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_class_Trackpoint_compute_distance_and_pace
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_class_Trackpoint_deg2rad
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_class_Trackpoint_initialize
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_class_Trackpoint_is_first
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_class_Trackpoint_is_last
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_class_Trackpoint_is_split
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_latitude_as_float
|
89
|
+
|
90
|
+
def test_class_Trackpoint_latitude_as_float
|
91
|
+
|
92
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
93
|
+
actual = tkpt.latitude_as_float
|
94
|
+
expected = 35.49910
|
95
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
96
|
+
end
|
97
|
+
|
98
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_longitude_as_float
|
99
|
+
|
100
|
+
def test_class_Trackpoint_longitude_as_float
|
101
|
+
|
102
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
103
|
+
actual = tkpt.longitude_as_float
|
104
|
+
expected = -80.83695
|
105
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_class_Trackpoint_position
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_class_Trackpoint_rad2deg
|
113
|
+
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_class_Trackpoint_set_split
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_class_Trackpoint_split_info
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_class_Trackpoint_to_csv
|
125
|
+
|
126
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
127
|
+
actual = tkpt.to_csv
|
128
|
+
expected = '0 | 2007-02-01T02:13:52Z | 1 | 35.49910 | -80.83695 | 220.279 | 0.0 '
|
129
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
130
|
+
end
|
131
|
+
|
132
|
+
def test_class_Trackpoint_to_geo_s
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
def test_class_Trackpoint_to_s
|
137
|
+
|
138
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
139
|
+
actual = tkpt.to_s
|
140
|
+
expected = 'Tkpt: 1 lat: 35.49910 lng: -80.83695 alt: 220.279 note: date: 2007-02-01T02:13:52Z cdist: 0.0'
|
141
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
142
|
+
end
|
143
|
+
end
|
data/tests/tst_gooby.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
require 'tests/tst_mod_project_info.rb'
|
12
|
+
require 'tests/tst_mod_introspect.rb'
|
13
|
+
require 'tests/tst_mod_io.rb'
|
14
|
+
|
15
|
+
require 'tests/tst_cls_gooby_object.rb'
|
16
|
+
require 'tests/tst_cls_options.rb'
|
17
|
+
require 'tests/tst_cls_counter_hash.rb'
|
18
|
+
require 'tests/tst_cls_delim_line.rb'
|
19
|
+
require 'tests/tst_cls_dttm.rb'
|
20
|
+
require 'tests/tst_cls_position.rb'
|
21
|
+
require 'tests/tst_cls_track.rb'
|
22
|
+
require 'tests/tst_cls_trackpoint.rb'
|
23
|
+
require 'tests/tst_cls_lap.rb'
|
24
|
+
require 'tests/tst_cls_run.rb'
|
25
|
+
require 'tests/tst_cls_history.rb'
|
26
|
+
require 'tests/tst_cls_forerunner_xml_parser.rb'
|
27
|
+
require 'tests/tst_cls_simple_xml_parser.rb'
|
28
|
+
require 'tests/tst_cls_google_map_generator.rb'
|
@@ -0,0 +1,30 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
class TestModuleIntrospect < Test::Unit::TestCase
|
12
|
+
|
13
|
+
include Gooby::TestHelper
|
14
|
+
|
15
|
+
@debug = false
|
16
|
+
|
17
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
18
|
+
|
19
|
+
def test_module_Introspect
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_module_Introspect_introspect
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_module_Introspect_to_yaml_properties
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
data/tests/tst_mod_io.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
class TestModuleGoobyIO < Test::Unit::TestCase
|
12
|
+
|
13
|
+
include Gooby::TestHelper
|
14
|
+
|
15
|
+
@debug = false
|
16
|
+
|
17
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
18
|
+
|
19
|
+
def test_module_GoobyIO
|
20
|
+
|
21
|
+
fn = 'data/test1.txt'
|
22
|
+
obj = Gooby::GoobyObject.new
|
23
|
+
a1 = obj.read_lines(fn, false)
|
24
|
+
a2 = obj.read_lines(fn, true)
|
25
|
+
a3 = obj.read_as_ascii_lines(fn, 10, false)
|
26
|
+
|
27
|
+
puts '' if @debug
|
28
|
+
a1.each { |line| puts line } if @debug
|
29
|
+
a2.each { |line| puts line } if @debug
|
30
|
+
a3.each { |line| puts line } if @debug
|
31
|
+
|
32
|
+
assert_equal('This is just a file', a2[0], "a2[0] is not as expected.")
|
33
|
+
assert_equal('This is just a file', a3[0], "a3[0] is not as expected.")
|
34
|
+
assert_equal('test data.', a2[3], "a2[1] is not as expected.")
|
35
|
+
assert_equal(' test data.', a3[3], "a3[3] is not as expected.")
|
36
|
+
|
37
|
+
puts "todo: implement #{name}" if @debug
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_module_GoobyIO_read_as_ascii_lines
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_module_GoobyIO_read_lines
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_module_GoobyIO_strip_lines
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
Gooby - Copyright 2007 by Chris Joakim.
|
4
|
+
Gooby is available under GNU General Public License (GPL) license.
|
5
|
+
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'gooby'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
class TestModuleProjectInfo < Test::Unit::TestCase
|
12
|
+
|
13
|
+
include Gooby::TestHelper
|
14
|
+
|
15
|
+
@debug = false
|
16
|
+
|
17
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
18
|
+
|
19
|
+
def test_module_GoobyProjectInfo
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_module_GoobyProjectInfo_google_maps_api_level
|
24
|
+
|
25
|
+
obj = Gooby::GoobyObject.new
|
26
|
+
assert_equal '2', obj.google_maps_api_level
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_module_GoobyProjectInfo_project_author
|
30
|
+
|
31
|
+
obj = Gooby::GoobyObject.new
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_module_GoobyProjectInfo_project_copyright
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
# Warning: possible obsolete test method - test_module_GoobyProjectInfo_project_copyrightttt
|
39
|
+
|
40
|
+
def test_module_GoobyProjectInfo_project_copyrightttt
|
41
|
+
|
42
|
+
obj = Gooby::GoobyObject.new
|
43
|
+
assert_equal 'Copyright (C) 2007 Chris Joakim', obj.project_copyright
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_module_GoobyProjectInfo_project_date
|
47
|
+
|
48
|
+
obj = Gooby::GoobyObject.new
|
49
|
+
assert_equal '2007/02/25', obj.project_date
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_module_GoobyProjectInfo_project_license
|
53
|
+
|
54
|
+
obj = Gooby::GoobyObject.new
|
55
|
+
assert_equal 'GNU General Public License (GPL). See http://www.gnu.org/copyleft/gpl.html', obj.project_license
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_module_GoobyProjectInfo_project_version_number
|
59
|
+
|
60
|
+
obj = Gooby::GoobyObject.new
|
61
|
+
assert_equal '0.9.0', obj.project_version_number
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_module_GoobyProjectInfo_project_year
|
65
|
+
|
66
|
+
obj = Gooby::GoobyObject.new
|
67
|
+
assert_equal '2007', obj.project_year
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_module_GoobyProjectInfo_some_new_thing
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_module_GoobyProjectInfo_tested_files
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|