gooby 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README +144 -180
  2. data/bin/example_usage.txt +55 -0
  3. data/bin/gooby_been_there.rb +35 -0
  4. data/bin/gooby_config.rb +16 -0
  5. data/bin/gooby_gen_gmap.rb +16 -0
  6. data/bin/gooby_parser.rb +19 -0
  7. data/bin/gooby_splitter.rb +18 -0
  8. data/bin/gooby_version.rb +16 -0
  9. data/bin/run_all.sh +23 -0
  10. data/bin/run_been_there.sh +16 -0
  11. data/bin/run_db_gen.sh +11 -0
  12. data/bin/run_db_load.sh +11 -0
  13. data/bin/run_gen_gmaps.sh +20 -0
  14. data/bin/run_parse.sh +43 -0
  15. data/bin/run_parse_named.sh +19 -0
  16. data/bin/run_split.sh +23 -0
  17. data/config/gooby_config.yaml +137 -0
  18. data/data/20050305_corporate_cup_hm.csv +251 -251
  19. data/data/20050430_nashville_marathon.csv +1208 -1208
  20. data/data/20060115_phoenix_marathon.csv +1280 -1280
  21. data/data/davidson_11m_20070101.csv +251 -0
  22. data/data/davidson_11m_20070101.xml +2020 -0
  23. data/data/davidson_5K_20070505.csv +286 -0
  24. data/data/davidson_5K_20070505.xml +2875 -0
  25. data/lib/gooby.rb +889 -361
  26. data/samples/20050305_corporate_cup_hm.html +270 -270
  27. data/samples/20050430_nashville_marathon.html +1240 -1240
  28. data/samples/20060115_phoenix_marathon.html +1312 -1312
  29. data/samples/been_there.txt +744 -0
  30. data/samples/davidson_11m_20070101.html +432 -0
  31. data/samples/davidson_5K_20070505.html +395 -0
  32. data/sql/gooby.ddl +56 -0
  33. data/sql/gooby_load.dml +35 -0
  34. metadata +30 -32
  35. data/bin/20050305_corporate_cup_hm_to_csv.rb +0 -9
  36. data/bin/20050430_nashville_marathon_to_csv.rb +0 -9
  37. data/bin/20060115_phoenix_marathon_to_csv.rb +0 -9
  38. data/bin/activity_2007_03_10_13_02_32.xml_to_csv.rb +0 -9
  39. data/bin/example_usage.rb +0 -46
  40. data/bin/example_usage.sh +0 -52
  41. data/bin/gen_gap_phx.rb +0 -10
  42. data/bin/gen_gmap_cc_2005.rb +0 -10
  43. data/bin/gen_gmap_cc_2007.rb +0 -10
  44. data/bin/gen_gmap_nashville.rb +0 -10
  45. data/bin/gen_gmap_phx.rb +0 -10
  46. data/bin/phx_to_csv.rb +0 -47
  47. data/bin/split_forerunner_logbook_2007.rb +0 -10
  48. data/bin/split_training_center_2007.rb +0 -8
  49. data/data/2007_03_10.tcx +0 -28445
  50. data/data/activity_2007_03_10_13_02_32.csv +0 -1168
  51. data/data/activity_2007_03_10_13_02_32.xml +0 -11695
  52. data/data/forerunner_2007.xml +0 -31872
  53. data/data/geo_data.txt +0 -171
  54. data/pkg/code_header.txt +0 -21
  55. data/pkg/pkg.rb +0 -238
  56. data/pkg/test_header.txt +0 -19
  57. data/samples/20070310_corporate_cup_hm.html +0 -1367
  58. data/samples/gps_point_capture.html +0 -54
  59. data/samples/phoenix_marathon.html +0 -1596
  60. data/tests/ts_gooby.rb +0 -1109
  61. data/tests/ts_gooby_min.rb +0 -550
data/data/geo_data.txt DELETED
@@ -1,171 +0,0 @@
1
- # This is the default file for holding YOUR particular geographic data.
2
- # This file is read and parsed by class GeoData.
3
- #
4
- # Gooby "Geo files" contain the following sections:
5
-
6
-
7
- points_of_interest_start
8
-
9
- . 35.49547 -80.83215 Home at South Faulkner Way Stopsign
10
- . 35.49246410935417 -80.8334487676620 St. Albans Ln at Concord Rd
11
- . 35.46713857814417 -80.78518778085709 17240 Royal Court Dr
12
- . 35.4992424404918 -80.84839940071106 Downtown Davidson
13
- . 35.500587556752365 -80.8493971824646 Inbound Bus Stop on Jackson St
14
- . 35.49815934349614 -80.84902167320251 Summit Coffee House
15
- . 35.49404300497254 -80.86026549339294 Cornelius YMCA
16
-
17
- points_of_interest_end
18
-
19
- other_points_of_interest_start
20
-
21
- . 35.494097599701725 -80.83323419094086 Caldwell Ln at Twain Ave
22
- . 35.493324534879854 -80.83260118961334 St. Albans Ln at Caldwell Ln
23
- . 35.49246410935417 -80.8334487676620 St. Albans Ln at Concord Rd
24
-
25
- . 35.49764181013854 -80.8336392045021 Gray Rd at Wolfe St
26
-
27
- . 35.49731643935862 -80.83175897598267 Conroy Ave at Wolfe St
28
- . 35.496591447377874 -80.83210229873657 Conroy Ave at Harper Lee St
29
- . 35.49592759356077 -80.83266019821167 Conroy Ave at North Faulkner Way
30
- . 35.495713586884705 -80.83282113075256 Conroy Ave at South Faulkner Way
31
- . 35.49461733966593 -80.83401203155518 Conroy Ave at Caldwell Ln
32
-
33
- . 35.496571793889714 -80.82844913005829 NE Corner of Ohenry Ave
34
- . 35.495759445506124 -80.82826405763626 Ohenry Ave at Harper Lee St
35
- . 35.49444482131112 -80.82820773124695 Ohenry at North Faulkner Way
36
-
37
- . 35.49478330634122 -80.82960516214371 North Faulkner Way at Fairview Drive
38
- . 35.494036453602554 -80.83004236221313 Fairview Drive at Ashby Dr
39
- . 35.492523072818805 -80.83124130964279 Caldwell Ln at Fairview Drive
40
- . 35.49171286735068 -80.83214521408081 Concord Rd at Fairview Drive
41
- . 35.49225227729099 -80.8332046866417 Concord Rd at Pat Stough Ln Pole
42
-
43
- . 35.492885587983785 -80.8265420794487 Ashby Dr at Ashby Dr
44
- . 35.49245100635615 -80.82489788532257 Ashby Dr at Chambers St
45
- . 35.49125644072662 -80.8253726363182 Meredith and Paul
46
-
47
- . 35.4900422022521 -80.82411736249924 Ashby Dr at Lake Trail
48
- . 35.48874277204962 -80.82409054040909 Morrison Hill at Lake Trail
49
- . 35.4893127767927 -80.82720994949341 Morrison Hill at N Kimberly Rd
50
- . 35.489288753685905 -80.82465916872025 Middle of McConnel Lake
51
-
52
- . 35.490917940838195 -80.82762837409973 N Kimberly Rd at McConnell Dr
53
- . 35.49161677775054 -80.82781076431274 N Kimberly Rd at N Downing St
54
- . 35.491765279811396 -80.82698732614517 Ashby Dr at N Downing St
55
- . 35.491057708706904 -80.82678884267807 Ashby Dr at McConnell Dr
56
-
57
- . 35.49588391877521 -80.83266019821167 Faulkner Sq. Park - NW Corner
58
- . 35.495169832663805 -80.83069682121277 Faulkner Sq. Park - NE Corner
59
- . 35.49501478560521 -80.83078265190125 Faulkner Sq. Park - SE Corner
60
- . 35.4957310568388 -80.83276212215424 Faulkner Sq. Park - SW Corner
61
-
62
- . 35.48882357756566 -80.82754790782928 North/South Kimberly Rd at Concord Rd
63
- . 35.48490114038599 -80.82898825407028 South Kimberly Rd at Hudson Pl
64
- . 35.48757435888456 -80.82566499710083 West end of Greenway Trail on Concord Rd
65
-
66
- . 35.48415856391174 -80.82033276557922 Greenway Trail at pole at corner of Concord Rd and Davidson-Concord Rd
67
-
68
- . 35.48141752370175 -80.82014501094818 Davidson-Concord Rd at Westmoreland Farm Rd
69
- . 35.48214483670891 -80.82406103610992 End of Westmoreland Farm Rd
70
-
71
- . 35.47805388846776 -80.81931084394455 End of Greenway at Robert Walker Dr
72
- . 35.47795122985448 -80.8196085691452 Robert Walker Dr at Concord Rd
73
- . 35.47470321838373 -80.80712556838989 Robert Walker Dr at River Crossing Blvd
74
- . 35.46859345593708 -80.81401348114014 Top of River Crossing Blvd hill
75
-
76
- . 35.47085436243515 -80.81011086702347 River Falls Dr at River Crossing Blvd
77
- . 35.46740945828581 -80.80724358558655 River Falls Dr at River Ford Dr
78
-
79
- . 35.46560066069102 -80.80374330282211 River Falls Dr at Clubhouse
80
- . 35.46510476342402 -80.7984271645546 River Falls Dr at Wildcat Dr
81
- . 35.46919855501691 -80.79529702663422 End of Wildcat Dr
82
-
83
- . 35.46776990222079 -80.79330146312714 River Falls Dr at 12th Hole path Tigerlilly
84
-
85
- . 35.46694852459695 -80.79146414995193 River Ford Dr at 12th Hole path
86
-
87
- . 35.46421345139867 -80.81106573343277 Davidson-Concord Rd at Parting Oaks Lane - River Run Entrance
88
- . 35.46479892217552 -80.81033885478973 Mid Parting Oaks Lane
89
- . 35.46511568630424 -80.80902189016342 River Ford Dr at Parting Oaks
90
-
91
- . 35.462114023013804 -80.80345630645752 River Ford Dr at Gazebo on Lake
92
-
93
- . 35.46990413411456 -80.7900989055633 River Ford Dr at Greyton La
94
- . 35.471483472938324 -80.79014450311661 River Ford Dr at Dembridge Dr
95
- . 35.46967476697559 -80.78843593597412 Tennis Center at Greyton La
96
- . 35.46942355459652 -80.7845064997673 Greyton La at Dembridge Dr
97
-
98
- . 35.46836626954736 -80.78357577323914 Dembridge Dr at Royal Court Dr
99
- . 35.46713857814417 -80.78518778085709 17240 Royal Court Dr
100
- . 35.46704682821191 -80.78516900539398 Royal Court Dr at Center Court Dr
101
- . 35.46627787228416 -80.78329145908356 Dembridge Dr at Center Court Dr
102
- . 35.463455391486946 -80.779227912426 Dembridge Dr at South Shearer Rd
103
-
104
-
105
- . 35.47143323165537 -80.78723698854446 Dembridge Dr at Winged Oak
106
- . 35.472379073149675 -80.78729063272476 Dembridge Dr at East Rocky River Rd
107
- . 35.47343193673893 -80.78515559434891 East Rocky River Rd at Shearer Rd
108
-
109
- . 35.479008388872735 -80.78656107187271 Shearer Rd at Lecheval La
110
- . 35.49493835384652 -80.79602926969528 Shearer Rd at Fisher Farm
111
-
112
- . 35.50735210188649 -80.7972791790962 Shearer Rd at Gray Rd
113
- . 35.50468827542437 -80.80991506576538 Gray Rd at White Horse
114
- . 35.50012681329686 -80.81527411937714 Gray Rd at Charden
115
- . 35.49930139898172 -80.8323436975479 Gray Rd at Davidson Trails Entrance
116
-
117
-
118
- . 35.4938006039269 -80.83570718765259 Concord Rd at Crescent Rd
119
- . 35.49528557182234 -80.83909749984741 Concord Rd at Gray Rd
120
- . 35.495923226083285 -80.84135055541992 Concord Rd at Thompson Rd
121
- . 35.49739941995118 -80.84346413612366 Concord Rd at Baker Dr
122
- . 35.49836897631244 -80.84471940994263 Concord Rd at Faculty Dr
123
- . 35.4992424404918 -80.84839940071106 Downtown Davidson - Rt 115 at Concord Rd
124
- . 35.50009842617289 -80.84813117980957 Rt 115 at Depot Street
125
- . 35.500482743307515 -80.84938645362854 Jackson St at Depot Street
126
- . 35.500587556752365 -80.8493971824646 Inbound Bus Stop on Jackson St
127
- . 35.49815934349614 -80.84902167320251 Summit Coffee House
128
- . 35.49751952328859 -80.84938913583755 Exxon Station Vending Machine
129
- . 35.49794534276524 -80.84902167320251 Rt 115 at South Street
130
- . 35.492782948313916 -80.85593104362488 Davidson/Cornelius Town Line at Rt 115 Trestle
131
- . 35.49270869825821 -80.8564218878746 Rt 115 at Potts
132
- . 35.492483763847176 -80.8570870757103 Rt 115 at Cornelius YMCA Entrance
133
-
134
- . 35.49881444423064 -80.84398984909058 Faculty Dr at Sidewalk to Track
135
- . 35.499620210807194 -80.84352046251297 Entrance to Davidson College Track
136
- . 35.50026001428307 -80.84262996912003 North End of Davidson College Track
137
- . 35.498796974947055 -80.84306180477142 South End of Davidson College Track
138
- . 35.49950229425207 -80.8416536450386 Baker Dr at Wildcat Statue
139
-
140
- . 35.49404300497254 -80.86026549339294 Cornelius YMCA
141
- . 35.494722160763885 -80.86207866668701 Cornelius YMCA "Beach"
142
- . 35.49358659158504 -80.860455930233 Cornelius YMCA Path Base
143
- . 35.49358659158504 -80.860455930233 Cornelius YMCA Path Base
144
-
145
- other_points_of_interest_end
146
-
147
- ===================================================================================================
148
-
149
- track_start Home to St. Albans Main Entrance
150
-
151
- . 35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign
152
- . 35.494097599701725 -80.83323419094086 Caldwell Ln at Twain Ave
153
- . 35.493324534879854 -80.83260118961334 St. Albans Ln at Caldwell Ln
154
- . 35.49246410935417 -80.8334487676620 St. Albans Ln at Concord Rd
155
-
156
- track_end
157
-
158
- ===================================================================================================
159
-
160
- route_start Faulkner Square Park
161
-
162
- track Home to St. Albans Main Entrance
163
- track_rev Home to St. Albans Main Entrance
164
- track_x_2 Home to St. Albans Main Entrance
165
- . 35.49588391877521 -80.83266019821167 Faulkner Sq. Park - NW Corner
166
- . 35.495169832663805 -80.83069682121277 Faulkner Sq. Park - NE Corner
167
- . 35.49501478560521 -80.83078265190125 Faulkner Sq. Park - SE Corner
168
- . 35.4957310568388 -80.83276212215424 Faulkner Sq. Park - SW Corner
169
-
170
- route_end
171
-
data/pkg/code_header.txt DELETED
@@ -1,21 +0,0 @@
1
- =begin
2
-
3
- This file contains the classes and modules for the Gooby project.
4
- Gooby = Google APIs + Ruby
5
-
6
- See file 'tests/ts_gooby.rb' for the regression test suite.
7
-
8
- Gooby - Copyright 2007 by Chris Joakim.
9
- Gooby is available under GNU General Public License (GPL) license.
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'find'
15
- require 'rbconfig'
16
- require 'rexml/document'
17
- require 'rexml/streamlistener'
18
- require 'time'
19
- require 'yaml'
20
-
21
- module Gooby
data/pkg/pkg.rb DELETED
@@ -1,238 +0,0 @@
1
- =begin rdoc
2
-
3
- This class is used to merge/bundle the source code and test code for a ruby
4
- project to enable it to packaged as a "simplified" gem with few *.rb files
5
- and no LOAD_PATH subdirectory dependencies.
6
-
7
- One source code file, 'lib/[project_name].rb' will be created from the
8
- concatinated contents of the 'cls_*.rb' and 'mod_*.rb' files in the
9
- 'lib/[project_name]' directory beneath your project root directory.
10
- The contents of file 'pkg/code_header.txt' will be prepended to this merged
11
- code content.
12
-
13
- Likewise, one source code file, 'tests/ts_[project_name].rb' will be created
14
- from the concatinated contents of the 'tc_*.rb' files in the 'tests'
15
- directory beneath your project root directory. The contents of file
16
- 'pkg/test_header.txt' will be prepended to this merged test content.
17
-
18
- Credit to DHH and others who popularized the concept of "convention over
19
- configuration".
20
-
21
- Command line:
22
- > ruby pkg/pkg.rb [project_name]
23
-
24
- [project_name] is an optional arg, as the current implementation deduces the
25
- project name by identifying the first directory not named 'CVS' beneath the
26
- 'lib' directory.
27
-
28
- Gooby - Copyright 2007 by Chris Joakim.
29
- Gooby is available under GNU General Public License (GPL) license.
30
-
31
- =end
32
-
33
- module Gooby
34
-
35
- class Pkg
36
-
37
- def initialize
38
-
39
- if ARGV.size > 0
40
- @proj_name = ARGV[0]
41
- else
42
- @proj_name = deduce_proj_name
43
- end
44
- puts "project name is: #{@proj_name}"
45
-
46
- @code_lines = IO.readlines('pkg/code_header.txt')
47
- puts "code_header.txt lines = #{@code_lines.size}"
48
- @code_files = code_files_list
49
- puts "code file count: #{@code_files.size}"
50
- @code_files.each do |name|
51
- file_lines = read_file("lib/#{@proj_name}/#{name}")
52
- @code_lines << file_lines
53
- end
54
- @code_lines << "end # end of module"
55
-
56
- @test_lines = IO.readlines('pkg/test_header.txt')
57
- @test_files = test_files_list
58
- puts "test file count: #{@test_files.size}"
59
- @test_files.each do |name|
60
- file_lines = read_file("tests/#{name}")
61
- @test_lines << file_lines
62
- end
63
-
64
- write_file("lib/#{@proj_name}.rb", @code_lines)
65
- write_file("tests/ts_#{@proj_name}.rb", @test_lines)
66
- end
67
-
68
- private
69
-
70
- def deduce_proj_name
71
- list = Dir.glob("lib/*")
72
- list.each do |name|
73
- if name =~ /CVS/
74
- elsif
75
- name =~ /\./
76
- else
77
- name.gsub!('/', ' ')
78
- tokens = name.split
79
- return tokens[-1]
80
- end
81
- end
82
- return 'unable_to_deduce_project_name'
83
- end
84
-
85
- def list_files(dir_name, type)
86
- subset = Array.new
87
- list = Dir.glob(dir_name)
88
- list.each do |name|
89
- matched = false
90
- matched = true if ((type == 'code') && (name =~ /\/cls_/) && (name =~ /.rb$/))
91
- matched = true if ((type == 'code') && (name =~ /\/mod_/) && (name =~ /.rb$/))
92
- matched = true if ((type == 'test') && (name =~ /\/tc_/) && (name =~ /.rb$/))
93
- #puts "#{name} #{matched}"
94
- if matched
95
- name.gsub!('/', ' ')
96
- tokens = name.split
97
- subset << tokens[-1]
98
- end
99
- end
100
- subset
101
- end
102
-
103
- def read_file(filename)
104
- raw_array = IO.readlines(filename)
105
- filtered_array = Array.new
106
- in_zone = false
107
- raw_array.each { |line|
108
- if line =~ /^end # end of module/
109
- in_zone = false
110
- end
111
- if line =~ /^end # end of class/
112
- in_zone = false
113
- end
114
- if in_zone
115
- filtered_array << line
116
- end
117
- if line =~ /^module Gooby/
118
- in_zone = true
119
- end
120
- if line =~ /Test::Unit::TestCase/
121
- filtered_array << "\n"
122
- filtered_array << line
123
- in_zone = true
124
- end
125
-
126
- }
127
- filtered_array
128
- end
129
-
130
- def write_file(name, lines)
131
- out = File.new name, "w+"
132
- out.write "# Packaged on #{Time.now} \n\n"
133
- lines.each { |line| out.write line }
134
- out.flush
135
- out.close
136
- puts "File written: #{name}"
137
- end
138
-
139
- def code_files_list
140
- %w(
141
- mod_project_info.rb
142
- mod_constants.rb
143
- mod_introspect.rb
144
- mod_io.rb
145
- mod_string.rb
146
- mod_test_helper.rb
147
-
148
- cls_gooby_object.rb
149
- cls_counter_hash.rb
150
- cls_delim_line.rb
151
- cls_dttm.rb
152
- cls_duration.rb
153
- cls_forerunner_xml_parser.rb
154
- cls_forerunner_xml_splitter.rb
155
- cls_training_center_parser.rb
156
- cls_training_center_splitter.rb
157
- cls_geo_data.rb
158
- cls_google_map_generator.rb
159
- cls_history.rb
160
- cls_lap.rb
161
- cls_line.rb
162
- cls_options.rb
163
- cls_position.rb
164
- cls_run.rb
165
- cls_simple_xml_parser.rb
166
- cls_test_regen.rb
167
- cls_track.rb
168
- cls_trackpoint.rb
169
- cls_gooby_command.rb
170
- )
171
- end
172
-
173
- def test_files_list
174
-
175
- %w(
176
- tc_mod_constants.rb
177
- tc_mod_introspect.rb
178
- tc_mod_project_info.rb
179
- tc_mod_string.rb
180
- tc_mod_io.rb
181
-
182
- tc_cls_counter_hash.rb
183
- tc_cls_delim_line.rb
184
- tc_cls_dttm.rb
185
-
186
- tc_cls_duration.rb
187
- tc_cls_forerunner_xml_parser.rb
188
- tc_cls_gooby_object.rb
189
-
190
- tc_cls_history.rb
191
- tc_cls_lap.rb
192
- tc_cls_line.rb
193
-
194
- tc_cls_position.rb
195
- tc_cls_run.rb
196
- tc_cls_simple_xml_parser.rb
197
- tc_cls_track.rb
198
- tc_cls_trackpoint.rb
199
- )
200
- end
201
-
202
-
203
- def test_files_list_old
204
-
205
- %w(
206
- tc_mod_constants.rb
207
- tc_mod_introspect.rb
208
-
209
- tc_mod_project_info.rb
210
- tc_mod_string.rb
211
-
212
- tc_cls_counter_hash.rb
213
- tc_cls_delim_line.rb
214
- tc_cls_dttm.rb
215
-
216
- tc_cls_duration.rb
217
- tc_cls_forerunner_xml_parser.rb
218
- tc_cls_gooby_object.rb
219
-
220
- tc_cls_google_map_generator.rb
221
-
222
- tc_cls_history.rb
223
- tc_cls_lap.rb
224
- tc_cls_line.rb
225
-
226
- tc_cls_options.rb
227
- tc_cls_position.rb
228
- tc_cls_run.rb
229
- tc_cls_simple_xml_parser.rb
230
- tc_cls_track.rb
231
- tc_cls_trackpoint.rb
232
- )
233
- end
234
-
235
- end
236
- end
237
-
238
- merger = Gooby::Pkg.new
data/pkg/test_header.txt DELETED
@@ -1,19 +0,0 @@
1
- =begin
2
-
3
- This contains the regression test suite for the Gooby project.
4
-
5
- See file 'lib/gooby.rb' which is the subject of this test suite.
6
-
7
- Gooby - Copyright 2007 by Chris Joakim.
8
- Gooby is available under GNU General Public License (GPL) license.
9
-
10
- =end
11
-
12
- # The following prefixes ../lib to the active ruby load path
13
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
14
- puts '$LOAD_PATH is now:'
15
- puts $LOAD_PATH
16
-
17
- require 'gooby'
18
- require 'test/unit'
19
-