gooby 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. data/README +133 -341
  2. data/config/ballantyne.yaml +11 -0
  3. data/config/big_sur_marathon.yaml +11 -0
  4. data/config/crowders_mtn_hike.yaml +11 -0
  5. data/config/davidson1.yaml +16 -0
  6. data/config/gooby_config.yaml +28 -135
  7. data/cucumber.yml +1 -0
  8. data/features/build_gem.feature +88 -0
  9. data/features/gooby.feature +300 -0
  10. data/features/install.feature +78 -0
  11. data/features/steps/gooby_steps.rb +245 -0
  12. data/features/support/env.rb +4 -0
  13. data/lib/gooby.rb +24 -30
  14. data/lib/gooby_activity.rb +63 -0
  15. data/lib/gooby_base_object.rb +46 -0
  16. data/lib/gooby_base_sax_parser.rb +95 -0
  17. data/lib/gooby_configuration.rb +33 -115
  18. data/lib/gooby_counter_hash.rb +28 -87
  19. data/lib/gooby_dttm.rb +88 -66
  20. data/lib/gooby_environment.rb +48 -0
  21. data/lib/gooby_garmin_tcx_parser.rb +92 -0
  22. data/lib/gooby_google_kml_generator.rb +168 -0
  23. data/lib/gooby_google_map_generator.rb +284 -349
  24. data/lib/gooby_gpx_parser.rb +97 -0
  25. data/lib/gooby_help_producer.rb +40 -0
  26. data/lib/gooby_introspection.rb +25 -0
  27. data/lib/gooby_io.rb +30 -0
  28. data/lib/gooby_lap.rb +27 -18
  29. data/lib/gooby_process.rb +281 -0
  30. data/lib/gooby_sax_path_parser.rb +43 -0
  31. data/lib/gooby_tcx_extractor.rb +71 -0
  32. data/lib/gooby_track_log_parser.rb +114 -0
  33. data/lib/gooby_trackpoint.rb +276 -0
  34. data/lib/gooby_xml_object.rb +40 -0
  35. data/{img/gicons → out/images}/blank.png +0 -0
  36. data/{img/gicons → out/images}/dd-end.png +0 -0
  37. data/{img/gicons → out/images}/dd-start.png +0 -0
  38. data/{img/gicons → out/images}/marker.png +0 -0
  39. data/{img/gicons → out/images}/marker0.png +0 -0
  40. data/{img/gicons → out/images}/marker00.png +0 -0
  41. data/{img/gicons → out/images}/marker01.png +0 -0
  42. data/{img/gicons → out/images}/marker02.png +0 -0
  43. data/{img/gicons → out/images}/marker03.png +0 -0
  44. data/{img/gicons → out/images}/marker04.png +0 -0
  45. data/{img/gicons → out/images}/marker05.png +0 -0
  46. data/{img/gicons → out/images}/marker06.png +0 -0
  47. data/{img/gicons → out/images}/marker07.png +0 -0
  48. data/{img/gicons → out/images}/marker08.png +0 -0
  49. data/{img/gicons → out/images}/marker09.png +0 -0
  50. data/{img/gicons → out/images}/marker1.png +0 -0
  51. data/{img/gicons → out/images}/marker10.png +0 -0
  52. data/{img/gicons → out/images}/marker11.png +0 -0
  53. data/{img/gicons → out/images}/marker12.png +0 -0
  54. data/{img/gicons → out/images}/marker13.png +0 -0
  55. data/{img/gicons → out/images}/marker14.png +0 -0
  56. data/{img/gicons → out/images}/marker15.png +0 -0
  57. data/{img/gicons → out/images}/marker16.png +0 -0
  58. data/{img/gicons → out/images}/marker17.png +0 -0
  59. data/{img/gicons → out/images}/marker18.png +0 -0
  60. data/{img/gicons → out/images}/marker19.png +0 -0
  61. data/{img/gicons → out/images}/marker2.png +0 -0
  62. data/{img/gicons → out/images}/marker20.png +0 -0
  63. data/{img/gicons → out/images}/marker21.png +0 -0
  64. data/{img/gicons → out/images}/marker22.png +0 -0
  65. data/{img/gicons → out/images}/marker23.png +0 -0
  66. data/{img/gicons → out/images}/marker24.png +0 -0
  67. data/{img/gicons → out/images}/marker25.png +0 -0
  68. data/{img/gicons → out/images}/marker26.png +0 -0
  69. data/{img/gicons → out/images}/marker27.png +0 -0
  70. data/{img/gicons → out/images}/marker28.png +0 -0
  71. data/{img/gicons → out/images}/marker29.png +0 -0
  72. data/{img/gicons → out/images}/marker3.png +0 -0
  73. data/{img/gicons → out/images}/marker30.png +0 -0
  74. data/{img/gicons → out/images}/marker31.png +0 -0
  75. data/{img/gicons → out/images}/marker32.png +0 -0
  76. data/{img/gicons → out/images}/marker33.png +0 -0
  77. data/{img/gicons → out/images}/marker34.png +0 -0
  78. data/{img/gicons → out/images}/marker35.png +0 -0
  79. data/{img/gicons → out/images}/marker36.png +0 -0
  80. data/{img/gicons → out/images}/marker37.png +0 -0
  81. data/{img/gicons → out/images}/marker38.png +0 -0
  82. data/{img/gicons → out/images}/marker39.png +0 -0
  83. data/{img/gicons → out/images}/marker4.png +0 -0
  84. data/{img/gicons → out/images}/marker40.png +0 -0
  85. data/{img/gicons → out/images}/marker41.png +0 -0
  86. data/{img/gicons → out/images}/marker42.png +0 -0
  87. data/{img/gicons → out/images}/marker43.png +0 -0
  88. data/{img/gicons → out/images}/marker44.png +0 -0
  89. data/{img/gicons → out/images}/marker45.png +0 -0
  90. data/{img/gicons → out/images}/marker46.png +0 -0
  91. data/{img/gicons → out/images}/marker47.png +0 -0
  92. data/{img/gicons → out/images}/marker48.png +0 -0
  93. data/{img/gicons → out/images}/marker49.png +0 -0
  94. data/{img/gicons → out/images}/marker5.png +0 -0
  95. data/{img/gicons → out/images}/marker50.png +0 -0
  96. data/{img/gicons → out/images}/marker51.png +0 -0
  97. data/{img/gicons → out/images}/marker52.png +0 -0
  98. data/{img/gicons → out/images}/marker53.png +0 -0
  99. data/{img/gicons → out/images}/marker54.png +0 -0
  100. data/{img/gicons → out/images}/marker55.png +0 -0
  101. data/{img/gicons → out/images}/marker56.png +0 -0
  102. data/{img/gicons → out/images}/marker57.png +0 -0
  103. data/{img/gicons → out/images}/marker58.png +0 -0
  104. data/{img/gicons → out/images}/marker59.png +0 -0
  105. data/{img/gicons → out/images}/marker6.png +0 -0
  106. data/{img/gicons → out/images}/marker60.png +0 -0
  107. data/{img/gicons → out/images}/marker61.png +0 -0
  108. data/{img/gicons → out/images}/marker62.png +0 -0
  109. data/{img/gicons → out/images}/marker63.png +0 -0
  110. data/{img/gicons → out/images}/marker64.png +0 -0
  111. data/{img/gicons → out/images}/marker65.png +0 -0
  112. data/{img/gicons → out/images}/marker66.png +0 -0
  113. data/{img/gicons → out/images}/marker67.png +0 -0
  114. data/{img/gicons → out/images}/marker68.png +0 -0
  115. data/{img/gicons → out/images}/marker69.png +0 -0
  116. data/{img/gicons → out/images}/marker7.png +0 -0
  117. data/{img/gicons → out/images}/marker70.png +0 -0
  118. data/{img/gicons → out/images}/marker71.png +0 -0
  119. data/{img/gicons → out/images}/marker72.png +0 -0
  120. data/{img/gicons → out/images}/marker73.png +0 -0
  121. data/{img/gicons → out/images}/marker74.png +0 -0
  122. data/{img/gicons → out/images}/marker75.png +0 -0
  123. data/{img/gicons → out/images}/marker76.png +0 -0
  124. data/{img/gicons → out/images}/marker77.png +0 -0
  125. data/{img/gicons → out/images}/marker78.png +0 -0
  126. data/{img/gicons → out/images}/marker79.png +0 -0
  127. data/{img/gicons → out/images}/marker8.png +0 -0
  128. data/{img/gicons → out/images}/marker80.png +0 -0
  129. data/{img/gicons → out/images}/marker81.png +0 -0
  130. data/{img/gicons → out/images}/marker82.png +0 -0
  131. data/{img/gicons → out/images}/marker83.png +0 -0
  132. data/{img/gicons → out/images}/marker84.png +0 -0
  133. data/{img/gicons → out/images}/marker85.png +0 -0
  134. data/{img/gicons → out/images}/marker86.png +0 -0
  135. data/{img/gicons → out/images}/marker87.png +0 -0
  136. data/{img/gicons → out/images}/marker88.png +0 -0
  137. data/{img/gicons → out/images}/marker89.png +0 -0
  138. data/{img/gicons → out/images}/marker9.png +0 -0
  139. data/{img/gicons → out/images}/marker90.png +0 -0
  140. data/{img/gicons → out/images}/marker91.png +0 -0
  141. data/{img/gicons → out/images}/marker92.png +0 -0
  142. data/{img/gicons → out/images}/marker93.png +0 -0
  143. data/{img/gicons → out/images}/marker94.png +0 -0
  144. data/{img/gicons → out/images}/marker95.png +0 -0
  145. data/{img/gicons → out/images}/marker96.png +0 -0
  146. data/{img/gicons → out/images}/marker97.png +0 -0
  147. data/{img/gicons → out/images}/marker98.png +0 -0
  148. data/{img/gicons → out/images}/marker99.png +0 -0
  149. data/{img/gicons → out/images}/markerA.png +0 -0
  150. data/{img/gicons → out/images}/markerB.png +0 -0
  151. data/{img/gicons → out/images}/markerC.png +0 -0
  152. data/{img/gicons → out/images}/markerD.png +0 -0
  153. data/{img/gicons → out/images}/markerE.png +0 -0
  154. data/{img/gicons → out/images}/markerF.png +0 -0
  155. data/{img/gicons → out/images}/markerG.png +0 -0
  156. data/{img/gicons → out/images}/markerH.png +0 -0
  157. data/{img/gicons → out/images}/markerI.png +0 -0
  158. data/{img/gicons → out/images}/markerJ.png +0 -0
  159. data/{img/gicons → out/images}/mm_20_red.png +0 -0
  160. data/{img/gicons → out/images}/mm_20_shadow.png +0 -0
  161. data/{img/gicons → out/images}/shadow50.png +0 -0
  162. data/rakefile.rb +79 -0
  163. data/samples.sh +21 -0
  164. data/samples/2008_04_27_13_49_50_tcx.csv +2449 -0
  165. data/samples/2008_04_27_13_49_50_tcx.xml +24560 -0
  166. data/samples/2009_01_01_14_45_00_tcx.xml +10630 -0
  167. data/samples/ballantyne.csv +27 -0
  168. data/samples/ballantyne.gpx +117 -0
  169. data/samples/ballantyne.kml +91 -0
  170. data/samples/big_sur_marathon.html +2766 -0
  171. data/samples/big_sur_marathon.kml +685 -0
  172. data/samples/build_gem_test_results.txt +6 -0
  173. data/samples/crowders_mtn_hike.csv +1065 -0
  174. data/samples/crowders_mtn_hike.html +1283 -0
  175. data/samples/crowders_mtn_hike.log +1 -0
  176. data/samples/cucumber_test_results.txt +302 -0
  177. data/samples/davidson1.csv +1 -0
  178. data/samples/davidson1.html +75 -0
  179. data/samples/davidson_1_point_tcx.csv +0 -0
  180. data/samples/doc.kml +49 -0
  181. data/samples/gps_track_log_asheville_mt_pisgah.txt +1 -0
  182. data/samples/gps_track_logs.txt +1 -0
  183. data/samples/install_test_results.txt +81 -0
  184. data/samples/mt_pisgah.txt +1 -0
  185. data/samples/rspec_test_results.txt +5 -0
  186. data/setup.rb +66 -0
  187. data/spec/gooby_base_object_spec.rb +116 -0
  188. data/spec/gooby_counter_hash_spec.rb +34 -0
  189. data/spec/gooby_dttm_spec.rb +40 -0
  190. data/spec/gooby_spec_helper.rb +9 -0
  191. data/spec/gooby_xml_object_spec.rb +32 -0
  192. metadata +225 -226
  193. data/bin/code_scan.rb +0 -16
  194. data/bin/gooby_been_there.rb +0 -33
  195. data/bin/gooby_config.rb +0 -24
  196. data/bin/gooby_csv_validation.rb +0 -50
  197. data/bin/gooby_first_trackpoints_as_poi.rb +0 -31
  198. data/bin/gooby_gen_gmap.rb +0 -20
  199. data/bin/gooby_parser.rb +0 -21
  200. data/bin/gooby_splitter.rb +0 -21
  201. data/bin/gooby_version.rb +0 -20
  202. data/bin/run_all.sh +0 -33
  203. data/bin/run_been_there.sh +0 -19
  204. data/bin/run_config.sh +0 -12
  205. data/bin/run_csv_validation.sh +0 -15
  206. data/bin/run_db_gen.sh +0 -11
  207. data/bin/run_db_load.sh +0 -11
  208. data/bin/run_first_trackpoints_as_poi.sh +0 -16
  209. data/bin/run_gen_gmaps.sh +0 -21
  210. data/bin/run_parse_full.sh +0 -45
  211. data/bin/run_parse_samples.sh +0 -21
  212. data/bin/run_split.sh +0 -24
  213. data/bin/run_version.sh +0 -12
  214. data/data/20050305_corporate_cup_hm.csv +0 -251
  215. data/data/20050305_corporate_cup_hm.xml +0 -2208
  216. data/data/20050430_nashville_marathon.xml +0 -10043
  217. data/data/20050430_nashville_marathon_km.csv +0 -1208
  218. data/data/20060115_phoenix_marathon.csv +0 -1280
  219. data/data/20060115_phoenix_marathon.xml +0 -10620
  220. data/data/20070101_davidson_11m.csv +0 -251
  221. data/data/20070101_davidson_11m.xml +0 -2020
  222. data/data/20070505_davidson_5k.xml +0 -2875
  223. data/data/20070505_davidson_5k_km.csv +0 -286
  224. data/data/hrm1.csv +0 -5
  225. data/img/gicons/readme.txt +0 -14
  226. data/lib/gooby_code_scanner.rb +0 -288
  227. data/lib/gooby_command.rb +0 -210
  228. data/lib/gooby_course.rb +0 -117
  229. data/lib/gooby_csv_point.rb +0 -71
  230. data/lib/gooby_csv_reader.rb +0 -71
  231. data/lib/gooby_csv_run.rb +0 -28
  232. data/lib/gooby_delim_line.rb +0 -42
  233. data/lib/gooby_duration.rb +0 -86
  234. data/lib/gooby_forerunner_xml_parser.rb +0 -191
  235. data/lib/gooby_forerunner_xml_splitter.rb +0 -115
  236. data/lib/gooby_history.rb +0 -41
  237. data/lib/gooby_kernel.rb +0 -163
  238. data/lib/gooby_line.rb +0 -80
  239. data/lib/gooby_object.rb +0 -22
  240. data/lib/gooby_point.rb +0 -172
  241. data/lib/gooby_run.rb +0 -213
  242. data/lib/gooby_simple_xml_parser.rb +0 -50
  243. data/lib/gooby_test_helper.rb +0 -23
  244. data/lib/gooby_track.rb +0 -47
  245. data/lib/gooby_track_point.rb +0 -229
  246. data/lib/gooby_training_center_xml_parser.rb +0 -224
  247. data/lib/gooby_training_center_xml_splitter.rb +0 -116
  248. data/lib/split_code.sh +0 -29
  249. data/samples/20050305_corporate_cup_hm.html +0 -450
  250. data/samples/20050430_nashville_marathon.html +0 -1668
  251. data/samples/20060115_phoenix_marathon.html +0 -1596
  252. data/samples/20070101_davidson_11m.html +0 -432
  253. data/samples/20070505_davidson_5k.html +0 -413
  254. data/samples/been_there.txt +0 -92
  255. data/samples/hrm1.html +0 -87
  256. data/sql/gooby.ddl +0 -60
  257. data/sql/gooby_load.dml +0 -62
@@ -0,0 +1 @@
1
+ Format: DDD M/D/Y H:M:S -5.00 hrs Datum[116]: WGS 84
@@ -0,0 +1,5 @@
1
+ .......................
2
+
3
+ Finished in 0.014408 seconds
4
+
5
+ 23 examples, 0 failures
@@ -0,0 +1,66 @@
1
+ =begin
2
+
3
+ Gooby = Google APIs + Ruby. Copyright 2009 by Chris Joakim.
4
+ Gooby is available under GNU General Public License (GPL) license.
5
+
6
+ =end
7
+
8
+ require 'fileutils'
9
+
10
+ class GoobySetup
11
+
12
+ def initialize
13
+ @test = false
14
+ ARGV.each { | arg | @test = true if arg == 'test' }
15
+
16
+ if gooby_home
17
+ puts "Your GOOBY_HOME is: #{gooby_home}"
18
+ FileUtils.mkdir_p(gooby_home)
19
+ dirs = []
20
+ dirs << 'config'
21
+ dirs << 'csv'
22
+ dirs << 'data'
23
+ dirs << 'features'
24
+ dirs << 'features/steps'
25
+ dirs << 'features/support'
26
+ dirs << 'out'
27
+ dirs << 'out/images'
28
+ dirs << 'samples'
29
+ dirs << 'splits'
30
+ dirs << 'tmp'
31
+ dirs.each { | dir |
32
+ filename = "#{gooby_home}/#{dir}"
33
+ puts "creating #{filename}"
34
+ FileUtils.mkdir_p(filename)
35
+ }
36
+ FileUtils.cp 'README', "#{gooby_home}"
37
+ FileUtils.cp 'cucumber.yml', "#{gooby_home}"
38
+ FileUtils.cp 'rakefile.rb', "#{gooby_home}"
39
+ FileUtils.cp 'setup.rb', "#{gooby_home}"
40
+ FileUtils.cp 'samples.sh', "#{gooby_home}"
41
+ FileUtils.cp_r 'config/.', "#{gooby_home}/config"
42
+ FileUtils.cp 'samples/2008_04_27_13_49_50_tcx.csv', "#{gooby_home}/csv"
43
+ FileUtils.cp_r 'features/.', "#{gooby_home}/features"
44
+ FileUtils.cp_r 'features/steps/.', "#{gooby_home}/features/steps"
45
+ FileUtils.cp_r 'features/support/.', "#{gooby_home}/features/support"
46
+ FileUtils.cp_r 'out/images/.', "#{gooby_home}/out/images"
47
+ FileUtils.cp_r 'samples/.', "#{gooby_home}/data"
48
+ FileUtils.cp_r 'samples/.', "#{gooby_home}/samples"
49
+ else
50
+ puts "ERROR: The required GOOBY_HOME environment variable has not yet been defined."
51
+ puts "The GOOBY_HOME variable must be set to the directory filename where you will"
52
+ puts "store your Gooby-related files, and where Gooby will generate content."
53
+ puts "Suggested values are 'C:\\gooby' on Windows, and '~/gooby' on unix-based systems."
54
+ puts "Please define the GOOBY_HOME environment varible, then rerun setup.rb."
55
+ end
56
+ end
57
+
58
+ def gooby_home
59
+ (@test) ? ENV['GOOBY_TEST'] : ENV['GOOBY_HOME']
60
+ end
61
+
62
+ end
63
+
64
+ # For developer testing of setup.rb: ruby setup.rb test
65
+
66
+ GoobySetup.new
@@ -0,0 +1,116 @@
1
+ require 'spec/gooby_spec_helper.rb'
2
+
3
+ # Modules GoobyEnvironment, GoobyIntrospection, and GoobyIO are included
4
+ # in class GoobyBaseObject, and are therefore tested here. The constants
5
+ # defined in GoobyBaseObject will be tested in specs for the classes where
6
+ # the constants are used.
7
+
8
+ describe "Class GoobyBaseObject" do
9
+
10
+ before(:each) do
11
+ @base_obj = GoobyBaseObject.new
12
+ end
13
+
14
+ # GoobyEnvironment
15
+
16
+ it "should be implement 'array_param'" do # array_param(name, default=[])
17
+ ENV['csv_value'] = 'pump,it,up'
18
+ array = @base_obj.array_param('csv_value')
19
+ array.size.should == 3
20
+ array[2].should == 'up'
21
+ end
22
+
23
+ it "should be implement 'boolean_param'" do # boolean_param(name, default=false)
24
+ ENV['t1'] = 'truE'
25
+ ENV['t2'] = 'T'
26
+ ENV['f1'] = 'False'
27
+ ENV['f2'] = 'f'
28
+ @base_obj.boolean_param(nil).should == false
29
+ @base_obj.boolean_param('not_there').should == false
30
+ @base_obj.boolean_param('not_there', true).should == true
31
+ @base_obj.boolean_param('t1').should == true
32
+ @base_obj.boolean_param('t2').should == true
33
+ @base_obj.boolean_param('f1').should == false
34
+ @base_obj.boolean_param('f2').should == false
35
+ end
36
+
37
+ it "should be implement 'command_line_arg'" do # command_line_arg(arg_name, default_value=nil)
38
+ ENV['f'] = 'splits/some_file.xml'
39
+ @base_obj.command_line_arg('f').should == 'splits/some_file.xml'
40
+ @base_obj.command_line_arg('oops', 'splits/default.xml').should == 'splits/default.xml'
41
+ end
42
+
43
+ it "should be implement 'float_param'" do # float_param(name, default=0.0)
44
+ ENV['d'] = '26.2'
45
+ value1 = @base_obj.float_param('d')
46
+ value2 = @base_obj.float_param('oops', 11.0)
47
+ value3 = @base_obj.float_param('oops', '11.0')
48
+ value1.should be_close(26.2, 0.005)
49
+ value2.should be_close(11.0, 0.005)
50
+ value3.should be_close(11.0, 0.005)
51
+ end
52
+
53
+ it "should be implement 'integer_param'" do # integer_param(name, default=0)
54
+ ENV['c'] = '16'
55
+ value1 = @base_obj.integer_param('c')
56
+ value2 = @base_obj.integer_param('oops', 17)
57
+ value3 = @base_obj.integer_param('oops', '17')
58
+ value1.should == 16
59
+ value2.should == 17
60
+ value3.should == 17
61
+ end
62
+
63
+ it "should be implement 'string_param'" do # string_param(name, default='')
64
+ ENV['s'] = '16'
65
+ value1 = @base_obj.string_param('s')
66
+ value2 = @base_obj.string_param('oops', 17)
67
+ value3 = @base_obj.string_param('oops', '17')
68
+ value1.should == '16'
69
+ value2.should == '17'
70
+ value3.should == '17'
71
+ end
72
+
73
+ # GoobyIntrospection
74
+
75
+ it "should be implement instance method 'classname'" do
76
+ @base_obj.classname.should == 'GoobyBaseObject'
77
+ end
78
+
79
+ it "should be implement class method 'classname'" do
80
+ GoobyBaseObject.classname.should == 'GoobyBaseObject'
81
+ end
82
+
83
+ # GoobyIO
84
+
85
+ it "should be implement 'read_file_as_lines'" do # read_file_as_lines(filename)
86
+ lines = @base_obj.read_file_as_lines(__FILE__)
87
+ lines.size.should > 40
88
+ line_found = false
89
+ lines.each { | line | line_found = true if line.strip == '# GoobyIO' }
90
+ line_found.should == true
91
+ end
92
+
93
+ it "should be implement 'write_file'" do # write_file(out_name, content, mode='w+')
94
+ now = Time.now.to_f
95
+ filename = "tmp/test_#{now}.txt"
96
+ @base_obj.write_file(filename, "This is a test file\ncreated at time #{now}")
97
+ lines = @base_obj.read_file_as_lines(filename)
98
+ lines.size.should == 2
99
+ line_found = false
100
+ lines.each { | line | line_found = true if line.strip == "created at time #{now}" }
101
+ line_found.should == true
102
+ end
103
+
104
+ it "should be implement 'write_lines'" do # write_lines(out_name, lines)
105
+ now = Time.now.to_f
106
+ filename = "tmp/test_#{now}.txt"
107
+ array = ["This is a test file", "created at time #{now}", "from an array"]
108
+ @base_obj.write_lines(filename, array)
109
+ lines = @base_obj.read_file_as_lines(filename)
110
+ lines.size.should == 3
111
+ line_found = false
112
+ lines.each { | line | line_found = true if line.strip == "created at time #{now}" }
113
+ line_found.should == true
114
+ end
115
+
116
+ end
@@ -0,0 +1,34 @@
1
+ require 'spec/gooby_spec_helper.rb'
2
+
3
+ describe "Class GoobyCounterHash" do
4
+
5
+ before(:each) do
6
+ @hash = GoobyCounterHash.new
7
+ end
8
+
9
+ it "should increment" do
10
+ @hash.value('a').should == 0
11
+ @hash.increment('a')
12
+ @hash.increment('a')
13
+ @hash.value('a').should == 2
14
+ end
15
+
16
+ it "should decrement" do
17
+ @hash.value('a').should == 0
18
+ @hash.decrement('a')
19
+ @hash.decrement('a')
20
+ @hash.value('a').should == -2
21
+ end
22
+
23
+ it "should return its sorted keys" do
24
+ @hash.increment('z')
25
+ @hash.increment('a')
26
+ @hash.decrement('q')
27
+ @hash.decrement('x')
28
+ keys = @hash.sorted_keys
29
+ keys.size.should == 4
30
+ keys[0].should == 'a'
31
+ keys[3].should == 'z'
32
+ end
33
+
34
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec/gooby_spec_helper.rb'
2
+
3
+ describe "Class GoobyDtTm" do
4
+
5
+ it "should parse a date into several formats" do
6
+ dt = GoobyDtTm.new('2008-04-27T13:49:05Z')
7
+ dt.yyyy_mm_dd.should == '2008-04-27'
8
+ dt.hh_mm_ss.should == '13:49:05'
9
+ dt.yyyy_mm_dd_hh_mm_ss.should == '2008-04-27 13:49:05'
10
+ end
11
+
12
+ it "should implement to_i" do
13
+ dt1 = GoobyDtTm.new('2008-04-27T13:49:05Z')
14
+ dt1.to_i.should == 1209304145
15
+ end
16
+
17
+ it "should implement seconds_diff" do
18
+ dt1 = GoobyDtTm.new('2008-04-27T13:49:05Z')
19
+ dt2 = GoobyDtTm.new('2008-04-27T14:51:08Z')
20
+ dt1.seconds_diff(dt1).should == 0
21
+ dt2.seconds_diff(dt1).should == 3723
22
+ dt1.seconds_diff(dt2).should == -3723
23
+ end
24
+
25
+ it "should implement hhmmss_diff" do
26
+ dt1 = GoobyDtTm.new('2008-04-27T13:49:05Z')
27
+ dt2 = GoobyDtTm.new('2008-04-27T14:51:08Z')
28
+ dt1.hhmmss_diff(dt1).should == '0:00:00'
29
+ dt1.hhmmss_diff(dt2).should == '1:02:03'
30
+ dt2.hhmmss_diff(dt1).should == '1:02:03'
31
+ end
32
+
33
+ it "should lookup a month name" do
34
+ dt = GoobyDtTm.new('2008-04-27T13:49:05Z')
35
+ dt.lookup_month('01').should == 'jan'
36
+ dt.lookup_month('12').should == 'dec'
37
+ dt.lookup_month('13').should == ''
38
+ end
39
+
40
+ end
@@ -0,0 +1,9 @@
1
+
2
+ require 'spec'
3
+
4
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
5
+
6
+ # puts "load path:"
7
+ #$:.each_with_index { | path, index | puts "load path: #{index} #{path}" }
8
+
9
+ require 'gooby.rb'
@@ -0,0 +1,32 @@
1
+ require 'spec/gooby_spec_helper.rb'
2
+
3
+ describe "Class GoobyXmlObject" do
4
+
5
+ before(:each) do
6
+ @xo = GoobyXmlObject.new
7
+ end
8
+
9
+ it "should set and get" do
10
+ @xo.set('lat', '36.538656')
11
+ @xo.get('lat').should == '36.538656'
12
+ end
13
+
14
+ it "should add and list" do
15
+ @xo.add('a')
16
+ @xo.add('b')
17
+ @xo.add('c')
18
+ @xo.list.size.should == 3
19
+ @xo.list[2].should == 'c'
20
+ end
21
+
22
+ it "should id" do
23
+ @xo.set('Id', '123')
24
+ @xo.id.should == '123'
25
+ end
26
+
27
+ it "should sequence" do
28
+ @xo.set('Seq', 555)
29
+ @xo.sequence.should == '555'
30
+ end
31
+
32
+ end
metadata CHANGED
@@ -1,246 +1,245 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: gooby
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.2.0
7
- date: 2007-07-22 00:00:00 -04:00
8
- summary: Google APIs + Ruby = Gooby
9
- require_paths:
10
- - lib
11
- email: chris@joakim-systems.com
12
- homepage: http://rubyforge.org/projects/gooby/
13
- rubyforge_project: gooby
14
- description:
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.8.4
24
- version:
4
+ version: 2.0.0
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Chris Joakim
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-22 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: chris@joakim-systems.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
31
24
  files:
32
- - bin/code_scan.rb
33
- - bin/gooby_been_there.rb
34
- - bin/gooby_config.rb
35
- - bin/gooby_csv_validation.rb
36
- - bin/gooby_first_trackpoints_as_poi.rb
37
- - bin/gooby_gen_gmap.rb
38
- - bin/gooby_parser.rb
39
- - bin/gooby_splitter.rb
40
- - bin/gooby_version.rb
41
- - bin/run_all.sh
42
- - bin/run_been_there.sh
43
- - bin/run_config.sh
44
- - bin/run_csv_validation.sh
45
- - bin/run_db_gen.sh
46
- - bin/run_db_load.sh
47
- - bin/run_first_trackpoints_as_poi.sh
48
- - bin/run_gen_gmaps.sh
49
- - bin/run_parse_full.sh
50
- - bin/run_parse_samples.sh
51
- - bin/run_split.sh
52
- - bin/run_version.sh
25
+ - config/ballantyne.yaml
26
+ - config/big_sur_marathon.yaml
27
+ - config/crowders_mtn_hike.yaml
28
+ - config/davidson1.yaml
53
29
  - config/gooby_config.yaml
54
- - data/20050305_corporate_cup_hm.csv
55
- - data/20050305_corporate_cup_hm.xml
56
- - data/20050430_nashville_marathon.xml
57
- - data/20050430_nashville_marathon_km.csv
58
- - data/20060115_phoenix_marathon.csv
59
- - data/20060115_phoenix_marathon.xml
60
- - data/20070101_davidson_11m.csv
61
- - data/20070101_davidson_11m.xml
62
- - data/20070505_davidson_5k.xml
63
- - data/20070505_davidson_5k_km.csv
64
- - data/hrm1.csv
65
- - img/gicons
66
- - img/gicons/blank.png
67
- - img/gicons/dd-end.png
68
- - img/gicons/dd-start.png
69
- - img/gicons/marker.png
70
- - img/gicons/marker0.png
71
- - img/gicons/marker00.png
72
- - img/gicons/marker01.png
73
- - img/gicons/marker02.png
74
- - img/gicons/marker03.png
75
- - img/gicons/marker04.png
76
- - img/gicons/marker05.png
77
- - img/gicons/marker06.png
78
- - img/gicons/marker07.png
79
- - img/gicons/marker08.png
80
- - img/gicons/marker09.png
81
- - img/gicons/marker1.png
82
- - img/gicons/marker10.png
83
- - img/gicons/marker11.png
84
- - img/gicons/marker12.png
85
- - img/gicons/marker13.png
86
- - img/gicons/marker14.png
87
- - img/gicons/marker15.png
88
- - img/gicons/marker16.png
89
- - img/gicons/marker17.png
90
- - img/gicons/marker18.png
91
- - img/gicons/marker19.png
92
- - img/gicons/marker2.png
93
- - img/gicons/marker20.png
94
- - img/gicons/marker21.png
95
- - img/gicons/marker22.png
96
- - img/gicons/marker23.png
97
- - img/gicons/marker24.png
98
- - img/gicons/marker25.png
99
- - img/gicons/marker26.png
100
- - img/gicons/marker27.png
101
- - img/gicons/marker28.png
102
- - img/gicons/marker29.png
103
- - img/gicons/marker3.png
104
- - img/gicons/marker30.png
105
- - img/gicons/marker31.png
106
- - img/gicons/marker32.png
107
- - img/gicons/marker33.png
108
- - img/gicons/marker34.png
109
- - img/gicons/marker35.png
110
- - img/gicons/marker36.png
111
- - img/gicons/marker37.png
112
- - img/gicons/marker38.png
113
- - img/gicons/marker39.png
114
- - img/gicons/marker4.png
115
- - img/gicons/marker40.png
116
- - img/gicons/marker41.png
117
- - img/gicons/marker42.png
118
- - img/gicons/marker43.png
119
- - img/gicons/marker44.png
120
- - img/gicons/marker45.png
121
- - img/gicons/marker46.png
122
- - img/gicons/marker47.png
123
- - img/gicons/marker48.png
124
- - img/gicons/marker49.png
125
- - img/gicons/marker5.png
126
- - img/gicons/marker50.png
127
- - img/gicons/marker51.png
128
- - img/gicons/marker52.png
129
- - img/gicons/marker53.png
130
- - img/gicons/marker54.png
131
- - img/gicons/marker55.png
132
- - img/gicons/marker56.png
133
- - img/gicons/marker57.png
134
- - img/gicons/marker58.png
135
- - img/gicons/marker59.png
136
- - img/gicons/marker6.png
137
- - img/gicons/marker60.png
138
- - img/gicons/marker61.png
139
- - img/gicons/marker62.png
140
- - img/gicons/marker63.png
141
- - img/gicons/marker64.png
142
- - img/gicons/marker65.png
143
- - img/gicons/marker66.png
144
- - img/gicons/marker67.png
145
- - img/gicons/marker68.png
146
- - img/gicons/marker69.png
147
- - img/gicons/marker7.png
148
- - img/gicons/marker70.png
149
- - img/gicons/marker71.png
150
- - img/gicons/marker72.png
151
- - img/gicons/marker73.png
152
- - img/gicons/marker74.png
153
- - img/gicons/marker75.png
154
- - img/gicons/marker76.png
155
- - img/gicons/marker77.png
156
- - img/gicons/marker78.png
157
- - img/gicons/marker79.png
158
- - img/gicons/marker8.png
159
- - img/gicons/marker80.png
160
- - img/gicons/marker81.png
161
- - img/gicons/marker82.png
162
- - img/gicons/marker83.png
163
- - img/gicons/marker84.png
164
- - img/gicons/marker85.png
165
- - img/gicons/marker86.png
166
- - img/gicons/marker87.png
167
- - img/gicons/marker88.png
168
- - img/gicons/marker89.png
169
- - img/gicons/marker9.png
170
- - img/gicons/marker90.png
171
- - img/gicons/marker91.png
172
- - img/gicons/marker92.png
173
- - img/gicons/marker93.png
174
- - img/gicons/marker94.png
175
- - img/gicons/marker95.png
176
- - img/gicons/marker96.png
177
- - img/gicons/marker97.png
178
- - img/gicons/marker98.png
179
- - img/gicons/marker99.png
180
- - img/gicons/markerA.png
181
- - img/gicons/markerB.png
182
- - img/gicons/markerC.png
183
- - img/gicons/markerD.png
184
- - img/gicons/markerE.png
185
- - img/gicons/markerF.png
186
- - img/gicons/markerG.png
187
- - img/gicons/markerH.png
188
- - img/gicons/markerI.png
189
- - img/gicons/markerJ.png
190
- - img/gicons/mm_20_red.png
191
- - img/gicons/mm_20_shadow.png
192
- - img/gicons/readme.txt
193
- - img/gicons/shadow50.png
30
+ - features/build_gem.feature
31
+ - features/gooby.feature
32
+ - features/install.feature
33
+ - features/steps
34
+ - features/support
35
+ - features/steps/gooby_steps.rb
36
+ - features/support/env.rb
194
37
  - lib/gooby.rb
195
- - lib/gooby_code_scanner.rb
196
- - lib/gooby_command.rb
38
+ - lib/gooby_activity.rb
39
+ - lib/gooby_base_object.rb
40
+ - lib/gooby_base_sax_parser.rb
197
41
  - lib/gooby_configuration.rb
198
42
  - lib/gooby_counter_hash.rb
199
- - lib/gooby_course.rb
200
- - lib/gooby_csv_point.rb
201
- - lib/gooby_csv_reader.rb
202
- - lib/gooby_csv_run.rb
203
- - lib/gooby_delim_line.rb
204
43
  - lib/gooby_dttm.rb
205
- - lib/gooby_duration.rb
206
- - lib/gooby_forerunner_xml_parser.rb
207
- - lib/gooby_forerunner_xml_splitter.rb
44
+ - lib/gooby_environment.rb
45
+ - lib/gooby_garmin_tcx_parser.rb
46
+ - lib/gooby_google_kml_generator.rb
208
47
  - lib/gooby_google_map_generator.rb
209
- - lib/gooby_history.rb
210
- - lib/gooby_kernel.rb
48
+ - lib/gooby_gpx_parser.rb
49
+ - lib/gooby_help_producer.rb
50
+ - lib/gooby_introspection.rb
51
+ - lib/gooby_io.rb
211
52
  - lib/gooby_lap.rb
212
- - lib/gooby_line.rb
213
- - lib/gooby_object.rb
214
- - lib/gooby_point.rb
215
- - lib/gooby_run.rb
216
- - lib/gooby_simple_xml_parser.rb
217
- - lib/gooby_test_helper.rb
218
- - lib/gooby_track.rb
219
- - lib/gooby_track_point.rb
220
- - lib/gooby_training_center_xml_parser.rb
221
- - lib/gooby_training_center_xml_splitter.rb
222
- - lib/split_code.sh
223
- - samples/20050305_corporate_cup_hm.html
224
- - samples/20050430_nashville_marathon.html
225
- - samples/20060115_phoenix_marathon.html
226
- - samples/20070101_davidson_11m.html
227
- - samples/20070505_davidson_5k.html
228
- - samples/been_there.txt
229
- - samples/hrm1.html
230
- - sql/gooby.ddl
231
- - sql/gooby_load.dml
53
+ - lib/gooby_process.rb
54
+ - lib/gooby_sax_path_parser.rb
55
+ - lib/gooby_tcx_extractor.rb
56
+ - lib/gooby_track_log_parser.rb
57
+ - lib/gooby_trackpoint.rb
58
+ - lib/gooby_xml_object.rb
59
+ - out/images/blank.png
60
+ - out/images/dd-end.png
61
+ - out/images/dd-start.png
62
+ - out/images/marker.png
63
+ - out/images/marker0.png
64
+ - out/images/marker00.png
65
+ - out/images/marker01.png
66
+ - out/images/marker02.png
67
+ - out/images/marker03.png
68
+ - out/images/marker04.png
69
+ - out/images/marker05.png
70
+ - out/images/marker06.png
71
+ - out/images/marker07.png
72
+ - out/images/marker08.png
73
+ - out/images/marker09.png
74
+ - out/images/marker1.png
75
+ - out/images/marker10.png
76
+ - out/images/marker11.png
77
+ - out/images/marker12.png
78
+ - out/images/marker13.png
79
+ - out/images/marker14.png
80
+ - out/images/marker15.png
81
+ - out/images/marker16.png
82
+ - out/images/marker17.png
83
+ - out/images/marker18.png
84
+ - out/images/marker19.png
85
+ - out/images/marker2.png
86
+ - out/images/marker20.png
87
+ - out/images/marker21.png
88
+ - out/images/marker22.png
89
+ - out/images/marker23.png
90
+ - out/images/marker24.png
91
+ - out/images/marker25.png
92
+ - out/images/marker26.png
93
+ - out/images/marker27.png
94
+ - out/images/marker28.png
95
+ - out/images/marker29.png
96
+ - out/images/marker3.png
97
+ - out/images/marker30.png
98
+ - out/images/marker31.png
99
+ - out/images/marker32.png
100
+ - out/images/marker33.png
101
+ - out/images/marker34.png
102
+ - out/images/marker35.png
103
+ - out/images/marker36.png
104
+ - out/images/marker37.png
105
+ - out/images/marker38.png
106
+ - out/images/marker39.png
107
+ - out/images/marker4.png
108
+ - out/images/marker40.png
109
+ - out/images/marker41.png
110
+ - out/images/marker42.png
111
+ - out/images/marker43.png
112
+ - out/images/marker44.png
113
+ - out/images/marker45.png
114
+ - out/images/marker46.png
115
+ - out/images/marker47.png
116
+ - out/images/marker48.png
117
+ - out/images/marker49.png
118
+ - out/images/marker5.png
119
+ - out/images/marker50.png
120
+ - out/images/marker51.png
121
+ - out/images/marker52.png
122
+ - out/images/marker53.png
123
+ - out/images/marker54.png
124
+ - out/images/marker55.png
125
+ - out/images/marker56.png
126
+ - out/images/marker57.png
127
+ - out/images/marker58.png
128
+ - out/images/marker59.png
129
+ - out/images/marker6.png
130
+ - out/images/marker60.png
131
+ - out/images/marker61.png
132
+ - out/images/marker62.png
133
+ - out/images/marker63.png
134
+ - out/images/marker64.png
135
+ - out/images/marker65.png
136
+ - out/images/marker66.png
137
+ - out/images/marker67.png
138
+ - out/images/marker68.png
139
+ - out/images/marker69.png
140
+ - out/images/marker7.png
141
+ - out/images/marker70.png
142
+ - out/images/marker71.png
143
+ - out/images/marker72.png
144
+ - out/images/marker73.png
145
+ - out/images/marker74.png
146
+ - out/images/marker75.png
147
+ - out/images/marker76.png
148
+ - out/images/marker77.png
149
+ - out/images/marker78.png
150
+ - out/images/marker79.png
151
+ - out/images/marker8.png
152
+ - out/images/marker80.png
153
+ - out/images/marker81.png
154
+ - out/images/marker82.png
155
+ - out/images/marker83.png
156
+ - out/images/marker84.png
157
+ - out/images/marker85.png
158
+ - out/images/marker86.png
159
+ - out/images/marker87.png
160
+ - out/images/marker88.png
161
+ - out/images/marker89.png
162
+ - out/images/marker9.png
163
+ - out/images/marker90.png
164
+ - out/images/marker91.png
165
+ - out/images/marker92.png
166
+ - out/images/marker93.png
167
+ - out/images/marker94.png
168
+ - out/images/marker95.png
169
+ - out/images/marker96.png
170
+ - out/images/marker97.png
171
+ - out/images/marker98.png
172
+ - out/images/marker99.png
173
+ - out/images/markerA.png
174
+ - out/images/markerB.png
175
+ - out/images/markerC.png
176
+ - out/images/markerD.png
177
+ - out/images/markerE.png
178
+ - out/images/markerF.png
179
+ - out/images/markerG.png
180
+ - out/images/markerH.png
181
+ - out/images/markerI.png
182
+ - out/images/markerJ.png
183
+ - out/images/mm_20_red.png
184
+ - out/images/mm_20_shadow.png
185
+ - out/images/shadow50.png
186
+ - samples/2008_04_27_13_49_50_tcx.csv
187
+ - samples/2008_04_27_13_49_50_tcx.xml
188
+ - samples/2009_01_01_14_45_00_tcx.xml
189
+ - samples/ballantyne.csv
190
+ - samples/ballantyne.gpx
191
+ - samples/ballantyne.kml
192
+ - samples/big_sur_marathon.html
193
+ - samples/big_sur_marathon.kml
194
+ - samples/build_gem_test_results.txt
195
+ - samples/crowders_mtn_hike.csv
196
+ - samples/crowders_mtn_hike.html
197
+ - samples/crowders_mtn_hike.log
198
+ - samples/cucumber_test_results.txt
199
+ - samples/davidson1.csv
200
+ - samples/davidson1.html
201
+ - samples/davidson_1_point_tcx.csv
202
+ - samples/doc.kml
203
+ - samples/gps_track_log_asheville_mt_pisgah.txt
204
+ - samples/gps_track_logs.txt
205
+ - samples/install_test_results.txt
206
+ - samples/mt_pisgah.txt
207
+ - samples/rspec_test_results.txt
208
+ - spec/gooby_base_object_spec.rb
209
+ - spec/gooby_counter_hash_spec.rb
210
+ - spec/gooby_dttm_spec.rb
211
+ - spec/gooby_spec_helper.rb
212
+ - spec/gooby_xml_object_spec.rb
213
+ - cucumber.yml
214
+ - rakefile.rb
215
+ - setup.rb
216
+ - samples.sh
232
217
  - README
233
- test_files: []
234
-
218
+ has_rdoc: true
219
+ homepage: http://rubyforge.org/projects/gooby/
220
+ post_install_message:
235
221
  rdoc_options: []
236
222
 
237
- extra_rdoc_files:
238
- - README
239
- executables: []
240
-
241
- extensions: []
242
-
223
+ require_paths:
224
+ - lib
225
+ required_ruby_version: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: 1.8.4
230
+ version:
231
+ required_rubygems_version: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: "0"
236
+ version:
243
237
  requirements: []
244
238
 
245
- dependencies: []
239
+ rubyforge_project: gooby
240
+ rubygems_version: 1.3.1
241
+ signing_key:
242
+ specification_version: 2
243
+ summary: Google APIs + Ruby = Gooby
244
+ test_files: []
246
245