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,44 @@
|
|
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 TestClassHistory < 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_History
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_History_add_run
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_class_History_initialize
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_class_History_print_string
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_class_History_to_s
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
# Warning: possible obsolete test method - test_stub
|
40
|
+
|
41
|
+
def test_stub
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,36 @@
|
|
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 TestClassLap < 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_Lap
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_Lap_initialize
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_class_Lap_to_s
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
# Warning: possible obsolete test method - test_stub
|
32
|
+
|
33
|
+
def test_stub
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,108 @@
|
|
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 TestClassLine < 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_Line
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_Line_concatinate_tokens
|
24
|
+
|
25
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
26
|
+
line = Gooby::Line.new(s)
|
27
|
+
actual = line.concatinate_tokens(2)
|
28
|
+
expected = 'Home at South Faulkner Way Stopsign'
|
29
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_class_Line_initialize
|
33
|
+
|
34
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
35
|
+
line = Gooby::Line.new(s)
|
36
|
+
actual = line.tokens[6]
|
37
|
+
expected = 'Way'
|
38
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_class_Line_is_comment
|
42
|
+
|
43
|
+
line = Gooby::Line.new(' # hello ')
|
44
|
+
actual = line.is_comment
|
45
|
+
expected = true
|
46
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
47
|
+
|
48
|
+
line = Gooby::Line.new('heck no')
|
49
|
+
actual = line.is_comment
|
50
|
+
expected = false
|
51
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_class_Line_is_populated_non_comment
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_class_Line_match
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_class_Line_token
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_class_Line_token_count
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_class_Line_token_idx_equals
|
72
|
+
|
73
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
74
|
+
line = Gooby::Line.new(s)
|
75
|
+
|
76
|
+
actual = line.token_idx_equals(2, 'Home')
|
77
|
+
expected = true
|
78
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
79
|
+
|
80
|
+
actual = line.token_idx_equals(1, 'Home')
|
81
|
+
expected = false
|
82
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
83
|
+
|
84
|
+
actual = line.token_idx_equals(99, 'Home')
|
85
|
+
expected = false
|
86
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
87
|
+
end
|
88
|
+
|
89
|
+
# Warning: possible obsolete test method - test_class_is_populated_non_comment
|
90
|
+
|
91
|
+
def test_class_is_populated_non_comment
|
92
|
+
|
93
|
+
line = Gooby::Line.new(' # hello ')
|
94
|
+
actual = line.is_populated_non_comment
|
95
|
+
expected = false
|
96
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
97
|
+
|
98
|
+
line = Gooby::Line.new('heck no')
|
99
|
+
actual = line.is_populated_non_comment
|
100
|
+
expected = true
|
101
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
102
|
+
|
103
|
+
line = Gooby::Line.new(' ')
|
104
|
+
actual = line.is_populated_non_comment
|
105
|
+
expected = false
|
106
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
107
|
+
end
|
108
|
+
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 TestClassOptions < 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_Options
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_Options_get
|
24
|
+
|
25
|
+
opts = Gooby::Options.new('gooby_options.yaml')
|
26
|
+
|
27
|
+
actual = opts.get('gmap_map_element_id')
|
28
|
+
expected = 'map'
|
29
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
30
|
+
|
31
|
+
actual = opts.get('gmap_width')
|
32
|
+
expected = '900px'
|
33
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
34
|
+
|
35
|
+
actual = opts.get('gmap_height')
|
36
|
+
expected = '600px'
|
37
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
38
|
+
|
39
|
+
actual = opts.get('gmap_approx_max_points')
|
40
|
+
expected = '200'.to_i
|
41
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
42
|
+
|
43
|
+
actual = opts.get('oops_not_there')
|
44
|
+
expected = ''
|
45
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
46
|
+
|
47
|
+
name = 'gmap_type_control'
|
48
|
+
actual = opts.get("#{name}")
|
49
|
+
assert(actual == true, "#{name} value is not as expected; #{actual}")
|
50
|
+
|
51
|
+
name = 'gmap_gen_comments'
|
52
|
+
actual = opts.get(name)
|
53
|
+
expected = true
|
54
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_class_Options_initialize
|
58
|
+
|
59
|
+
opts = Gooby::Options.new('gooby_options.yaml')
|
60
|
+
actual = opts.yamlFilename
|
61
|
+
expected = "gooby_options.yaml"
|
62
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_class_Options_loadFile
|
66
|
+
|
67
|
+
# This method is tested in the other test methods.
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_class_Options_to_s
|
71
|
+
|
72
|
+
opts = Gooby::Options.new('gooby_options.yaml')
|
73
|
+
actual = opts.to_s
|
74
|
+
expected = "Options: filename: gooby_options.yaml entries: 9"
|
75
|
+
# assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,64 @@
|
|
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 TestClassPosition < 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_Position
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_Position_altitude_as_float
|
24
|
+
|
25
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
26
|
+
assert_equal(220.279, pos.altitude_as_float, "altitude is not as expected.")
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_class_Position_initialize
|
30
|
+
|
31
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
32
|
+
assert_equal('35.49910', pos.latitude, "latitude is not as expected.")
|
33
|
+
assert_equal('-80.83695', pos.longitude, "longitude is not as expected.")
|
34
|
+
assert_equal('220.279', pos.altitude, "altitude is not as expected.")
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_class_Position_latitude_as_float
|
38
|
+
|
39
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
40
|
+
assert_equal(35.49910, pos.latitude_as_float, "latitude is not as expected.")
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_class_Position_longitude_as_float
|
44
|
+
|
45
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
46
|
+
assert_equal(-80.83695, pos.longitude_as_float, "longitude is not as expected.")
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_class_Position_to_csv
|
50
|
+
|
51
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
52
|
+
actual = pos.to_csv
|
53
|
+
expected = '35.49910 | -80.83695 | 220.279'
|
54
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_class_Position_to_s
|
58
|
+
|
59
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
60
|
+
actual = pos.to_s
|
61
|
+
expected = 'lat: 35.49910 lng: -80.83695 alt: 220.279 note: '
|
62
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,140 @@
|
|
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 TestClassRun < 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_Run
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_class_Run_add_lap
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_class_Run_add_track
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
# Warning: possible obsolete test method - test_class_Run_compute_center_point
|
32
|
+
|
33
|
+
def test_class_Run_compute_center_point
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_class_Run_compute_distance_and_pace
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_class_Run_compute_splits
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_class_Run_duration
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_class_Run_end_dttm
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_class_Run_end_hh_mm_ss
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# Warning: possible obsolete test method - test_class_Run_filter_trackpoints
|
58
|
+
|
59
|
+
def test_class_Run_filter_trackpoints
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_class_Run_finish
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
# Warning: possible obsolete test method - test_class_Run_generate_gmap_info
|
68
|
+
|
69
|
+
def test_class_Run_generate_gmap_info
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
# Warning: possible obsolete test method - test_class_Run_generate_gpoint_array
|
74
|
+
|
75
|
+
def test_class_Run_generate_gpoint_array
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
# Warning: possible obsolete test method - test_class_Run_generate_key_js
|
80
|
+
|
81
|
+
def test_class_Run_generate_key_js
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
# Warning: possible obsolete test method - test_class_Run_generate_overlay_points
|
86
|
+
|
87
|
+
def test_class_Run_generate_overlay_points
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_class_Run_initialize
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_class_Run_lapCount
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_class_Run_print_string
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_class_Run_put_csv
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_class_Run_put_laps
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_class_Run_put_tkpt_csv
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_class_Run_start_dttm
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_class_Run_start_hh_mm_ss
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_class_Run_start_yyyy_mm_dd
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_class_Run_to_s
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_class_Run_trackpoint_count
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
# Warning: possible obsolete test method - test_stub
|
136
|
+
|
137
|
+
def test_stub
|
138
|
+
|
139
|
+
end
|
140
|
+
end
|