gooby 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/README +48 -67
  2. data/bin/20050305_corporate_cup_hm_to_csv.rb +9 -0
  3. data/bin/20050430_nashville_marathon_to_csv.rb +9 -0
  4. data/bin/20060115_phoenix_marathon_to_csv.rb +9 -0
  5. data/bin/activity_2007_03_10_13_02_32.xml_to_csv.rb +9 -0
  6. data/bin/{tests_gen.rb → code_scan.rb} +6 -4
  7. data/bin/example_usage.rb +2 -3
  8. data/bin/example_usage.sh +52 -0
  9. data/bin/gen_gap_phx.rb +10 -0
  10. data/bin/gen_gmap_cc_2005.rb +10 -0
  11. data/bin/gen_gmap_cc_2007.rb +10 -0
  12. data/bin/gen_gmap_nashville.rb +10 -0
  13. data/bin/gen_gmap_phx.rb +10 -0
  14. data/bin/phx_to_csv.rb +47 -0
  15. data/bin/split_forerunner_logbook_2007.rb +10 -0
  16. data/bin/split_training_center_2007.rb +8 -0
  17. data/data/{2007_03_04.tcx → 2007_03_10.tcx} +11694 -0
  18. data/data/activity_2007_03_10_13_02_32.csv +1168 -0
  19. data/data/activity_2007_03_10_13_02_32.xml +11695 -0
  20. data/data/forerunner_2007.xml +0 -227142
  21. data/img/gicons/readme.txt +3 -0
  22. data/lib/gooby.rb +625 -552
  23. data/samples/20050305_corporate_cup_hm.html +271 -269
  24. data/samples/20050430_nashville_marathon.html +1240 -246
  25. data/samples/20060115_phoenix_marathon.html +1596 -0
  26. data/samples/20070310_corporate_cup_hm.html +1367 -0
  27. data/samples/phoenix_marathon.html +1312 -258
  28. data/tests/ts_gooby.rb +423 -551
  29. data/tests/ts_gooby_min.rb +550 -0
  30. metadata +25 -67
  31. data/bin/tcx_ex.rb +0 -35
  32. data/data/20051124_hyatt_turkey_trot_8K.csv +0 -321
  33. data/data/20051124_hyatt_turkey_trot_8K.xml +0 -2651
  34. data/data/2007_03_03.tcx +0 -6207
  35. data/data/activity_2007_03_04_15_22_36.xml +0 -10545
  36. data/data/run_2007_01_01_16_38_27.xml +0 -2020
  37. data/data/run_2007_02_24_15_01_35.csv +0 -484
  38. data/data/run_2007_02_24_15_01_35.xml +0 -3884
  39. data/lib/gooby/cls_counter_hash.rb +0 -78
  40. data/lib/gooby/cls_delim_line.rb +0 -35
  41. data/lib/gooby/cls_dttm.rb +0 -79
  42. data/lib/gooby/cls_duration.rb +0 -79
  43. data/lib/gooby/cls_forerunner_xml_parser.rb +0 -178
  44. data/lib/gooby/cls_forerunner_xml_splitter.rb +0 -109
  45. data/lib/gooby/cls_geo_data.rb +0 -181
  46. data/lib/gooby/cls_gooby_command.rb +0 -46
  47. data/lib/gooby/cls_gooby_object.rb +0 -18
  48. data/lib/gooby/cls_google_map_generator.rb +0 -363
  49. data/lib/gooby/cls_history.rb +0 -33
  50. data/lib/gooby/cls_lap.rb +0 -22
  51. data/lib/gooby/cls_line.rb +0 -75
  52. data/lib/gooby/cls_options.rb +0 -67
  53. data/lib/gooby/cls_position.rb +0 -44
  54. data/lib/gooby/cls_run.rb +0 -194
  55. data/lib/gooby/cls_simple_xml_parser.rb +0 -41
  56. data/lib/gooby/cls_test_regen.rb +0 -182
  57. data/lib/gooby/cls_track.rb +0 -47
  58. data/lib/gooby/cls_trackpoint.rb +0 -200
  59. data/lib/gooby/cls_training_center_parser.rb +0 -183
  60. data/lib/gooby/cls_training_center_splitter.rb +0 -109
  61. data/lib/gooby/mod_introspect.rb +0 -26
  62. data/lib/gooby/mod_io.rb +0 -58
  63. data/lib/gooby/mod_project_info.rb +0 -80
  64. data/lib/gooby/mod_string.rb +0 -19
  65. data/lib/gooby/mod_test_helper.rb +0 -15
  66. data/samples/20041113_richmond_marathon.html +0 -532
  67. data/samples/run_2007_01_10_22_44_54.html +0 -201
  68. data/samples/run_2007_02_24_15_01_35.html +0 -298
  69. data/tests/tc_cls_counter_hash.rb +0 -107
  70. data/tests/tc_cls_delim_line.rb +0 -74
  71. data/tests/tc_cls_dttm.rb +0 -131
  72. data/tests/tc_cls_duration.rb +0 -51
  73. data/tests/tc_cls_forerunner_xml_parser.rb +0 -70
  74. data/tests/tc_cls_geo_data.xxx +0 -71
  75. data/tests/tc_cls_gooby_object.rb +0 -26
  76. data/tests/tc_cls_google_map_generator.rb +0 -109
  77. data/tests/tc_cls_history.rb +0 -46
  78. data/tests/tc_cls_lap.rb +0 -38
  79. data/tests/tc_cls_line.rb +0 -110
  80. data/tests/tc_cls_options.rb +0 -79
  81. data/tests/tc_cls_position.rb +0 -66
  82. data/tests/tc_cls_run.rb +0 -142
  83. data/tests/tc_cls_simple_xml_parser.rb +0 -50
  84. data/tests/tc_cls_track.rb +0 -70
  85. data/tests/tc_cls_trackpoint.rb +0 -145
  86. data/tests/tc_mod_introspect.rb +0 -32
  87. data/tests/tc_mod_io.rb +0 -53
  88. data/tests/tc_mod_project_info.rb +0 -79
  89. data/tests/tc_mod_string.rb +0 -58
  90. /data/data/{phx.csv → 20060115_phoenix_marathon.csv} +0 -0
  91. /data/data/{phx.xml → 20060115_phoenix_marathon.xml} +0 -0
data/README CHANGED
@@ -1,13 +1,6 @@
1
- = Gooby -- Google APIs + Ruby
1
+ = Gooby = Google APIs + Ruby
2
2
 
3
- Version: 0.9.4
4
-
5
- RubyForge Release Notes:
6
-
7
- Gooby = Google APIs + Ruby.
8
- This release adds support for Garmin TrainingCenter TCX XML files, created by
9
- the newer Garmin devices such as models 205 and 305. For an example of a Google Map
10
- created with Gooby, see http://www.joakimsoftware.com/gmap/phoenix_marathon.html
3
+ Version: 0.9.5
11
4
 
12
5
  ---
13
6
 
@@ -23,8 +16,6 @@ as created in one of the following three ways.
23
16
  See any of the 'data/*.csv' files in the distribution for an example
24
17
  of the CSV format.
25
18
 
26
- Support for Garmin TrainingCenter *.tcx files was added in the 0.9.4 release.
27
-
28
19
  Google maps are applicable really to any outdoor activity for which GPS data
29
20
  can be obtained. The focus of Gooby is on running, because the author is a
30
21
  marathon runner, and the Garmin Forerunner (I use both models 201 and 205)
@@ -35,9 +26,9 @@ etc).
35
26
  Other activities, such as cycling, hiking, walking, driving, and even golfing
36
27
  are also well suited for Gooby. Given a waterproof GPS receiver, sailing, and
37
28
  swimming Google Maps can also be created with Gooby. Please let me know how
38
- you use Gooby!
29
+ you use Gooby! Feedback is requested.
39
30
 
40
- All Gooby 0.9.4 functionality is intended to be invoked from a command line.
31
+ All Gooby functionality is intended to be invoked from a command line.
41
32
  Web and Rails integration may be done in a later release.
42
33
 
43
34
  See the Goals/Requirements and Usage sections below for the complete list of
@@ -58,22 +49,17 @@ Gooby is available under GNU General Public License (GPL) license.
58
49
  == Download
59
50
 
60
51
  The latest version of gooby can be found at
61
- * http://rubyforge/
52
+ * http://rubyforge.org/projects/gooby/
62
53
 
63
54
  == Installation
64
55
 
65
- Gooby is packaged and installed as a Gem.
66
-
67
- == Development vs Gem Packaging
56
+ Gooby is packaged and installed as a ruby 'gem'. Download the latest gem to
57
+ your computer, then run the following command from your download directory.
58
+ The -t flag will cause the Gooby regression test suite to be executed.
68
59
 
69
- In development, the coding standard for Gooby is to have a separate *.rb source
70
- file for each class or module. There also a one-to-one mapping between 'base'
71
- code files and 'tc_*.rb' test case files. The CVS repository contains these
72
- separate files.
73
-
74
- As of release 0.9.3 all gem-packaged code is merged into file 'gooby.rb',
75
- and all tests are merged into file 'ts_gooby.rb'. The idea here is to simplify
76
- the eventual deployed gem and directory structure on the user's computer.
60
+ gem install gooby-0.9.5.gem
61
+ or
62
+ gem install gooby-0.9.5.gem -t
77
63
 
78
64
  == Running the Gooby Test Suite
79
65
 
@@ -90,30 +76,23 @@ directory:
90
76
  Sample Gooby-generated Google Maps are at www.joakimsoftware.com, below:
91
77
 
92
78
  http://www.joakimsoftware.com/gmap/gps_point_capture.html
93
- http://www.joakimsoftware.com/gmap/20041113_richmond_marathon.html
79
+
94
80
  http://www.joakimsoftware.com/gmap/20050305_corporate_cup_hm.html
95
81
  http://www.joakimsoftware.com/gmap/20050430_nashville_marathon.html
82
+ http://www.joakimsoftware.com/gmap/20060115_phoenix_marathon.html
83
+ http://www.joakimsoftware.com/gmap/20070310_corporate_cup_hm.html
96
84
  http://www.joakimsoftware.com/gmap/phoenix_marathon.html
97
- http://www.joakimsoftware.com/gmap/run_2007_02_24_15_01_35.html
98
85
 
99
86
 
100
87
  === Road Map / TODO List
101
88
 
102
- * IE BUG - Larger maps appear properly in Safari and Firefox browser, but not on
103
- Inernet Explorer.
104
-
105
89
  * IE or Google Bug - The Google Map v2 JavaScript has not run properly in
106
90
  Internet Explorer at times. Script error after loading the map background,
107
91
  but before the map route is drawn.
108
92
 
109
- * Incomplete, WIP - Google Map generation from your data/geo_data.txt file.
110
-
111
- * Incomplete, WIP - Support sources of GPS data other than Garmin Forerunner
112
- XML from Forerunner Logbook. Training Center and Forerunner 205 data is
113
- expected in March 2007.
114
-
115
- * BUG - TestGenerator adds two space lines to top-of-file upon test code
116
- regeneration.
93
+ * Incomplete - Google Map generation from your data/geo_data.txt file.
94
+ You can, however, provide your own data as a CSV file per the current
95
+ map generation design.
117
96
 
118
97
  * Add more regression tests.
119
98
 
@@ -130,9 +109,10 @@ a bug, on the Tracker page.
130
109
 
131
110
  = Usage
132
111
 
133
- See file 'bin/example_usage.rb' in the gem distribution. Most of this file
134
- is shown below. You will probably have to change the input filenames (yaml,
135
- xml, csv) to your own filenames on your computer.
112
+ See files 'bin/example_usage.sh' and 'bin/example_usage.rb' in the gem
113
+ distribution. Most of the *.rb file is shown below. You will probably have to
114
+ change the input filenames (yaml, xml, csv) to your own filenames on your
115
+ computer.
136
116
 
137
117
  Of course, you'll also have to obtain a Google Maps key for your web site.
138
118
  It's free, and has to be included in every page which displays a map. See
@@ -141,7 +121,6 @@ into the generated html page. Also see the Google Maps API site -
141
121
  http://www.google.com/apis/maps/
142
122
 
143
123
  require 'gooby'
144
-
145
124
  include REXML
146
125
 
147
126
  # First, create a GoobyCommand object.
@@ -159,21 +138,21 @@ http://www.google.com/apis/maps/
159
138
 
160
139
  # Split a large Garmin ForerunnerLogbook XML file into individual 'run' files.
161
140
  # In this example, '/temp' is the output directory.
162
- gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp')
141
+ gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp') if true
163
142
 
164
143
  # Split a large Garmin TrainingCenter TCX(XML) file into individual 'activity' files.
165
- gooby.split_garmin_training_center_xml('data/2007_03_04.tcx', '/temp')
144
+ gooby.split_garmin_training_center_xml('data/2007_03_10.tcx', '/temp') if true
166
145
 
167
146
  # Parse a Garmin ForerunnerLogbook XML file, or previously 'split' subset, into CSV.
168
147
  # You may want to redirect this output to a file.
169
- gooby.parse_garmin_forerunner_logbook_xml 'data/run_2007_01_01_16_38_27.xml'
148
+ gooby.parse_garmin_forerunner_logbook_xml 'data/run_2007_01_01_16_38_27.xml' if true
170
149
 
171
150
  # Parse a TrainingCenter TCX(XML) file, or previously 'split' subset, into CSV.
172
- gooby.parse_garmin_training_center_xml 'data/activity_2007_03_04_15_22_36.xml'
151
+ gooby.parse_garmin_training_center_xml 'data/activity_2007_03_04_15_22_36.xml' if true
173
152
 
174
153
  # Generate a Google Map from your CSV file data, and the Options per
175
154
  # your yaml file. You may also wish to redirect this output to a file.
176
- gooby.generate_google_map('data/phx.csv', options)
155
+ gooby.generate_google_map('data/phx.csv', options) if true
177
156
 
178
157
 
179
158
  == Goals / Requirements
@@ -216,24 +195,16 @@ f5. Provide the ability to generate Google Map HTML content from your GPS
216
195
 
217
196
  status = complete
218
197
 
219
- f6. Provide the ability to define your own points-of-interest (POI), route
220
- segments, and routes as a collection of GPS data in a simple text file.
221
- Allow "routes" to be composed from "reusable route segments", and
222
- annotated with your own POI.
223
-
224
- status = in-progress
225
-
226
- f7. Provide the ability to generate Google Maps (requirement f5) from your
227
- collection of GPS data (requirement f6).
228
-
229
- status = in-progress
230
-
231
- f8. Provide the ability (i.e. - an Internet web page) for a user to easily
198
+ f6. Provide the ability (i.e. - an Internet web page) for a user to easily
232
199
  obtain GPS coordinates for their particular POI, segments, and routes.
233
200
 
234
- status = complete.
201
+ See http://www.joakimsoftware.com/gmap/gps_point_capture.html and also
202
+ file gps_point_capture.html in the gem. Modify this file for your site
203
+ as necessary.
235
204
 
236
- f9. Provide the ability to alter appropriate Gooby behavior via a simple
205
+ status = complete
206
+
207
+ f7. Provide the ability to alter appropriate Gooby behavior via a simple
237
208
  configuration file (i.e. - gooby_options.yaml) rather than modifying
238
209
  the source code. Specific configuration requirements are:
239
210
  a. Allow the user to specify roughly how many points appear on a map.
@@ -242,22 +213,31 @@ f9. Provide the ability to alter appropriate Gooby behavior via a simple
242
213
 
243
214
  status = in-progress
244
215
 
245
- f10 Provide adequate user documentation and scripts, so that someone other
216
+ f8. Provide adequate user documentation and scripts, so that someone other
246
217
  than the author can actually use Gooby.
247
218
 
248
- status = in-progress
219
+ status = complete, see example_usage.sh and example_usage.rb
249
220
 
250
- f11. Provide sample files - xml, csv, images.
221
+ f9. Provide sample files - xml, csv, images.
251
222
 
252
223
  status = complete
253
224
 
254
- Currently out-of-scope but intended for a future release:
255
- ---------------------------------------------------------
225
+ Currently out-of-scope; but may be implemented at a future date.
226
+ ----------------------------------------------------------------
227
+
228
+ f40. Provide the ability to define your own points-of-interest (POI), route
229
+ segments, and routes as a collection of GPS data in a simple text file.
230
+ Allow "routes" to be composed from "reusable route segments", and
231
+ annotated with your own POI.
232
+
233
+ f41. Provide the ability to generate Google Maps (requirement f5) from your
234
+ collection of GPS data (requirement f40).
256
235
 
257
236
  f51. Other Google APIs, such as Google Earth.
258
237
 
259
238
  f52. Rails framework integration.
260
239
 
240
+
261
241
  === Technical Requirements
262
242
 
263
243
  t1. Conform to consistent coding and naming standards throughout the code.
@@ -293,3 +273,4 @@ t8. Implement a Ruby-standard packaging mechanism, so that users can easily
293
273
  This software is provided "as is" and without any express or implied warranties,
294
274
  including, without limitation, the implied warranties of merchantibility and
295
275
  fitness for a particular purpose.
276
+
@@ -0,0 +1,9 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ gooby.parse_garmin_forerunner_logbook_xml 'data/20050305_corporate_cup_hm.xml'
9
+
@@ -0,0 +1,9 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ gooby.parse_garmin_forerunner_logbook_xml 'data/20050430_nashville_marathon.xml'
9
+
@@ -0,0 +1,9 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ gooby.parse_garmin_forerunner_logbook_xml 'data/20060115_phoenix_marathon.xml'
9
+
@@ -0,0 +1,9 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ gooby.parse_garmin_training_center_xml 'data/activity_2007_03_10_13_02_32.xml'
9
+
@@ -1,16 +1,18 @@
1
- require 'gooby'
2
-
3
1
  =begin
4
2
 
5
3
  Gooby - Copyright 2007 by Chris Joakim.
6
4
  Gooby is available under GNU General Public License (GPL) license.
7
5
 
8
6
  Example command line:
9
- ruby bin/tests_gen.rb
7
+ ruby bin/code_scan.rb
10
8
 
11
9
  =end
12
10
 
13
11
  # The following prefixes ../lib to the active ruby load path
14
12
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
13
+ puts '$LOAD_PATH is now:'
14
+ puts $LOAD_PATH
15
+
16
+ require 'gooby'
15
17
 
16
- generator = Gooby::TestGenerator.new
18
+ generator = Gooby::CodeScanner.new(ARGV)
data/bin/example_usage.rb CHANGED
@@ -11,7 +11,6 @@ to your own filenames on your computer.
11
11
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
12
12
 
13
13
  require 'gooby'
14
-
15
14
  include REXML
16
15
 
17
16
  # First, create a GoobyCommand object.
@@ -32,7 +31,7 @@ puts "option '#{n}' = #{v}"
32
31
  gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp') if true
33
32
 
34
33
  # Split a large Garmin TrainingCenter TCX(XML) file into individual 'activity' files.
35
- gooby.split_garmin_training_center_xml('data/2007_03_04.tcx', '/temp') if true
34
+ gooby.split_garmin_training_center_xml('data/2007_03_10.tcx', '/temp') if true
36
35
 
37
36
  # Parse a Garmin ForerunnerLogbook XML file, or previously 'split' subset, into CSV.
38
37
  # You may want to redirect this output to a file.
@@ -43,5 +42,5 @@ gooby.parse_garmin_training_center_xml 'data/activity_2007_03_04_15_22_36.xml'
43
42
 
44
43
  # Generate a Google Map from your CSV file data, and the Options per
45
44
  # your yaml file. You may also wish to redirect this output to a file.
46
- gooby.generate_google_map('data/phx.csv', options) if false
45
+ gooby.generate_google_map('data/phx.csv', options) if true
47
46
 
@@ -0,0 +1,52 @@
1
+
2
+ echo splitting forerunner logbook 2007 file
3
+ ruby bin/split_forerunner_logbook_2007.rb
4
+ echo
5
+
6
+ echo splitting training center 2007 file
7
+ ruby bin/split_training_center_2007.rb
8
+ echo
9
+
10
+ echo parsing data/20050305_corporate_cup_hm.xml
11
+ ruby bin/20050305_corporate_cup_hm_to_csv.rb > data/20050305_corporate_cup_hm.csv
12
+ head -3 data/20050305_corporate_cup_hm.csv
13
+ echo ...
14
+ tail -3 data/20050305_corporate_cup_hm.csv
15
+ echo
16
+
17
+ echo parsing data/20050430_nashville_marathon.xml
18
+ ruby bin/20050430_nashville_marathon_to_csv.rb > data/20050430_nashville_marathon.csv
19
+ head -3 data/20050430_nashville_marathon.csv
20
+ echo ...
21
+ tail -3 data/20050430_nashville_marathon.csv
22
+ echo
23
+
24
+ echo parsing data/20060115_phoenix_marathon.xml
25
+ ruby bin/20060115_phoenix_marathon_to_csv.rb > data/20060115_phoenix_marathon.csv
26
+ head -3 data/20060115_phoenix_marathon.csv
27
+ echo ...
28
+ tail -3 data/20060115_phoenix_marathon.csv
29
+ echo
30
+
31
+ echo parsing data/activity_2007_03_10_13_02_32.csv
32
+ ruby bin/activity_2007_03_10_13_02_32.xml_to_csv.rb > data/activity_2007_03_10_13_02_32.csv
33
+ head -3 data/activity_2007_03_10_13_02_32.csv
34
+ echo ...
35
+ tail -3 data/activity_2007_03_10_13_02_32.csv
36
+ echo
37
+
38
+ echo generating corporate cup hm 2005 map
39
+ ruby bin/gen_gmap_cc_2005.rb > samples/20050305_corporate_cup_hm.html
40
+
41
+ echo generating nashville marathon map
42
+ ruby bin/gen_gmap_nashville.rb > samples/20050430_nashville_marathon.html
43
+
44
+ echo generating phoenix marthon map
45
+ ruby bin/gen_gmap_phx.rb > samples/20060115_phoenix_marathon.html
46
+
47
+ echo generating corporate cup hm 2007 map
48
+ ruby bin/gen_gmap_cc_2007.rb > samples/20070310_corporate_cup_hm.html
49
+
50
+ echo done
51
+
52
+
@@ -0,0 +1,10 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ options_file = 'gooby_options.yaml'
9
+ options = gooby.options(options_file)
10
+ gooby.generate_google_map('data/phx.csv', options)
@@ -0,0 +1,10 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ options_file = 'gooby_options.yaml'
9
+ options = gooby.options(options_file)
10
+ gooby.generate_google_map('data/20050305_corporate_cup_hm.csv', options)
@@ -0,0 +1,10 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ options_file = 'gooby_options.yaml'
9
+ options = gooby.options(options_file)
10
+ gooby.generate_google_map('data/activity_2007_03_10_13_02_32.csv', options)
@@ -0,0 +1,10 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ options_file = 'gooby_options.yaml'
9
+ options = gooby.options(options_file)
10
+ gooby.generate_google_map('data/20050430_nashville_marathon.csv', options)
@@ -0,0 +1,10 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ options_file = 'gooby_options.yaml'
9
+ options = gooby.options(options_file)
10
+ gooby.generate_google_map('data/20060115_phoenix_marathon.csv', options)
data/bin/phx_to_csv.rb ADDED
@@ -0,0 +1,47 @@
1
+ =begin rdoc
2
+
3
+ This file contains examples of how to use Gooby.
4
+
5
+ You will probably have to change the input filenames (yaml, xml, csv)
6
+ to your own filenames on your computer.
7
+
8
+ =end
9
+
10
+ # The following prefixes ../lib to the active ruby load path
11
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
12
+
13
+ require 'gooby'
14
+
15
+ include REXML
16
+
17
+ # First, create a GoobyCommand object.
18
+ gooby = Gooby::GoobyCommand.new
19
+
20
+ # Next, create an Options object from the given yaml file - see the sample
21
+ # 'gooby_options.yaml' file in the distribution.
22
+ options_file = 'gooby_options.yaml'
23
+ options = gooby.options(options_file)
24
+
25
+ # Optionally display some of its values.
26
+ n = 'gmap_approx_max_points'
27
+ v = options.get(n)
28
+ puts "option '#{n}' = #{v}"
29
+
30
+ # Split a large Garmin ForerunnerLogbook XML file into individual 'run' files.
31
+ # In this example, '/temp' is the output directory.
32
+ gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp') if true
33
+
34
+ # Split a large Garmin TrainingCenter TCX(XML) file into individual 'activity' files.
35
+ gooby.split_garmin_training_center_xml('data/2007_03_10.tcx', '/temp') if true
36
+
37
+ # Parse a Garmin ForerunnerLogbook XML file, or previously 'split' subset, into CSV.
38
+ # You may want to redirect this output to a file.
39
+ gooby.parse_garmin_forerunner_logbook_xml 'data/run_2007_01_01_16_38_27.xml' if true
40
+
41
+ # Parse a TrainingCenter TCX(XML) file, or previously 'split' subset, into CSV.
42
+ gooby.parse_garmin_training_center_xml 'data/activity_2007_03_04_15_22_36.xml' if true
43
+
44
+ # Generate a Google Map from your CSV file data, and the Options per
45
+ # your yaml file. You may also wish to redirect this output to a file.
46
+ gooby.generate_google_map('data/phx.csv', options) if true
47
+
@@ -0,0 +1,10 @@
1
+
2
+ # The following prefixes ../lib to the active ruby load path
3
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
+
5
+ require 'gooby'
6
+ include REXML
7
+
8
+ gooby = Gooby::GoobyCommand.new
9
+ gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp')
10
+
@@ -0,0 +1,8 @@
1
+
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+
4
+ require 'gooby'
5
+ include REXML
6
+
7
+ gooby = Gooby::GoobyCommand.new
8
+ gooby.split_garmin_training_center_xml('data/2007_03_10.tcx', '/temp')