Gooby 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/README +218 -0
  2. data/bin/forerunner_xml_parser.rb +28 -0
  3. data/bin/forerunner_xml_parser.sh +16 -0
  4. data/bin/forerunner_xml_splitter.rb +60 -0
  5. data/bin/gen_gmap.rb +30 -0
  6. data/bin/gen_gmap.sh +19 -0
  7. data/bin/tests_gen.rb +13 -0
  8. data/data/20041113_richmond_marathon.csv +1036 -0
  9. data/data/20041113_richmond_marathon.xml +8663 -0
  10. data/data/20050305_corporate_cup_hm.csv +251 -0
  11. data/data/20050305_corporate_cup_hm.xml +2208 -0
  12. data/data/20050430_nashville_marathon.csv +1208 -0
  13. data/data/20050430_nashville_marathon.xml +10043 -0
  14. data/data/20051119_dowd_ymca_hm.csv +251 -0
  15. data/data/20051119_dowd_ymca_hm.xml +2210 -0
  16. data/data/20051124_hyatt_turkey_trot_8K.csv +321 -0
  17. data/data/20051124_hyatt_turkey_trot_8K.xml +2651 -0
  18. data/data/forerunner_2005.xml +259620 -0
  19. data/data/forerunner_2006.xml +190853 -0
  20. data/data/forerunner_2007.xml +259014 -0
  21. data/data/geo_data.txt +171 -0
  22. data/data/phx.csv +1280 -0
  23. data/data/phx.xml +10620 -0
  24. data/data/run_2007_01_01_16_38_27.xml +2020 -0
  25. data/data/run_2007_01_06_15_27_31.xml +2020 -0
  26. data/data/run_2007_01_10_12_25_47.xml +820 -0
  27. data/data/run_2007_01_10_22_44_54.csv +112 -0
  28. data/data/run_2007_01_10_22_44_54.xml +908 -0
  29. data/data/run_2007_01_11_10_48_45.xml +1292 -0
  30. data/data/run_2007_01_13_15_37_06.xml +1964 -0
  31. data/data/run_2007_01_14_15_46_02.xml +1368 -0
  32. data/data/run_2007_01_15_14_01_48.xml +1868 -0
  33. data/data/run_2007_01_20_16_22_05.xml +1702 -0
  34. data/data/run_2007_01_27_17_32_13.xml +3626 -0
  35. data/data/run_2007_01_28_19_14_52.xml +2538 -0
  36. data/data/run_2007_02_03_14_30_20.xml +2016 -0
  37. data/data/run_2007_02_04_18_02_30.xml +1476 -0
  38. data/data/run_2007_02_17_16_29_35.xml +1236 -0
  39. data/data/run_2007_02_19_14_44_33.xml +1816 -0
  40. data/data/run_2007_02_23_15_53_55.xml +36 -0
  41. data/data/run_2007_02_23_15_55_20.xml +1296 -0
  42. data/data/run_2007_02_24_15_01_35.csv +484 -0
  43. data/data/run_2007_02_24_15_01_35.xml +3884 -0
  44. data/data/test1.txt +4 -0
  45. data/lib/cls_counter_hash.rb +83 -0
  46. data/lib/cls_delim_line.rb +40 -0
  47. data/lib/cls_dttm.rb +84 -0
  48. data/lib/cls_duration.rb +87 -0
  49. data/lib/cls_forerunner_xml_parser.rb +183 -0
  50. data/lib/cls_forerunner_xml_splitter.rb +113 -0
  51. data/lib/cls_geo_data.rb +186 -0
  52. data/lib/cls_gooby_object.rb +23 -0
  53. data/lib/cls_google_map_generator.rb +368 -0
  54. data/lib/cls_history.rb +38 -0
  55. data/lib/cls_lap.rb +27 -0
  56. data/lib/cls_line.rb +78 -0
  57. data/lib/cls_options.rb +74 -0
  58. data/lib/cls_position.rb +49 -0
  59. data/lib/cls_run.rb +199 -0
  60. data/lib/cls_simple_xml_parser.rb +46 -0
  61. data/lib/cls_test_regen.rb +187 -0
  62. data/lib/cls_track.rb +52 -0
  63. data/lib/cls_trackpoint.rb +205 -0
  64. data/lib/mod_introspect.rb +33 -0
  65. data/lib/mod_io.rb +65 -0
  66. data/lib/mod_project_info.rb +81 -0
  67. data/lib/mod_string.rb +26 -0
  68. data/lib/mod_test_helper.rb +22 -0
  69. data/samples/20041113_richmond_marathon.html +532 -0
  70. data/samples/20050305_corporate_cup_hm.html +448 -0
  71. data/samples/20050430_nashville_marathon.html +530 -0
  72. data/samples/gps_point_capture.html +54 -0
  73. data/samples/phoenix_marathon.html +542 -0
  74. data/samples/run_2007_01_10_22_44_54.html +146 -0
  75. data/samples/run_2007_02_24_15_01_35.html +298 -0
  76. data/tests/tst_cls_counter_hash.rb +105 -0
  77. data/tests/tst_cls_delim_line.rb +72 -0
  78. data/tests/tst_cls_dttm.rb +129 -0
  79. data/tests/tst_cls_duration.rb +49 -0
  80. data/tests/tst_cls_forerunner_xml_parser.rb +68 -0
  81. data/tests/tst_cls_geo_data.rb +69 -0
  82. data/tests/tst_cls_gooby_object.rb +24 -0
  83. data/tests/tst_cls_google_map_generator.rb +107 -0
  84. data/tests/tst_cls_history.rb +44 -0
  85. data/tests/tst_cls_lap.rb +36 -0
  86. data/tests/tst_cls_line.rb +108 -0
  87. data/tests/tst_cls_options.rb +77 -0
  88. data/tests/tst_cls_position.rb +64 -0
  89. data/tests/tst_cls_run.rb +140 -0
  90. data/tests/tst_cls_simple_xml_parser.rb +48 -0
  91. data/tests/tst_cls_track.rb +68 -0
  92. data/tests/tst_cls_trackpoint.rb +143 -0
  93. data/tests/tst_gooby.rb +28 -0
  94. data/tests/tst_mod_introspect.rb +30 -0
  95. data/tests/tst_mod_io.rb +51 -0
  96. data/tests/tst_mod_project_info.rb +77 -0
  97. data/tests/tst_mod_string.rb +56 -0
  98. 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
@@ -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
@@ -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