yellow-brick-road 0.1.1

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 (233) hide show
  1. data/README.rst +148 -0
  2. data/Rakefile +37 -0
  3. data/lib/tasks/yellow-brick-road_tasks.rake +4 -0
  4. data/lib/yellow-brick-road.rb +6 -0
  5. data/lib/yellow-brick-road/config.rb +15 -0
  6. data/lib/yellow-brick-road/directive_processor.rb +68 -0
  7. data/lib/yellow-brick-road/engine.rb +22 -0
  8. data/lib/yellow-brick-road/soy_processor.rb +56 -0
  9. data/lib/yellow-brick-road/utils.rb +38 -0
  10. data/lib/yellow-brick-road/version.rb +3 -0
  11. data/test/dummy/Rakefile +7 -0
  12. data/test/dummy/app/assets/javascripts/application.js +12 -0
  13. data/test/dummy/app/assets/javascripts/closure-deps.js +4 -0
  14. data/test/dummy/app/assets/javascripts/my-closure/simple.js.soy +14 -0
  15. data/test/dummy/app/assets/javascripts/my-closure/start.js +25 -0
  16. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  17. data/test/dummy/app/controllers/application_controller.rb +7 -0
  18. data/test/dummy/app/helpers/application_helper.rb +2 -0
  19. data/test/dummy/app/views/application/index.html.erb +0 -0
  20. data/test/dummy/app/views/layouts/application.html.erb +18 -0
  21. data/test/dummy/config.ru +4 -0
  22. data/test/dummy/config/application.rb +51 -0
  23. data/test/dummy/config/boot.rb +10 -0
  24. data/test/dummy/config/environment.rb +5 -0
  25. data/test/dummy/config/environments/development.rb +30 -0
  26. data/test/dummy/config/environments/production.rb +60 -0
  27. data/test/dummy/config/environments/test.rb +39 -0
  28. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  29. data/test/dummy/config/initializers/inflections.rb +10 -0
  30. data/test/dummy/config/initializers/mime_types.rb +5 -0
  31. data/test/dummy/config/initializers/secret_token.rb +7 -0
  32. data/test/dummy/config/initializers/session_store.rb +8 -0
  33. data/test/dummy/config/initializers/wrap_parameters.rb +10 -0
  34. data/test/dummy/config/initializers/yellow_brick_road.rb +2 -0
  35. data/test/dummy/config/locales/en.yml +5 -0
  36. data/test/dummy/config/routes.rb +58 -0
  37. data/test/dummy/log/development.log +13924 -0
  38. data/test/dummy/log/test.log +0 -0
  39. data/test/dummy/public/404.html +26 -0
  40. data/test/dummy/public/422.html +26 -0
  41. data/test/dummy/public/500.html +26 -0
  42. data/test/dummy/public/favicon.ico +0 -0
  43. data/test/dummy/script/rails +6 -0
  44. data/test/dummy/tmp/cache/assets/BE0/120/sprockets%2F751842b8c6750008c7310d182600d173 +142 -0
  45. data/test/dummy/tmp/cache/assets/C19/950/sprockets%2F142437f1d8d9424007b4a882a5429333 +1372 -0
  46. data/test/dummy/tmp/cache/assets/C4B/D00/sprockets%2F400f22c081529179ce3d079457de3009 +806 -0
  47. data/test/dummy/tmp/cache/assets/C5A/EE0/sprockets%2Fb711429ed948c503b718d077037780f8 +0 -0
  48. data/test/dummy/tmp/cache/assets/C5B/A80/sprockets%2F508569b474262724c61a461f7777dab7 +1118 -0
  49. data/test/dummy/tmp/cache/assets/C6C/660/sprockets%2F2c298b3b02232a21527680685a3efc30 +9289 -0
  50. data/test/dummy/tmp/cache/assets/C72/8A0/sprockets%2F167b265129e30d87d253c406db305c60 +293 -0
  51. data/test/dummy/tmp/cache/assets/C7E/9F0/sprockets%2F89862076204c62c4593ac20de32da909 +9 -0
  52. data/test/dummy/tmp/cache/assets/C8B/5F0/sprockets%2Fc6a4470b5c21e285e829a99365839b24 +0 -0
  53. data/test/dummy/tmp/cache/assets/C92/D20/sprockets%2F2e618f7805f445889aec94885a500f03 +457 -0
  54. data/test/dummy/tmp/cache/assets/C98/FD0/sprockets%2Fb11442af041f96e87a43a1dc11231745 +283 -0
  55. data/test/dummy/tmp/cache/assets/CA3/520/sprockets%2F5379d7143c6c52b11b88dc0ab5436133 +277 -0
  56. data/test/dummy/tmp/cache/assets/CA5/450/sprockets%2F6bb727c9312a749134ad67323a317f0d +73 -0
  57. data/test/dummy/tmp/cache/assets/CA5/4F0/sprockets%2Feeb7de7771527700af194c0441d29101 +709 -0
  58. data/test/dummy/tmp/cache/assets/CA6/E90/sprockets%2F611f68180f43c4181f06ae5c5f8201e2 +1546 -0
  59. data/test/dummy/tmp/cache/assets/CA7/310/sprockets%2F45664cf816315200b574e029fde6f10a +0 -0
  60. data/test/dummy/tmp/cache/assets/CA9/9D0/sprockets%2F2672e32464cf7267c4ba3d028f54b153 +224 -0
  61. data/test/dummy/tmp/cache/assets/CAB/5A0/sprockets%2F7f50e0289f150c8636ac9253129bc13c +2556 -0
  62. data/test/dummy/tmp/cache/assets/CB5/7E0/sprockets%2F42ff6672683b2029233a800e7539eeee +474 -0
  63. data/test/dummy/tmp/cache/assets/CB6/DC0/sprockets%2F2f9882155bb2d4d3ab5d708951857c60 +494 -0
  64. data/test/dummy/tmp/cache/assets/CBB/680/sprockets%2F1dc336d96fb52df34b458185559922b5 +1018 -0
  65. data/test/dummy/tmp/cache/assets/CBC/640/sprockets%2F67d2e0d9e5129d237e575d2780c64b47 +1260 -0
  66. data/test/dummy/tmp/cache/assets/CBE/550/sprockets%2Fd680cac830e0b3408ba910f0b0421147 +25 -0
  67. data/test/dummy/tmp/cache/assets/CC7/790/sprockets%2F69941f32a12e4f99d4a57f65386d870d +608 -0
  68. data/test/dummy/tmp/cache/assets/CCB/F80/sprockets%2Fa865701ef2ec41155e524772c31a1a2b +1088 -0
  69. data/test/dummy/tmp/cache/assets/CCE/580/sprockets%2F879411ed27ed1c557d57853d8f579b56 +0 -0
  70. data/test/dummy/tmp/cache/assets/CD0/070/sprockets%2F6748fe8481965f260d9c56b7f9f508a2 +1530 -0
  71. data/test/dummy/tmp/cache/assets/CD4/750/sprockets%2Faf3505141ecb3169ce41ce519d136924 +0 -0
  72. data/test/dummy/tmp/cache/assets/CD6/A90/sprockets%2F3f55ac75b9fb8426312116bcb940a580 +2539 -0
  73. data/test/dummy/tmp/cache/assets/CD9/6C0/sprockets%2F5e2458bc52da90ba349a66035e3b6752 +0 -0
  74. data/test/dummy/tmp/cache/assets/CD9/F50/sprockets%2F9008bf696500cfae1d61f045f209181e +256 -0
  75. data/test/dummy/tmp/cache/assets/CDB/B40/sprockets%2F53529a22c994570a0df4742c0bfe61f4 +0 -0
  76. data/test/dummy/tmp/cache/assets/CDC/D10/sprockets%2F1e775b4ff06b4401c07503ce95a839b5 +75 -0
  77. data/test/dummy/tmp/cache/assets/CDE/CD0/sprockets%2F141066798b4acf07053f7e3a6cb4e555 +1613 -0
  78. data/test/dummy/tmp/cache/assets/CE1/760/sprockets%2F245fe11803630fe30d0cf8a869886ab5 +357 -0
  79. data/test/dummy/tmp/cache/assets/CE1/FA0/sprockets%2F863d1650ef066e4a2168bc57c7c0e096 +0 -0
  80. data/test/dummy/tmp/cache/assets/CE2/310/sprockets%2Fd38075d5592ecaf82e43526c03b467c4 +1545 -0
  81. data/test/dummy/tmp/cache/assets/CE2/420/sprockets%2F30f2e8f30477e80cf6416dfe27307c07 +204 -0
  82. data/test/dummy/tmp/cache/assets/CE2/D70/sprockets%2F467c44b63644e0f44dd06a585f36f1a6 +522 -0
  83. data/test/dummy/tmp/cache/assets/CE3/670/sprockets%2Fddd11860b444cd0f9996be0c46762318 +796 -0
  84. data/test/dummy/tmp/cache/assets/CE4/0B0/sprockets%2Ff11535d785c0d34349c64d673bd4b28f +1105 -0
  85. data/test/dummy/tmp/cache/assets/CE4/590/sprockets%2Fd68edcc87a4ae302794093081b45b819 +10 -0
  86. data/test/dummy/tmp/cache/assets/CE4/D60/sprockets%2F61772e4a60b616f74da91b838a2f4f82 +0 -0
  87. data/test/dummy/tmp/cache/assets/CE6/DD0/sprockets%2F2fe073024a2bf26bd98458388b57af37 +1355 -0
  88. data/test/dummy/tmp/cache/assets/CE7/160/sprockets%2Fba1f9939f031b4356ec1869d40fc2747 +1261 -0
  89. data/test/dummy/tmp/cache/assets/CE8/C70/sprockets%2Fc6c9ba3c677b5e2af8520395192c9445 +173 -0
  90. data/test/dummy/tmp/cache/assets/CEA/8B0/sprockets%2Ff77e549cb6d37604105f35d4e67d8c21 +511 -0
  91. data/test/dummy/tmp/cache/assets/CEA/AA0/sprockets%2F5f816982c86d2e6b72b2f5f65c51d070 +1529 -0
  92. data/test/dummy/tmp/cache/assets/CEA/C10/sprockets%2F9dcd541e67c299ab076a44a2183872f8 +0 -0
  93. data/test/dummy/tmp/cache/assets/CF1/5A0/sprockets%2F1a697695edf2bb7b49a2896904218bc7 +115 -0
  94. data/test/dummy/tmp/cache/assets/CF4/480/sprockets%2F5e99c77e93f4a522c84357e62b25e0f7 +43 -0
  95. data/test/dummy/tmp/cache/assets/CF7/460/sprockets%2Fd12ea9733fe3c92456f57f9145569b9c +0 -0
  96. data/test/dummy/tmp/cache/assets/CF7/470/sprockets%2F2897897a166ca3369fecb88f83f211b5 +435 -0
  97. data/test/dummy/tmp/cache/assets/CFA/760/sprockets%2Fa9024adba14091e0635c6874d1db4e22 +0 -0
  98. data/test/dummy/tmp/cache/assets/D01/F30/sprockets%2Fe639a15b6e0cca37d12443b408e1166f +25 -0
  99. data/test/dummy/tmp/cache/assets/D02/9F0/sprockets%2Fb99eae308897fe88cb9414b96824098b +0 -0
  100. data/test/dummy/tmp/cache/assets/D03/330/sprockets%2F1e003cdb3e7dcc9307e84090ad457127 +454 -0
  101. data/test/dummy/tmp/cache/assets/D03/8B0/sprockets%2Ff74632bddf2c0b2018ca7b736309380e +365 -0
  102. data/test/dummy/tmp/cache/assets/D05/0A0/sprockets%2Fe57658220260db13eb5577aef42cb61b +257 -0
  103. data/test/dummy/tmp/cache/assets/D05/920/sprockets%2F909507434dcc270db4853e4c147f0aac +31 -0
  104. data/test/dummy/tmp/cache/assets/D08/510/sprockets%2Fa567be6cb6d7310096f1739b25a5a3f0 +50 -0
  105. data/test/dummy/tmp/cache/assets/D08/9F0/sprockets%2F1d61d2c89ca50957066bacc5b69011f5 +1424 -0
  106. data/test/dummy/tmp/cache/assets/D0A/790/sprockets%2Feb16913e6504c9b0d3be431de39e4751 +300 -0
  107. data/test/dummy/tmp/cache/assets/D0C/C50/sprockets%2Fd6613bee8b40d50459af6b52a7084f34 +796 -0
  108. data/test/dummy/tmp/cache/assets/D0D/030/sprockets%2Fba3f13b4a444679e8bc2549226ec743b +21 -0
  109. data/test/dummy/tmp/cache/assets/D0D/350/sprockets%2F2670bce036d485e15d059c0f1e98f24a +207 -0
  110. data/test/dummy/tmp/cache/assets/D13/270/sprockets%2F497cb163e6317e3fc1565d832f406cfb +348 -0
  111. data/test/dummy/tmp/cache/assets/D13/380/sprockets%2F786d003c9c7fb759dd26c1030c087cf6 +813 -0
  112. data/test/dummy/tmp/cache/assets/D13/7C0/sprockets%2F528d22310a9ab8e6fba08d82844ce795 +0 -0
  113. data/test/dummy/tmp/cache/assets/D15/F60/sprockets%2Fa28394e3f80365b5bc86794dd46daa22 +0 -0
  114. data/test/dummy/tmp/cache/assets/D18/500/sprockets%2Fd22c2d97d1db2154f2f7592906e957ea +1001 -0
  115. data/test/dummy/tmp/cache/assets/D1B/C70/sprockets%2F1c04848b1e1d6e8e33b8581f8c8128ff +223 -0
  116. data/test/dummy/tmp/cache/assets/D1C/600/sprockets%2Fa0601f99147f59ddd6266e6aff077e14 +0 -0
  117. data/test/dummy/tmp/cache/assets/D1E/470/sprockets%2Fb3933e694547b78bf6fb15f44a4623fe +53 -0
  118. data/test/dummy/tmp/cache/assets/D1F/480/sprockets%2F545164168becf42b289efc8708f1db68 +1278 -0
  119. data/test/dummy/tmp/cache/assets/D21/630/sprockets%2F0a14114729c14637f2e8f122acabd1ab +823 -0
  120. data/test/dummy/tmp/cache/assets/D24/A90/sprockets%2F21c8a0d48c51b8585ba03bc112ecd153 +692 -0
  121. data/test/dummy/tmp/cache/assets/D25/D30/sprockets%2F3b937f4c16d2aa0a28fc02a0e922712b +1441 -0
  122. data/test/dummy/tmp/cache/assets/D25/F30/sprockets%2Fe251527c0c018f4b4ad44b2ad7064fb0 +2255 -0
  123. data/test/dummy/tmp/cache/assets/D26/DE0/sprockets%2F761ac1bdb0739cc56fa0c1224b137b09 +0 -0
  124. data/test/dummy/tmp/cache/assets/D2A/C30/sprockets%2F978fe7268754f451c59b9ccb323ffa56 +0 -0
  125. data/test/dummy/tmp/cache/assets/D2B/0F0/sprockets%2Fbf223af03335cfc08a71e549e10c0e27 +2539 -0
  126. data/test/dummy/tmp/cache/assets/D2E/6D0/sprockets%2F9e7fda3affb389313cc50223f01c0324 +0 -0
  127. data/test/dummy/tmp/cache/assets/D2F/110/sprockets%2F3730ffe2ed34c1219d580bd1615ea7b0 +2239 -0
  128. data/test/dummy/tmp/cache/assets/D2F/F10/sprockets%2F9cac242f0bf5ec00079ea3a463e26552 +153 -0
  129. data/test/dummy/tmp/cache/assets/D30/1D0/sprockets%2Fd690a26a0b0ae138c1c48d257a7674bc +589 -0
  130. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  131. data/test/dummy/tmp/cache/assets/D36/940/sprockets%2Fb4ba462ac9f4aac561c36e60367c1378 +572 -0
  132. data/test/dummy/tmp/cache/assets/D37/090/sprockets%2F2f2e71ebbc240014ebf648f0917e854a +798 -0
  133. data/test/dummy/tmp/cache/assets/D3A/440/sprockets%2F6d332243647c841dea36ed822cdfc23e +165 -0
  134. data/test/dummy/tmp/cache/assets/D3B/5A0/sprockets%2F82e05cf8c88ba8cb1c87e50d51372a03 +0 -0
  135. data/test/dummy/tmp/cache/assets/D41/B30/sprockets%2Fba1b93913dd01d83ac9a96df334456f8 +0 -0
  136. data/test/dummy/tmp/cache/assets/D43/D90/sprockets%2F04f3a5926d5a7672456dc7afa73d0c7f +38 -0
  137. data/test/dummy/tmp/cache/assets/D45/1F0/sprockets%2F1bfa855d9c10ff2431a9a548958cc5e4 +83 -0
  138. data/test/dummy/tmp/cache/assets/D45/B10/sprockets%2F643f3d9b216e48df952b7f150a46a7ec +60 -0
  139. data/test/dummy/tmp/cache/assets/D46/040/sprockets%2F199546844e5939721a5afcbcce4ea43a +143 -0
  140. data/test/dummy/tmp/cache/assets/D49/320/sprockets%2Fd8123eb229e34c9f507f7b1876f1c4ee +506 -0
  141. data/test/dummy/tmp/cache/assets/D49/750/sprockets%2Ff41ef1c0832b7294fb15588ff5c783cb +0 -0
  142. data/test/dummy/tmp/cache/assets/D49/930/sprockets%2F1071926698fa55abc71e1b6fd966dfe1 +72 -0
  143. data/test/dummy/tmp/cache/assets/D49/D10/sprockets%2Fb67b8d7cc7579352a91694f9ae10cdb0 +127 -0
  144. data/test/dummy/tmp/cache/assets/D4A/160/sprockets%2Fcbd8988b5e18d153eff6230d72e9046a +516 -0
  145. data/test/dummy/tmp/cache/assets/D4A/2B0/sprockets%2Ffcdf002d38fd938bf7226b46b76706c8 +1101 -0
  146. data/test/dummy/tmp/cache/assets/D4E/2F0/sprockets%2F77cb87ae57f0d8c25cdaa74181a64997 +1441 -0
  147. data/test/dummy/tmp/cache/assets/D4F/060/sprockets%2Fa9e66b39ada7394a29bf44f3a682f665 +511 -0
  148. data/test/dummy/tmp/cache/assets/D50/BD0/sprockets%2F88650dd57ef64075462e6dae757dbe2c +0 -0
  149. data/test/dummy/tmp/cache/assets/D53/CA0/sprockets%2Fa85032e82709a043fbb2ec00e04f2bbd +0 -0
  150. data/test/dummy/tmp/cache/assets/D54/BF0/sprockets%2F91970514ff528e8d2bfd81f1ec83c9c8 +240 -0
  151. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +10 -0
  152. data/test/dummy/tmp/cache/assets/D56/500/sprockets%2F75ebadd035f1324b194034af92eac3a0 +0 -0
  153. data/test/dummy/tmp/cache/assets/D5A/900/sprockets%2F5729f77d97fdee53b1942cf17f6f05e4 +474 -0
  154. data/test/dummy/tmp/cache/assets/D5A/D50/sprockets%2F81bace3db2c2f1241175ff3c5009d08c +0 -0
  155. data/test/dummy/tmp/cache/assets/D5B/C70/sprockets%2Fe64119a9db7017b7ab3b0da1b6076f0d +44 -0
  156. data/test/dummy/tmp/cache/assets/D5E/4D0/sprockets%2F756f25e4ad861a050cdc41bb8414e4ab +126 -0
  157. data/test/dummy/tmp/cache/assets/D5E/730/sprockets%2Fd30caf70b387c4604326bdda32aeb549 +0 -0
  158. data/test/dummy/tmp/cache/assets/D5E/AA0/sprockets%2F790dd07caaaacb30ceb0174664e90817 +136 -0
  159. data/test/dummy/tmp/cache/assets/D64/D30/sprockets%2Fe4bd8f60a3a446274c3cb2f5d16563ac +590 -0
  160. data/test/dummy/tmp/cache/assets/D66/400/sprockets%2Fecb7401d20daf25605a7afad3a793778 +0 -0
  161. data/test/dummy/tmp/cache/assets/D67/250/sprockets%2F8422eb26855ca9c953a3bf1aeade8004 +0 -0
  162. data/test/dummy/tmp/cache/assets/D69/900/sprockets%2F28ae64f52cb18f77b1a1bd9c51293da4 +0 -0
  163. data/test/dummy/tmp/cache/assets/D6A/870/sprockets%2F1ece6a51b42f9280f4cee9020c94b72e +197 -0
  164. data/test/dummy/tmp/cache/assets/D6B/DD0/sprockets%2F9a0abc735e27fc61dab019788518eba4 +164 -0
  165. data/test/dummy/tmp/cache/assets/D6E/CC0/sprockets%2F8b4fbcec2475e7203b8859baf8e310a3 +0 -0
  166. data/test/dummy/tmp/cache/assets/D72/470/sprockets%2Fbc0c6d850e7c769e83d58eb3e6061b2a +2556 -0
  167. data/test/dummy/tmp/cache/assets/D72/9D0/sprockets%2F9402daf6da6f7eed331a9d78216cb761 +0 -0
  168. data/test/dummy/tmp/cache/assets/D74/070/sprockets%2F91ae68f698a39bd7d0d11150fc46e4cd +418 -0
  169. data/test/dummy/tmp/cache/assets/D74/7F0/sprockets%2F22dad1069ea6a8f29ae757c44e18ec83 +0 -0
  170. data/test/dummy/tmp/cache/assets/D75/3C0/sprockets%2F44e2ae51b97853d8ecda7b264a267c7d +1630 -0
  171. data/test/dummy/tmp/cache/assets/D77/780/sprockets%2Ffa2abdfb0b62867c346f79187b8e42d5 +823 -0
  172. data/test/dummy/tmp/cache/assets/D79/850/sprockets%2F4d540586ed379fd9a70fa0b7ce4f5b27 +306 -0
  173. data/test/dummy/tmp/cache/assets/D7A/B60/sprockets%2F5925c92f48caff053d08853dc69e5bba +0 -0
  174. data/test/dummy/tmp/cache/assets/D81/C90/sprockets%2F19aca5c835efce74878c23e581e2a89e +2239 -0
  175. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +11228 -0
  176. data/test/dummy/tmp/cache/assets/D8B/B10/sprockets%2Fbb7a2305a8f2832631863bbababb67be +301 -0
  177. data/test/dummy/tmp/cache/assets/D92/3B0/sprockets%2F93dc71f411faf72ec8ef0b5d217b51a0 +505 -0
  178. data/test/dummy/tmp/cache/assets/D92/EE0/sprockets%2Ffd051ea0abf6be6970754aa732e40c8b +289 -0
  179. data/test/dummy/tmp/cache/assets/D93/810/sprockets%2F7dc1ac5e1b83ba5144e34cf156d48a8a +471 -0
  180. data/test/dummy/tmp/cache/assets/D94/020/sprockets%2F35cb4ce22488fb5bdd260508ca47a3fb +239 -0
  181. data/test/dummy/tmp/cache/assets/D94/EC0/sprockets%2F8b900fba18f8e046f5f12e6d1f0ac15b +74 -0
  182. data/test/dummy/tmp/cache/assets/D95/470/sprockets%2F5be5d361a52575c433831b5e8cccbace +9273 -0
  183. data/test/dummy/tmp/cache/assets/D97/9D0/sprockets%2F524a2a94a88c1d392dabcba654e365fc +103 -0
  184. data/test/dummy/tmp/cache/assets/D9D/800/sprockets%2Ff8387220eb4dda9b29a37b5deb9f2a40 +54 -0
  185. data/test/dummy/tmp/cache/assets/D9E/DD0/sprockets%2Fb6b4ffad6485eda046b327a196e8c44a +0 -0
  186. data/test/dummy/tmp/cache/assets/DA1/0A0/sprockets%2F359c94aee6ba2e15fc9666aa4de311c8 +166 -0
  187. data/test/dummy/tmp/cache/assets/DA1/0D0/sprockets%2F798de3c28452e164a7fc1a3a6e8cdb4b +652 -0
  188. data/test/dummy/tmp/cache/assets/DA3/CB0/sprockets%2Fdfad6bb1857a8af91f98ba137c18504e +815 -0
  189. data/test/dummy/tmp/cache/assets/DA4/E10/sprockets%2Fbda7705734ace95f12a7d79df9c14af2 +1354 -0
  190. data/test/dummy/tmp/cache/assets/DA5/E30/sprockets%2F2e6707a119e94a784efbadca18d7e8d1 +129 -0
  191. data/test/dummy/tmp/cache/assets/DA6/4B0/sprockets%2F4f7a708b6aa2d42eb577493dea7cef55 +115 -0
  192. data/test/dummy/tmp/cache/assets/DA8/A10/sprockets%2F0ae5bbb4ca200e74db3b64d72c2be120 +0 -0
  193. data/test/dummy/tmp/cache/assets/DA9/3F0/sprockets%2Fdd0af9cfd65fb7d02fe778c8f6015361 +499 -0
  194. data/test/dummy/tmp/cache/assets/DA9/780/sprockets%2Fe3559a635e8f92dec7727a3db2ae7b4c +813 -0
  195. data/test/dummy/tmp/cache/assets/DAC/0E0/sprockets%2F04cef8243a9ef7321846debc977ea8db +607 -0
  196. data/test/dummy/tmp/cache/assets/DB1/260/sprockets%2Fb879ff7530bf8cc175e0c7e70dc4e79b +0 -0
  197. data/test/dummy/tmp/cache/assets/DB4/4C0/sprockets%2F30a76cbd98dedb56742cd8ecaf858757 +0 -0
  198. data/test/dummy/tmp/cache/assets/DBD/7E0/sprockets%2F236fb1ac5ed9f2e3fe32203acc3a842d +0 -0
  199. data/test/dummy/tmp/cache/assets/DC2/DF0/sprockets%2Fe233bcaba8beff15626c35cb5e0e0936 +845 -0
  200. data/test/dummy/tmp/cache/assets/DC4/600/sprockets%2F59c96aa6c1cbebc61bff6c050a5351d7 +225 -0
  201. data/test/dummy/tmp/cache/assets/DC5/030/sprockets%2Fcb2fe864a0177eec19017c43ce9aa4ad +187 -0
  202. data/test/dummy/tmp/cache/assets/DC8/A60/sprockets%2F9fcb9f5c3f679ce749ee4c3f93869ba6 +74 -0
  203. data/test/dummy/tmp/cache/assets/DCB/D40/sprockets%2Ffd5542bfb7660a8d8cac3a2e46fb01f8 +828 -0
  204. data/test/dummy/tmp/cache/assets/DCC/020/sprockets%2F0c129c5f2784c96fa1dc3da6c19c1efc +128 -0
  205. data/test/dummy/tmp/cache/assets/DCF/520/sprockets%2F975162fb97a3ec7033db5f2fdba4fcd3 +70 -0
  206. data/test/dummy/tmp/cache/assets/DD0/000/sprockets%2F0d5d631cce6f0b078bb29cf98b3d78bb +276 -0
  207. data/test/dummy/tmp/cache/assets/DD0/C90/sprockets%2F84eeca4ef8f5eb29b13f7e1ea3c71324 +591 -0
  208. data/test/dummy/tmp/cache/assets/DD6/710/sprockets%2F9e83f2ebbe3e349efca2de390e15d635 +204 -0
  209. data/test/dummy/tmp/cache/assets/DE1/830/sprockets%2Fd23d3cafef2e2a9055bc103dffc1a023 +208 -0
  210. data/test/dummy/tmp/cache/assets/DEB/470/sprockets%2Fae2de0fcbc2214b71d3f2a875d2bc8c3 +2255 -0
  211. data/test/dummy/tmp/cache/assets/DEE/690/sprockets%2F5d824bcadef29060cc13eed71af4b4d0 +550 -0
  212. data/test/dummy/tmp/cache/assets/DF0/5D0/sprockets%2F25a875eb0a5d4c49bcc3fa39ea0adb26 +567 -0
  213. data/test/dummy/tmp/cache/assets/DF3/E20/sprockets%2Fada770c49a5d6b38d1cc43ed4d51c1fc +0 -0
  214. data/test/dummy/tmp/cache/assets/DF5/C80/sprockets%2F03ad7d7b3a8feba9ed9be82ae2083b20 +340 -0
  215. data/test/dummy/tmp/cache/assets/DF6/560/sprockets%2Fafceb2b55eb108efe4446dfb02b519b8 +0 -0
  216. data/test/dummy/tmp/cache/assets/DFC/030/sprockets%2Fcbdd3679eaba219b4e1ff20677af1c6f +1371 -0
  217. data/test/dummy/tmp/cache/assets/E00/970/sprockets%2F8bc6dde8d05c382dd07cbcec70f54e09 +378 -0
  218. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  219. data/test/dummy/tmp/cache/assets/E12/2F0/sprockets%2F5c45062ecfbe512dcba176ba6ddacc00 +523 -0
  220. data/test/dummy/tmp/cache/assets/E21/5D0/sprockets%2Fd4fe6d611bfb0e63c04de5dbfb128a8a +0 -0
  221. data/test/dummy/tmp/cache/assets/E22/770/sprockets%2F2ccebcabfbb9b59159e4b73b3b30a74d +208 -0
  222. data/test/dummy/tmp/cache/assets/E31/A90/sprockets%2F26b98bbbc15eee9b370c7dcde88d16aa +394 -0
  223. data/test/dummy/tmp/cache/assets/E31/E30/sprockets%2Ffbdafcc4e2f44bb9fc653bcf9625b750 +284 -0
  224. data/test/dummy/tmp/cache/assets/E37/1C0/sprockets%2Fa5eb45fc86dafe2bee4e4fa3f53c4785 +0 -0
  225. data/test/dummy/tmp/cache/assets/E4C/960/sprockets%2F13fd6e4bfdf031acb3dedca8d0f407b4 +1277 -0
  226. data/test/dummy/tmp/cache/assets/E88/330/sprockets%2Fe02d0adb5529ffafcea1b9e5ccf69a5b +669 -0
  227. data/test/dummy/tmp/pids/server.pid +1 -0
  228. data/test/dummy/tmp/simple.js.js +20 -0
  229. data/test/dummy/tmp/soy-1325274421.js +20 -0
  230. data/test/dummy/tmp/soy-1325286267.js +20 -0
  231. data/test/test_helper.rb +10 -0
  232. data/test/yellow-brick-road_test.rb +7 -0
  233. metadata +538 -0
@@ -0,0 +1,357 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325441615.5607092: @value{I"
2
+ class:EFI"BundledAsset;
3
+ FI"id;
4
+ F"%78a28b2cc81bc1215c8e54f5af6e1f65I"logical_path;
5
+ FI"closure/goog/json/json.js;
6
+ TI"
7
+ F"k/Volumes/Development/dev-web/yellow-brick-road/vendor/assets/closure-library/closure/goog/json/json.jsI"content_type;
8
+ FI"application/javascript;
9
+ FI"
10
+ mtime;
11
+ FI"2011-12-30T02:16:24+00:00;
12
+ FI" body;
13
+ FI"�'// Copyright 2006 The Closure Library Authors. All Rights Reserved.
14
+ //
15
+ // Licensed under the Apache License, Version 2.0 (the "License");
16
+ // you may not use this file except in compliance with the License.
17
+ // You may obtain a copy of the License at
18
+ //
19
+ // http://www.apache.org/licenses/LICENSE-2.0
20
+ //
21
+ // Unless required by applicable law or agreed to in writing, software
22
+ // distributed under the License is distributed on an "AS-IS" BASIS,
23
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ // See the License for the specific language governing permissions and
25
+ // limitations under the License.
26
+
27
+ /**
28
+ * @fileoverview JSON utility functions.
29
+ * @author arv@google.com (Erik Arvidsson)
30
+ */
31
+
32
+
33
+
34
+ goog.provide('goog.json');
35
+ goog.provide('goog.json.Serializer');
36
+
37
+
38
+ /**
39
+ * Tests if a string is an invalid JSON string. This only ensures that we are
40
+ * not using any invalid characters
41
+ * @param {string} s The string to test.
42
+ * @return {boolean} True if the input is a valid JSON string.
43
+ * @private
44
+ */
45
+ goog.json.isValid_ = function(s) {
46
+ // All empty whitespace is not valid.
47
+ if (/^\s*$/.test(s)) {
48
+ return false;
49
+ }
50
+
51
+ // This is taken from http://www.json.org/json2.js which is released to the
52
+ // public domain.
53
+ // Changes: We dissallow \u2028 Line separator and \u2029 Paragraph separator
54
+ // inside strings. We also treat \u2028 and \u2029 as whitespace which they
55
+ // are in the RFC but IE and Safari does not match \s to these so we need to
56
+ // include them in the reg exps in all places where whitespace is allowed.
57
+ // We allowed \x7f inside strings because some tools don't escape it,
58
+ // e.g. http://www.json.org/java/org/json/JSONObject.java
59
+
60
+ // Parsing happens in three stages. In the first stage, we run the text
61
+ // against regular expressions that look for non-JSON patterns. We are
62
+ // especially concerned with '()' and 'new' because they can cause invocation,
63
+ // and '=' because it can cause mutation. But just to be safe, we want to
64
+ // reject all unexpected forms.
65
+
66
+ // We split the first stage into 4 regexp operations in order to work around
67
+ // crippling inefficiencies in IE's and Safari's regexp engines. First we
68
+ // replace all backslash pairs with '@' (a non-JSON character). Second, we
69
+ // replace all simple value tokens with ']' characters. Third, we delete all
70
+ // open brackets that follow a colon or comma or that begin the text. Finally,
71
+ // we look to see that the remaining characters are only whitespace or ']' or
72
+ // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
73
+
74
+ // Don't make these static since they have the global flag.
75
+ var backslashesRe = /\\["\\\/bfnrtu]/g;
76
+ var simpleValuesRe =
77
+ /"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
78
+ var openBracketsRe = /(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g;
79
+ var remainderRe = /^[\],:{}\s\u2028\u2029]*$/;
80
+
81
+ return remainderRe.test(s.replace(backslashesRe, '@').
82
+ replace(simpleValuesRe, ']').
83
+ replace(openBracketsRe, ''));
84
+ };
85
+
86
+
87
+ /**
88
+ * Parses a JSON string and returns the result. This throws an exception if
89
+ * the string is an invalid JSON string.
90
+ *
91
+ * Note that this is very slow on large strings. If you trust the source of
92
+ * the string then you should use unsafeParse instead.
93
+ *
94
+ * @param {*} s The JSON string to parse.
95
+ * @return {Object} The object generated from the JSON string.
96
+ */
97
+ goog.json.parse = function(s) {
98
+ var o = String(s);
99
+ if (goog.json.isValid_(o)) {
100
+ /** @preserveTry */
101
+ try {
102
+ return /** @type {Object} */ (eval('(' + o + ')'));
103
+ } catch (ex) {
104
+ }
105
+ }
106
+ throw Error('Invalid JSON string: ' + o);
107
+ };
108
+
109
+
110
+ /**
111
+ * Parses a JSON string and returns the result. This uses eval so it is open
112
+ * to security issues and it should only be used if you trust the source.
113
+ *
114
+ * @param {string} s The JSON string to parse.
115
+ * @return {Object} The object generated from the JSON string.
116
+ */
117
+ goog.json.unsafeParse = function(s) {
118
+ return /** @type {Object} */ (eval('(' + s + ')'));
119
+ };
120
+
121
+
122
+ /**
123
+ * JSON replacer, as defined in Section 15.12.3 of the ES5 spec.
124
+ *
125
+ * TODO(nicksantos): Array should also be a valid replacer.
126
+ *
127
+ * @typedef {function(this:Object, string, *): *}
128
+ */
129
+ goog.json.Replacer;
130
+
131
+
132
+ /**
133
+ * Serializes an object or a value to a JSON string.
134
+ *
135
+ * @param {*} object The object to serialize.
136
+ * @param {?goog.json.Replacer=} opt_replacer A replacer function
137
+ * called for each (key, value) pair that determines how the value
138
+ * should be serialized. By defult, this just returns the value
139
+ * and allows default serialization to kick in.
140
+ * @throws Error if there are loops in the object graph.
141
+ * @return {string} A JSON string representation of the input.
142
+ */
143
+ goog.json.serialize = function(object, opt_replacer) {
144
+ // TODO(nicksantos): Change this to default to JSON.stringify when available.
145
+ // I need to fiddle with the default externs a bit to make this happen.
146
+ return new goog.json.Serializer(opt_replacer).serialize(object);
147
+ };
148
+
149
+
150
+
151
+ /**
152
+ * Class that is used to serialize JSON objects to a string.
153
+ * @param {?goog.json.Replacer=} opt_replacer Replacer.
154
+ * @constructor
155
+ */
156
+ goog.json.Serializer = function(opt_replacer) {
157
+ /**
158
+ * @type {goog.json.Replacer|null|undefined}
159
+ * @private
160
+ */
161
+ this.replacer_ = opt_replacer;
162
+ };
163
+
164
+
165
+ /**
166
+ * Serializes an object or a value to a JSON string.
167
+ *
168
+ * @param {*} object The object to serialize.
169
+ * @throws Error if there are loops in the object graph.
170
+ * @return {string} A JSON string representation of the input.
171
+ */
172
+ goog.json.Serializer.prototype.serialize = function(object) {
173
+ var sb = [];
174
+ this.serialize_(object, sb);
175
+ return sb.join('');
176
+ };
177
+
178
+
179
+ /**
180
+ * Serializes a generic value to a JSON string
181
+ * @private
182
+ * @param {*} object The object to serialize.
183
+ * @param {Array} sb Array used as a string builder.
184
+ * @throws Error if there are loops in the object graph.
185
+ */
186
+ goog.json.Serializer.prototype.serialize_ = function(object, sb) {
187
+ switch (typeof object) {
188
+ case 'string':
189
+ this.serializeString_((/** @type {string} */ object), sb);
190
+ break;
191
+ case 'number':
192
+ this.serializeNumber_((/** @type {number} */ object), sb);
193
+ break;
194
+ case 'boolean':
195
+ sb.push(object);
196
+ break;
197
+ case 'undefined':
198
+ sb.push('null');
199
+ break;
200
+ case 'object':
201
+ if (object == null) {
202
+ sb.push('null');
203
+ break;
204
+ }
205
+ if (goog.isArray(object)) {
206
+ this.serializeArray_((/** @type {!Array} */ object), sb);
207
+ break;
208
+ }
209
+ // should we allow new String, new Number and new Boolean to be treated
210
+ // as string, number and boolean? Most implementations do not and the
211
+ // need is not very big
212
+ this.serializeObject_((/** @type {Object} */ object), sb);
213
+ break;
214
+ case 'function':
215
+ // Skip functions.
216
+ // TODO(user) Should we return something here?
217
+ break;
218
+ default:
219
+ throw Error('Unknown type: ' + typeof object);
220
+ }
221
+ };
222
+
223
+
224
+ /**
225
+ * Character mappings used internally for goog.string.quote
226
+ * @private
227
+ * @type {Object}
228
+ */
229
+ goog.json.Serializer.charToJsonCharCache_ = {
230
+ '\"': '\\"',
231
+ '\\': '\\\\',
232
+ '/': '\\/',
233
+ '\b': '\\b',
234
+ '\f': '\\f',
235
+ '\n': '\\n',
236
+ '\r': '\\r',
237
+ '\t': '\\t',
238
+
239
+ '\x0B': '\\u000b' // '\v' is not supported in JScript
240
+ };
241
+
242
+
243
+ /**
244
+ * Regular expression used to match characters that need to be replaced.
245
+ * The S60 browser has a bug where unicode characters are not matched by
246
+ * regular expressions. The condition below detects such behaviour and
247
+ * adjusts the regular expression accordingly.
248
+ * @private
249
+ * @type {RegExp}
250
+ */
251
+ goog.json.Serializer.charsToReplace_ = /\uffff/.test('\uffff') ?
252
+ /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g;
253
+
254
+
255
+ /**
256
+ * Serializes a string to a JSON string
257
+ * @private
258
+ * @param {string} s The string to serialize.
259
+ * @param {Array} sb Array used as a string builder.
260
+ */
261
+ goog.json.Serializer.prototype.serializeString_ = function(s, sb) {
262
+ // The official JSON implementation does not work with international
263
+ // characters.
264
+ sb.push('"', s.replace(goog.json.Serializer.charsToReplace_, function(c) {
265
+ // caching the result improves performance by a factor 2-3
266
+ if (c in goog.json.Serializer.charToJsonCharCache_) {
267
+ return goog.json.Serializer.charToJsonCharCache_[c];
268
+ }
269
+
270
+ var cc = c.charCodeAt(0);
271
+ var rv = '\\u';
272
+ if (cc < 16) {
273
+ rv += '000';
274
+ } else if (cc < 256) {
275
+ rv += '00';
276
+ } else if (cc < 4096) { // \u1000
277
+ rv += '0';
278
+ }
279
+ return goog.json.Serializer.charToJsonCharCache_[c] = rv + cc.toString(16);
280
+ }), '"');
281
+ };
282
+
283
+
284
+ /**
285
+ * Serializes a number to a JSON string
286
+ * @private
287
+ * @param {number} n The number to serialize.
288
+ * @param {Array} sb Array used as a string builder.
289
+ */
290
+ goog.json.Serializer.prototype.serializeNumber_ = function(n, sb) {
291
+ sb.push(isFinite(n) && !isNaN(n) ? n : 'null');
292
+ };
293
+
294
+
295
+ /**
296
+ * Serializes an array to a JSON string
297
+ * @private
298
+ * @param {Array} arr The array to serialize.
299
+ * @param {Array} sb Array used as a string builder.
300
+ */
301
+ goog.json.Serializer.prototype.serializeArray_ = function(arr, sb) {
302
+ var l = arr.length;
303
+ sb.push('[');
304
+ var sep = '';
305
+ for (var i = 0; i < l; i++) {
306
+ sb.push(sep);
307
+
308
+ var value = arr[i];
309
+ this.serialize_(
310
+ this.replacer_ ? this.replacer_.call(arr, String(i), value) : value,
311
+ sb);
312
+
313
+ sep = ',';
314
+ }
315
+ sb.push(']');
316
+ };
317
+
318
+
319
+ /**
320
+ * Serializes an object to a JSON string
321
+ * @private
322
+ * @param {Object} obj The object to serialize.
323
+ * @param {Array} sb Array used as a string builder.
324
+ */
325
+ goog.json.Serializer.prototype.serializeObject_ = function(obj, sb) {
326
+ sb.push('{');
327
+ var sep = '';
328
+ for (var key in obj) {
329
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
330
+ var value = obj[key];
331
+ // Skip functions.
332
+ // TODO(ptucker) Should we return something for function properties?
333
+ if (typeof value != 'function') {
334
+ sb.push(sep);
335
+ this.serializeString_(key, sb);
336
+ sb.push(':');
337
+
338
+ this.serialize_(
339
+ this.replacer_ ? this.replacer_.call(obj, key, value) : value,
340
+ sb);
341
+
342
+ sep = ',';
343
+ }
344
+ }
345
+ }
346
+ sb.push('}');
347
+ };
348
+ ;
349
+ FI"asset_paths;
350
+ F["k/Volumes/Development/dev-web/yellow-brick-road/vendor/assets/closure-library/closure/goog/json/json.jsI"dependency_paths;
351
+ F[{I" path;
352
+ F"k/Volumes/Development/dev-web/yellow-brick-road/vendor/assets/closure-library/closure/goog/json/json.jsI"
353
+ mtime;
354
+ FIu: Time
355
+ T: offsetiI"hexdigest;
356
+ F"%0d795b58f7077703ca4230d490666649I"
357
+ F"%46dde6621c301f4928e3b34efee9e3b5
@@ -0,0 +1,1545 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325456348.138679: @value{I"
2
+ class:EFI"BundledAsset;
3
+ FI"id;
4
+ F"%9e2969d17dc8b659cb7b9ef866064c66I"logical_path;
5
+ F"closure/goog/base.jsI"
6
+ F"_/Volumes/Development/dev-web/yellow-brick-road/vendor/closure-library/closure/goog/base.jsI"content_type;
7
+ FI"application/javascript;
8
+ FI"
9
+ mtime;
10
+ FI"2011-12-30T02:16:24+00:00;
11
+ FI" body;
12
+ FI"{�// Copyright 2006 The Closure Library Authors. All Rights Reserved.
13
+ //
14
+ // Licensed under the Apache License, Version 2.0 (the "License");
15
+ // you may not use this file except in compliance with the License.
16
+ // You may obtain a copy of the License at
17
+ //
18
+ // http://www.apache.org/licenses/LICENSE-2.0
19
+ //
20
+ // Unless required by applicable law or agreed to in writing, software
21
+ // distributed under the License is distributed on an "AS-IS" BASIS,
22
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ // See the License for the specific language governing permissions and
24
+ // limitations under the License.
25
+
26
+ /**
27
+ * @fileoverview Bootstrap for the Google JS Library (Closure).
28
+ *
29
+ * In uncompiled mode base.js will write out Closure's deps file, unless the
30
+ * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to
31
+ * include their own deps file(s) from different locations.
32
+ *
33
+ */
34
+
35
+
36
+ /**
37
+ * @define {boolean} Overridden to true by the compiler when --closure_pass
38
+ * or --mark_as_compiled is specified.
39
+ */
40
+
41
+ var COMPILED = false;
42
+
43
+
44
+ /**
45
+ * Base namespace for the Closure library. Checks to see goog is
46
+ * already defined in the current scope before assigning to prevent
47
+ * clobbering if base.js is loaded more than once.
48
+ *
49
+ * @const
50
+ */
51
+ var goog = goog || {}; // Identifies this file as the Closure base.
52
+
53
+
54
+ /**
55
+ * Reference to the global context. In most cases this will be 'window'.
56
+ */
57
+ goog.global = this;
58
+
59
+
60
+ /**
61
+ * @define {boolean} DEBUG is provided as a convenience so that debugging code
62
+ * that should not be included in a production js_binary can be easily stripped
63
+ * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most
64
+ * toString() methods should be declared inside an "if (goog.DEBUG)" conditional
65
+ * because they are generally used for debugging purposes and it is difficult
66
+ * for the JSCompiler to statically determine whether they are used.
67
+ */
68
+ goog.DEBUG = true;
69
+
70
+
71
+ /**
72
+ * @define {string} LOCALE defines the locale being used for compilation. It is
73
+ * used to select locale specific data to be compiled in js binary. BUILD rule
74
+ * can specify this value by "--define goog.LOCALE=<locale_name>" as JSCompiler
75
+ * option.
76
+ *
77
+ * Take into account that the locale code format is important. You should use
78
+ * the canonical Unicode format with hyphen as a delimiter. Language must be
79
+ * lowercase, Language Script - Capitalized, Region - UPPERCASE.
80
+ * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.
81
+ *
82
+ * See more info about locale codes here:
83
+ * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers
84
+ *
85
+ * For language codes you should use values defined by ISO 693-1. See it here
86
+ * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from
87
+ * this rule: the Hebrew language. For legacy reasons the old code (iw) should
88
+ * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.
89
+ */
90
+ goog.LOCALE = 'en'; // default to en
91
+
92
+
93
+ /**
94
+ * Creates object stubs for a namespace. The presence of one or more
95
+ * goog.provide() calls indicate that the file defines the given
96
+ * objects/namespaces. Build tools also scan for provide/require statements
97
+ * to discern dependencies, build dependency files (see deps.js), etc.
98
+ * @see goog.require
99
+ * @param {string} name Namespace provided by this file in the form
100
+ * "goog.package.part".
101
+ */
102
+ goog.provide = function(name) {
103
+ if (!COMPILED) {
104
+ // Ensure that the same namespace isn't provided twice. This is intended
105
+ // to teach new developers that 'goog.provide' is effectively a variable
106
+ // declaration. And when JSCompiler transforms goog.provide into a real
107
+ // variable declaration, the compiled JS should work the same as the raw
108
+ // JS--even when the raw JS uses goog.provide incorrectly.
109
+ if (goog.isProvided_(name)) {
110
+ throw Error('Namespace "' + name + '" already declared.');
111
+ }
112
+ delete goog.implicitNamespaces_[name];
113
+
114
+ var namespace = name;
115
+ while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {
116
+ if (goog.getObjectByName(namespace)) {
117
+ break;
118
+ }
119
+ goog.implicitNamespaces_[namespace] = true;
120
+ }
121
+ }
122
+
123
+ goog.exportPath_(name);
124
+ };
125
+
126
+
127
+ /**
128
+ * Marks that the current file should only be used for testing, and never for
129
+ * live code in production.
130
+ * @param {string=} opt_message Optional message to add to the error that's
131
+ * raised when used in production code.
132
+ */
133
+ goog.setTestOnly = function(opt_message) {
134
+ if (COMPILED && !goog.DEBUG) {
135
+ opt_message = opt_message || '';
136
+ throw Error('Importing test-only code into non-debug environment' +
137
+ opt_message ? ': ' + opt_message : '.');
138
+ }
139
+ };
140
+
141
+
142
+ if (!COMPILED) {
143
+
144
+ /**
145
+ * Check if the given name has been goog.provided. This will return false for
146
+ * names that are available only as implicit namespaces.
147
+ * @param {string} name name of the object to look for.
148
+ * @return {boolean} Whether the name has been provided.
149
+ * @private
150
+ */
151
+ goog.isProvided_ = function(name) {
152
+ return !goog.implicitNamespaces_[name] && !!goog.getObjectByName(name);
153
+ };
154
+
155
+ /**
156
+ * Namespaces implicitly defined by goog.provide. For example,
157
+ * goog.provide('goog.events.Event') implicitly declares
158
+ * that 'goog' and 'goog.events' must be namespaces.
159
+ *
160
+ * @type {Object}
161
+ * @private
162
+ */
163
+ goog.implicitNamespaces_ = {};
164
+ }
165
+
166
+
167
+ /**
168
+ * Builds an object structure for the provided namespace path,
169
+ * ensuring that names that already exist are not overwritten. For
170
+ * example:
171
+ * "a.b.c" -> a = {};a.b={};a.b.c={};
172
+ * Used by goog.provide and goog.exportSymbol.
173
+ * @param {string} name name of the object that this file defines.
174
+ * @param {*=} opt_object the object to expose at the end of the path.
175
+ * @param {Object=} opt_objectToExportTo The object to add the path to; default
176
+ * is |goog.global|.
177
+ * @private
178
+ */
179
+ goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {
180
+ var parts = name.split('.');
181
+ var cur = opt_objectToExportTo || goog.global;
182
+
183
+ // Internet Explorer exhibits strange behavior when throwing errors from
184
+ // methods externed in this manner. See the testExportSymbolExceptions in
185
+ // base_test.html for an example.
186
+ if (!(parts[0] in cur) && cur.execScript) {
187
+ cur.execScript('var ' + parts[0]);
188
+ }
189
+
190
+ // Certain browsers cannot parse code in the form for((a in b); c;);
191
+ // This pattern is produced by the JSCompiler when it collapses the
192
+ // statement above into the conditional loop below. To prevent this from
193
+ // happening, use a for-loop and reserve the init logic as below.
194
+
195
+ // Parentheses added to eliminate strict JS warning in Firefox.
196
+ for (var part; parts.length && (part = parts.shift());) {
197
+ if (!parts.length && goog.isDef(opt_object)) {
198
+ // last part and we have an object; use it
199
+ cur[part] = opt_object;
200
+ } else if (cur[part]) {
201
+ cur = cur[part];
202
+ } else {
203
+ cur = cur[part] = {};
204
+ }
205
+ }
206
+ };
207
+
208
+
209
+ /**
210
+ * Returns an object based on its fully qualified external name. If you are
211
+ * using a compilation pass that renames property names beware that using this
212
+ * function will not find renamed properties.
213
+ *
214
+ * @param {string} name The fully qualified name.
215
+ * @param {Object=} opt_obj The object within which to look; default is
216
+ * |goog.global|.
217
+ * @return {?} The value (object or primitive) or, if not found, null.
218
+ */
219
+ goog.getObjectByName = function(name, opt_obj) {
220
+ var parts = name.split('.');
221
+ var cur = opt_obj || goog.global;
222
+ for (var part; part = parts.shift(); ) {
223
+ if (goog.isDefAndNotNull(cur[part])) {
224
+ cur = cur[part];
225
+ } else {
226
+ return null;
227
+ }
228
+ }
229
+ return cur;
230
+ };
231
+
232
+
233
+ /**
234
+ * Globalizes a whole namespace, such as goog or goog.lang.
235
+ *
236
+ * @param {Object} obj The namespace to globalize.
237
+ * @param {Object=} opt_global The object to add the properties to.
238
+ * @deprecated Properties may be explicitly exported to the global scope, but
239
+ * this should no longer be done in bulk.
240
+ */
241
+ goog.globalize = function(obj, opt_global) {
242
+ var global = opt_global || goog.global;
243
+ for (var x in obj) {
244
+ global[x] = obj[x];
245
+ }
246
+ };
247
+
248
+
249
+ /**
250
+ * Adds a dependency from a file to the files it requires.
251
+ * @param {string} relPath The path to the js file.
252
+ * @param {Array} provides An array of strings with the names of the objects
253
+ * this file provides.
254
+ * @param {Array} requires An array of strings with the names of the objects
255
+ * this file requires.
256
+ */
257
+ goog.addDependency = function(relPath, provides, requires) {
258
+ if (!COMPILED) {
259
+ var provide, require;
260
+ var path = relPath.replace(/\\/g, '/');
261
+ var deps = goog.dependencies_;
262
+ for (var i = 0; provide = provides[i]; i++) {
263
+ deps.nameToPath[provide] = path;
264
+ if (!(path in deps.pathToNames)) {
265
+ deps.pathToNames[path] = {};
266
+ }
267
+ deps.pathToNames[path][provide] = true;
268
+ }
269
+ for (var j = 0; require = requires[j]; j++) {
270
+ if (!(path in deps.requires)) {
271
+ deps.requires[path] = {};
272
+ }
273
+ deps.requires[path][require] = true;
274
+ }
275
+ }
276
+ };
277
+
278
+
279
+
280
+
281
+ // NOTE(user): The debug DOM loader was included in base.js as an orignal
282
+ // way to do "debug-mode" development. The dependency system can sometimes
283
+ // be confusing, as can the debug DOM loader's asyncronous nature.
284
+ //
285
+ // With the DOM loader, a call to goog.require() is not blocking -- the
286
+ // script will not load until some point after the current script. If a
287
+ // namespace is needed at runtime, it needs to be defined in a previous
288
+ // script, or loaded via require() with its registered dependencies.
289
+ // User-defined namespaces may need their own deps file. See http://go/js_deps,
290
+ // http://go/genjsdeps, or, externally, DepsWriter.
291
+ // http://code.google.com/closure/library/docs/depswriter.html
292
+ //
293
+ // Because of legacy clients, the DOM loader can't be easily removed from
294
+ // base.js. Work is being done to make it disableable or replaceable for
295
+ // different environments (DOM-less JavaScript interpreters like Rhino or V8,
296
+ // for example). See bootstrap/ for more information.
297
+
298
+
299
+ /**
300
+ * @define {boolean} Whether to enable the debug loader.
301
+ *
302
+ * If enabled, a call to goog.require() will attempt to load the namespace by
303
+ * appending a script tag to the DOM (if the namespace has been registered).
304
+ *
305
+ * If disabled, goog.require() will simply assert that the namespace has been
306
+ * provided (and depend on the fact that some outside tool correctly ordered
307
+ * the script).
308
+ */
309
+ goog.ENABLE_DEBUG_LOADER = true;
310
+
311
+
312
+ /**
313
+ * Implements a system for the dynamic resolution of dependencies
314
+ * that works in parallel with the BUILD system. Note that all calls
315
+ * to goog.require will be stripped by the JSCompiler when the
316
+ * --closure_pass option is used.
317
+ * @see goog.provide
318
+ * @param {string} name Namespace to include (as was given in goog.provide())
319
+ * in the form "goog.package.part".
320
+ */
321
+ goog.require = function(name) {
322
+
323
+ // if the object already exists we do not need do do anything
324
+ // TODO(arv): If we start to support require based on file name this has
325
+ // to change
326
+ // TODO(arv): If we allow goog.foo.* this has to change
327
+ // TODO(arv): If we implement dynamic load after page load we should probably
328
+ // not remove this code for the compiled output
329
+ if (!COMPILED) {
330
+ if (goog.isProvided_(name)) {
331
+ return;
332
+ }
333
+
334
+ if (goog.ENABLE_DEBUG_LOADER) {
335
+ var path = goog.getPathFromDeps_(name);
336
+ if (path) {
337
+ goog.included_[path] = true;
338
+ goog.writeScripts_();
339
+ return;
340
+ }
341
+ }
342
+
343
+ var errorMessage = 'goog.require could not find: ' + name;
344
+ if (goog.global.console) {
345
+ goog.global.console['error'](errorMessage);
346
+ }
347
+
348
+
349
+ throw Error(errorMessage);
350
+
351
+ }
352
+ };
353
+
354
+
355
+ /**
356
+ * Path for included scripts
357
+ * @type {string}
358
+ */
359
+ goog.basePath = '';
360
+
361
+
362
+ /**
363
+ * A hook for overriding the base path.
364
+ * @type {string|undefined}
365
+ */
366
+ goog.global.CLOSURE_BASE_PATH;
367
+
368
+
369
+ /**
370
+ * Whether to write out Closure's deps file. By default,
371
+ * the deps are written.
372
+ * @type {boolean|undefined}
373
+ */
374
+ goog.global.CLOSURE_NO_DEPS;
375
+
376
+
377
+ /**
378
+ * A function to import a single script. This is meant to be overridden when
379
+ * Closure is being run in non-HTML contexts, such as web workers. It's defined
380
+ * in the global scope so that it can be set before base.js is loaded, which
381
+ * allows deps.js to be imported properly.
382
+ *
383
+ * The function is passed the script source, which is a relative URI. It should
384
+ * return true if the script was imported, false otherwise.
385
+ */
386
+ goog.global.CLOSURE_IMPORT_SCRIPT;
387
+
388
+
389
+ /**
390
+ * Null function used for default values of callbacks, etc.
391
+ * @return {void} Nothing.
392
+ */
393
+ goog.nullFunction = function() {};
394
+
395
+
396
+ /**
397
+ * The identity function. Returns its first argument.
398
+ *
399
+ * @param {...*} var_args The arguments of the function.
400
+ * @return {*} The first argument.
401
+ * @deprecated Use goog.functions.identity instead.
402
+ */
403
+ goog.identityFunction = function(var_args) {
404
+ return arguments[0];
405
+ };
406
+
407
+
408
+ /**
409
+ * When defining a class Foo with an abstract method bar(), you can do:
410
+ *
411
+ * Foo.prototype.bar = goog.abstractMethod
412
+ *
413
+ * Now if a subclass of Foo fails to override bar(), an error
414
+ * will be thrown when bar() is invoked.
415
+ *
416
+ * Note: This does not take the name of the function to override as
417
+ * an argument because that would make it more difficult to obfuscate
418
+ * our JavaScript code.
419
+ *
420
+ * @type {!Function}
421
+ * @throws {Error} when invoked to indicate the method should be
422
+ * overridden.
423
+ */
424
+ goog.abstractMethod = function() {
425
+ throw Error('unimplemented abstract method');
426
+ };
427
+
428
+
429
+ /**
430
+ * Adds a {@code getInstance} static method that always return the same instance
431
+ * object.
432
+ * @param {!Function} ctor The constructor for the class to add the static
433
+ * method to.
434
+ */
435
+ goog.addSingletonGetter = function(ctor) {
436
+ ctor.getInstance = function() {
437
+ return ctor.instance_ || (ctor.instance_ = new ctor());
438
+ };
439
+ };
440
+
441
+
442
+ if (!COMPILED && goog.ENABLE_DEBUG_LOADER) {
443
+ /**
444
+ * Object used to keep track of urls that have already been added. This
445
+ * record allows the prevention of circular dependencies.
446
+ * @type {Object}
447
+ * @private
448
+ */
449
+ goog.included_ = {};
450
+
451
+
452
+ /**
453
+ * This object is used to keep track of dependencies and other data that is
454
+ * used for loading scripts
455
+ * @private
456
+ * @type {Object}
457
+ */
458
+ goog.dependencies_ = {
459
+ pathToNames: {}, // 1 to many
460
+ nameToPath: {}, // 1 to 1
461
+ requires: {}, // 1 to many
462
+ // used when resolving dependencies to prevent us from
463
+ // visiting the file twice
464
+ visited: {},
465
+ written: {} // used to keep track of script files we have written
466
+ };
467
+
468
+
469
+ /**
470
+ * Tries to detect whether is in the context of an HTML document.
471
+ * @return {boolean} True if it looks like HTML document.
472
+ * @private
473
+ */
474
+ goog.inHtmlDocument_ = function() {
475
+ var doc = goog.global.document;
476
+ return typeof doc != 'undefined' &&
477
+ 'write' in doc; // XULDocument misses write.
478
+ };
479
+
480
+
481
+ /**
482
+ * Tries to detect the base path of the base.js script that bootstraps Closure
483
+ * @private
484
+ */
485
+ goog.findBasePath_ = function() {
486
+ if (goog.global.CLOSURE_BASE_PATH) {
487
+ goog.basePath = goog.global.CLOSURE_BASE_PATH;
488
+ return;
489
+ } else if (!goog.inHtmlDocument_()) {
490
+ return;
491
+ }
492
+ var doc = goog.global.document;
493
+ var scripts = doc.getElementsByTagName('script');
494
+ // Search backwards since the current script is in almost all cases the one
495
+ // that has base.js.
496
+ for (var i = scripts.length - 1; i >= 0; --i) {
497
+ var src = scripts[i].src;
498
+ var qmark = src.lastIndexOf('?');
499
+ var l = qmark == -1 ? src.length : qmark;
500
+ if (src.substr(l - 7, 7) == 'base.js') {
501
+ goog.basePath = src.substr(0, l - 7);
502
+ return;
503
+ }
504
+ }
505
+ };
506
+
507
+
508
+ /**
509
+ * Imports a script if, and only if, that script hasn't already been imported.
510
+ * (Must be called at execution time)
511
+ * @param {string} src Script source.
512
+ * @private
513
+ */
514
+ goog.importScript_ = function(src) {
515
+ var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||
516
+ goog.writeScriptTag_;
517
+ if (!goog.dependencies_.written[src] && importScript(src)) {
518
+ goog.dependencies_.written[src] = true;
519
+ }
520
+ };
521
+
522
+
523
+ /**
524
+ * The default implementation of the import function. Writes a script tag to
525
+ * import the script.
526
+ *
527
+ * @param {string} src The script source.
528
+ * @return {boolean} True if the script was imported, false otherwise.
529
+ * @private
530
+ */
531
+ goog.writeScriptTag_ = function(src) {
532
+ if (goog.inHtmlDocument_()) {
533
+ var doc = goog.global.document;
534
+ doc.write(
535
+ '<script type="text/javascript" src="' + src + '"></' + 'script>');
536
+ return true;
537
+ } else {
538
+ return false;
539
+ }
540
+ };
541
+
542
+
543
+ /**
544
+ * Resolves dependencies based on the dependencies added using addDependency
545
+ * and calls importScript_ in the correct order.
546
+ * @private
547
+ */
548
+ goog.writeScripts_ = function() {
549
+ // the scripts we need to write this time
550
+ var scripts = [];
551
+ var seenScript = {};
552
+ var deps = goog.dependencies_;
553
+
554
+ function visitNode(path) {
555
+ if (path in deps.written) {
556
+ return;
557
+ }
558
+
559
+ // we have already visited this one. We can get here if we have cyclic
560
+ // dependencies
561
+ if (path in deps.visited) {
562
+ if (!(path in seenScript)) {
563
+ seenScript[path] = true;
564
+ scripts.push(path);
565
+ }
566
+ return;
567
+ }
568
+
569
+ deps.visited[path] = true;
570
+
571
+ if (path in deps.requires) {
572
+ for (var requireName in deps.requires[path]) {
573
+ // If the required name is defined, we assume that it was already
574
+ // bootstrapped by other means.
575
+ if (!goog.isProvided_(requireName)) {
576
+ if (requireName in deps.nameToPath) {
577
+ visitNode(deps.nameToPath[requireName]);
578
+ } else {
579
+ throw Error('Undefined nameToPath for ' + requireName);
580
+ }
581
+ }
582
+ }
583
+ }
584
+
585
+ if (!(path in seenScript)) {
586
+ seenScript[path] = true;
587
+ scripts.push(path);
588
+ }
589
+ }
590
+
591
+ for (var path in goog.included_) {
592
+ if (!deps.written[path]) {
593
+ visitNode(path);
594
+ }
595
+ }
596
+
597
+ for (var i = 0; i < scripts.length; i++) {
598
+ if (scripts[i]) {
599
+ goog.importScript_(goog.basePath + scripts[i]);
600
+ } else {
601
+ throw Error('Undefined script input');
602
+ }
603
+ }
604
+ };
605
+
606
+
607
+ /**
608
+ * Looks at the dependency rules and tries to determine the script file that
609
+ * fulfills a particular rule.
610
+ * @param {string} rule In the form goog.namespace.Class or project.script.
611
+ * @return {?string} Url corresponding to the rule, or null.
612
+ * @private
613
+ */
614
+ goog.getPathFromDeps_ = function(rule) {
615
+ if (rule in goog.dependencies_.nameToPath) {
616
+ return goog.dependencies_.nameToPath[rule];
617
+ } else {
618
+ return null;
619
+ }
620
+ };
621
+
622
+ goog.findBasePath_();
623
+
624
+ // Allow projects to manage the deps files themselves.
625
+ if (!goog.global.CLOSURE_NO_DEPS) {
626
+ goog.importScript_(goog.basePath + 'deps.js');
627
+ }
628
+ }
629
+
630
+
631
+
632
+ //==============================================================================
633
+ // Language Enhancements
634
+ //==============================================================================
635
+
636
+
637
+ /**
638
+ * This is a "fixed" version of the typeof operator. It differs from the typeof
639
+ * operator in such a way that null returns 'null' and arrays return 'array'.
640
+ * @param {*} value The value to get the type of.
641
+ * @return {string} The name of the type.
642
+ */
643
+ goog.typeOf = function(value) {
644
+ var s = typeof value;
645
+ if (s == 'object') {
646
+ if (value) {
647
+ // Check these first, so we can avoid calling Object.prototype.toString if
648
+ // possible.
649
+ //
650
+ // IE improperly marshals tyepof across execution contexts, but a
651
+ // cross-context object will still return false for "instanceof Object".
652
+ if (value instanceof Array) {
653
+ return 'array';
654
+ } else if (value instanceof Object) {
655
+ return s;
656
+ }
657
+
658
+ // HACK: In order to use an Object prototype method on the arbitrary
659
+ // value, the compiler requires the value be cast to type Object,
660
+ // even though the ECMA spec explicitly allows it.
661
+ var className = Object.prototype.toString.call(
662
+ /** @type {Object} */ (value));
663
+ // In Firefox 3.6, attempting to access iframe window objects' length
664
+ // property throws an NS_ERROR_FAILURE, so we need to special-case it
665
+ // here.
666
+ if (className == '[object Window]') {
667
+ return 'object';
668
+ }
669
+
670
+ // We cannot always use constructor == Array or instanceof Array because
671
+ // different frames have different Array objects. In IE6, if the iframe
672
+ // where the array was created is destroyed, the array loses its
673
+ // prototype. Then dereferencing val.splice here throws an exception, so
674
+ // we can't use goog.isFunction. Calling typeof directly returns 'unknown'
675
+ // so that will work. In this case, this function will return false and
676
+ // most array functions will still work because the array is still
677
+ // array-like (supports length and []) even though it has lost its
678
+ // prototype.
679
+ // Mark Miller noticed that Object.prototype.toString
680
+ // allows access to the unforgeable [[Class]] property.
681
+ // 15.2.4.2 Object.prototype.toString ( )
682
+ // When the toString method is called, the following steps are taken:
683
+ // 1. Get the [[Class]] property of this object.
684
+ // 2. Compute a string value by concatenating the three strings
685
+ // "[object ", Result(1), and "]".
686
+ // 3. Return Result(2).
687
+ // and this behavior survives the destruction of the execution context.
688
+ if ((className == '[object Array]' ||
689
+ // In IE all non value types are wrapped as objects across window
690
+ // boundaries (not iframe though) so we have to do object detection
691
+ // for this edge case
692
+ typeof value.length == 'number' &&
693
+ typeof value.splice != 'undefined' &&
694
+ typeof value.propertyIsEnumerable != 'undefined' &&
695
+ !value.propertyIsEnumerable('splice')
696
+
697
+ )) {
698
+ return 'array';
699
+ }
700
+ // HACK: There is still an array case that fails.
701
+ // function ArrayImpostor() {}
702
+ // ArrayImpostor.prototype = [];
703
+ // var impostor = new ArrayImpostor;
704
+ // this can be fixed by getting rid of the fast path
705
+ // (value instanceof Array) and solely relying on
706
+ // (value && Object.prototype.toString.vall(value) === '[object Array]')
707
+ // but that would require many more function calls and is not warranted
708
+ // unless closure code is receiving objects from untrusted sources.
709
+
710
+ // IE in cross-window calls does not correctly marshal the function type
711
+ // (it appears just as an object) so we cannot use just typeof val ==
712
+ // 'function'. However, if the object has a call property, it is a
713
+ // function.
714
+ if ((className == '[object Function]' ||
715
+ typeof value.call != 'undefined' &&
716
+ typeof value.propertyIsEnumerable != 'undefined' &&
717
+ !value.propertyIsEnumerable('call'))) {
718
+ return 'function';
719
+ }
720
+
721
+
722
+ } else {
723
+ return 'null';
724
+ }
725
+
726
+ } else if (s == 'function' && typeof value.call == 'undefined') {
727
+ // In Safari typeof nodeList returns 'function', and on Firefox
728
+ // typeof behaves similarly for HTML{Applet,Embed,Object}Elements
729
+ // and RegExps. We would like to return object for those and we can
730
+ // detect an invalid function by making sure that the function
731
+ // object has a call method.
732
+ return 'object';
733
+ }
734
+ return s;
735
+ };
736
+
737
+
738
+ /**
739
+ * Safe way to test whether a property is enumarable. It allows testing
740
+ * for enumerable on objects where 'propertyIsEnumerable' is overridden or
741
+ * does not exist (like DOM nodes in IE). Does not use browser native
742
+ * Object.propertyIsEnumerable.
743
+ * @param {Object} object The object to test if the property is enumerable.
744
+ * @param {string} propName The property name to check for.
745
+ * @return {boolean} True if the property is enumarable.
746
+ * @private
747
+ */
748
+ goog.propertyIsEnumerableCustom_ = function(object, propName) {
749
+ // KJS in Safari 2 is not ECMAScript compatible and lacks crucial methods
750
+ // such as propertyIsEnumerable. We therefore use a workaround.
751
+ // Does anyone know a more efficient work around?
752
+ if (propName in object) {
753
+ for (var key in object) {
754
+ if (key == propName &&
755
+ Object.prototype.hasOwnProperty.call(object, propName)) {
756
+ return true;
757
+ }
758
+ }
759
+ }
760
+ return false;
761
+ };
762
+
763
+
764
+ /**
765
+ * Safe way to test whether a property is enumarable. It allows testing
766
+ * for enumerable on objects where 'propertyIsEnumerable' is overridden or
767
+ * does not exist (like DOM nodes in IE).
768
+ * @param {Object} object The object to test if the property is enumerable.
769
+ * @param {string} propName The property name to check for.
770
+ * @return {boolean} True if the property is enumarable.
771
+ * @private
772
+ */
773
+ goog.propertyIsEnumerable_ = function(object, propName) {
774
+ // In IE if object is from another window, cannot use propertyIsEnumerable
775
+ // from this window's Object. Will raise a 'JScript object expected' error.
776
+ if (object instanceof Object) {
777
+ return Object.prototype.propertyIsEnumerable.call(object, propName);
778
+ } else {
779
+ return goog.propertyIsEnumerableCustom_(object, propName);
780
+ }
781
+ };
782
+
783
+
784
+ /**
785
+ * Returns true if the specified value is not |undefined|.
786
+ * WARNING: Do not use this to test if an object has a property. Use the in
787
+ * operator instead. Additionally, this function assumes that the global
788
+ * undefined variable has not been redefined.
789
+ * @param {*} val Variable to test.
790
+ * @return {boolean} Whether variable is defined.
791
+ */
792
+ goog.isDef = function(val) {
793
+ return val !== undefined;
794
+ };
795
+
796
+
797
+ /**
798
+ * Returns true if the specified value is |null|
799
+ * @param {*} val Variable to test.
800
+ * @return {boolean} Whether variable is null.
801
+ */
802
+ goog.isNull = function(val) {
803
+ return val === null;
804
+ };
805
+
806
+
807
+ /**
808
+ * Returns true if the specified value is defined and not null
809
+ * @param {*} val Variable to test.
810
+ * @return {boolean} Whether variable is defined and not null.
811
+ */
812
+ goog.isDefAndNotNull = function(val) {
813
+ // Note that undefined == null.
814
+ return val != null;
815
+ };
816
+
817
+
818
+ /**
819
+ * Returns true if the specified value is an array
820
+ * @param {*} val Variable to test.
821
+ * @return {boolean} Whether variable is an array.
822
+ */
823
+ goog.isArray = function(val) {
824
+ return goog.typeOf(val) == 'array';
825
+ };
826
+
827
+
828
+ /**
829
+ * Returns true if the object looks like an array. To qualify as array like
830
+ * the value needs to be either a NodeList or an object with a Number length
831
+ * property.
832
+ * @param {*} val Variable to test.
833
+ * @return {boolean} Whether variable is an array.
834
+ */
835
+ goog.isArrayLike = function(val) {
836
+ var type = goog.typeOf(val);
837
+ return type == 'array' || type == 'object' && typeof val.length == 'number';
838
+ };
839
+
840
+
841
+ /**
842
+ * Returns true if the object looks like a Date. To qualify as Date-like
843
+ * the value needs to be an object and have a getFullYear() function.
844
+ * @param {*} val Variable to test.
845
+ * @return {boolean} Whether variable is a like a Date.
846
+ */
847
+ goog.isDateLike = function(val) {
848
+ return goog.isObject(val) && typeof val.getFullYear == 'function';
849
+ };
850
+
851
+
852
+ /**
853
+ * Returns true if the specified value is a string
854
+ * @param {*} val Variable to test.
855
+ * @return {boolean} Whether variable is a string.
856
+ */
857
+ goog.isString = function(val) {
858
+ return typeof val == 'string';
859
+ };
860
+
861
+
862
+ /**
863
+ * Returns true if the specified value is a boolean
864
+ * @param {*} val Variable to test.
865
+ * @return {boolean} Whether variable is boolean.
866
+ */
867
+ goog.isBoolean = function(val) {
868
+ return typeof val == 'boolean';
869
+ };
870
+
871
+
872
+ /**
873
+ * Returns true if the specified value is a number
874
+ * @param {*} val Variable to test.
875
+ * @return {boolean} Whether variable is a number.
876
+ */
877
+ goog.isNumber = function(val) {
878
+ return typeof val == 'number';
879
+ };
880
+
881
+
882
+ /**
883
+ * Returns true if the specified value is a function
884
+ * @param {*} val Variable to test.
885
+ * @return {boolean} Whether variable is a function.
886
+ */
887
+ goog.isFunction = function(val) {
888
+ return goog.typeOf(val) == 'function';
889
+ };
890
+
891
+
892
+ /**
893
+ * Returns true if the specified value is an object. This includes arrays
894
+ * and functions.
895
+ * @param {*} val Variable to test.
896
+ * @return {boolean} Whether variable is an object.
897
+ */
898
+ goog.isObject = function(val) {
899
+ var type = goog.typeOf(val);
900
+ return type == 'object' || type == 'array' || type == 'function';
901
+ };
902
+
903
+
904
+ /**
905
+ * Gets a unique ID for an object. This mutates the object so that further
906
+ * calls with the same object as a parameter returns the same value. The unique
907
+ * ID is guaranteed to be unique across the current session amongst objects that
908
+ * are passed into {@code getUid}. There is no guarantee that the ID is unique
909
+ * or consistent across sessions. It is unsafe to generate unique ID for
910
+ * function prototypes.
911
+ *
912
+ * @param {Object} obj The object to get the unique ID for.
913
+ * @return {number} The unique ID for the object.
914
+ */
915
+ goog.getUid = function(obj) {
916
+ // TODO(arv): Make the type stricter, do not accept null.
917
+
918
+ // In Opera window.hasOwnProperty exists but always returns false so we avoid
919
+ // using it. As a consequence the unique ID generated for BaseClass.prototype
920
+ // and SubClass.prototype will be the same.
921
+ return obj[goog.UID_PROPERTY_] ||
922
+ (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);
923
+ };
924
+
925
+
926
+ /**
927
+ * Removes the unique ID from an object. This is useful if the object was
928
+ * previously mutated using {@code goog.getUid} in which case the mutation is
929
+ * undone.
930
+ * @param {Object} obj The object to remove the unique ID field from.
931
+ */
932
+ goog.removeUid = function(obj) {
933
+ // TODO(arv): Make the type stricter, do not accept null.
934
+
935
+ // DOM nodes in IE are not instance of Object and throws exception
936
+ // for delete. Instead we try to use removeAttribute
937
+ if ('removeAttribute' in obj) {
938
+ obj.removeAttribute(goog.UID_PROPERTY_);
939
+ }
940
+ /** @preserveTry */
941
+ try {
942
+ delete obj[goog.UID_PROPERTY_];
943
+ } catch (ex) {
944
+ }
945
+ };
946
+
947
+
948
+ /**
949
+ * Name for unique ID property. Initialized in a way to help avoid collisions
950
+ * with other closure javascript on the same page.
951
+ * @type {string}
952
+ * @private
953
+ */
954
+ goog.UID_PROPERTY_ = 'closure_uid_' +
955
+ Math.floor(Math.random() * 2147483648).toString(36);
956
+
957
+
958
+ /**
959
+ * Counter for UID.
960
+ * @type {number}
961
+ * @private
962
+ */
963
+ goog.uidCounter_ = 0;
964
+
965
+
966
+ /**
967
+ * Adds a hash code field to an object. The hash code is unique for the
968
+ * given object.
969
+ * @param {Object} obj The object to get the hash code for.
970
+ * @return {number} The hash code for the object.
971
+ * @deprecated Use goog.getUid instead.
972
+ */
973
+ goog.getHashCode = goog.getUid;
974
+
975
+
976
+ /**
977
+ * Removes the hash code field from an object.
978
+ * @param {Object} obj The object to remove the field from.
979
+ * @deprecated Use goog.removeUid instead.
980
+ */
981
+ goog.removeHashCode = goog.removeUid;
982
+
983
+
984
+ /**
985
+ * Clones a value. The input may be an Object, Array, or basic type. Objects and
986
+ * arrays will be cloned recursively.
987
+ *
988
+ * WARNINGS:
989
+ * <code>goog.cloneObject</code> does not detect reference loops. Objects that
990
+ * refer to themselves will cause infinite recursion.
991
+ *
992
+ * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies
993
+ * UIDs created by <code>getUid</code> into cloned results.
994
+ *
995
+ * @param {*} obj The value to clone.
996
+ * @return {*} A clone of the input value.
997
+ * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.
998
+ */
999
+ goog.cloneObject = function(obj) {
1000
+ var type = goog.typeOf(obj);
1001
+ if (type == 'object' || type == 'array') {
1002
+ if (obj.clone) {
1003
+ return obj.clone();
1004
+ }
1005
+ var clone = type == 'array' ? [] : {};
1006
+ for (var key in obj) {
1007
+ clone[key] = goog.cloneObject(obj[key]);
1008
+ }
1009
+ return clone;
1010
+ }
1011
+
1012
+ return obj;
1013
+ };
1014
+
1015
+
1016
+ /**
1017
+ * Forward declaration for the clone method. This is necessary until the
1018
+ * compiler can better support duck-typing constructs as used in
1019
+ * goog.cloneObject.
1020
+ *
1021
+ * TODO(user): Remove once the JSCompiler can infer that the check for
1022
+ * proto.clone is safe in goog.cloneObject.
1023
+ *
1024
+ * @type {Function}
1025
+ */
1026
+ Object.prototype.clone;
1027
+
1028
+
1029
+ /**
1030
+ * A native implementation of goog.bind.
1031
+ * @param {Function} fn A function to partially apply.
1032
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1033
+ * point to when the function is run.
1034
+ * @param {...*} var_args Additional arguments that are partially
1035
+ * applied to the function.
1036
+ * @return {!Function} A partially-applied form of the function bind() was
1037
+ * invoked as a method of.
1038
+ * @private
1039
+ * @suppress {deprecated} The compiler thinks that Function.prototype.bind
1040
+ * is deprecated because some people have declared a pure-JS version.
1041
+ * Only the pure-JS version is truly deprecated.
1042
+ */
1043
+ goog.bindNative_ = function(fn, selfObj, var_args) {
1044
+ return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
1045
+ };
1046
+
1047
+
1048
+ /**
1049
+ * A pure-JS implementation of goog.bind.
1050
+ * @param {Function} fn A function to partially apply.
1051
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1052
+ * point to when the function is run.
1053
+ * @param {...*} var_args Additional arguments that are partially
1054
+ * applied to the function.
1055
+ * @return {!Function} A partially-applied form of the function bind() was
1056
+ * invoked as a method of.
1057
+ * @private
1058
+ */
1059
+ goog.bindJs_ = function(fn, selfObj, var_args) {
1060
+ if (!fn) {
1061
+ throw new Error();
1062
+ }
1063
+
1064
+ if (arguments.length > 2) {
1065
+ var boundArgs = Array.prototype.slice.call(arguments, 2);
1066
+ return function() {
1067
+ // Prepend the bound arguments to the current arguments.
1068
+ var newArgs = Array.prototype.slice.call(arguments);
1069
+ Array.prototype.unshift.apply(newArgs, boundArgs);
1070
+ return fn.apply(selfObj, newArgs);
1071
+ };
1072
+
1073
+ } else {
1074
+ return function() {
1075
+ return fn.apply(selfObj, arguments);
1076
+ };
1077
+ }
1078
+ };
1079
+
1080
+
1081
+ /**
1082
+ * Partially applies this function to a particular 'this object' and zero or
1083
+ * more arguments. The result is a new function with some arguments of the first
1084
+ * function pre-filled and the value of |this| 'pre-specified'.<br><br>
1085
+ *
1086
+ * Remaining arguments specified at call-time are appended to the pre-
1087
+ * specified ones.<br><br>
1088
+ *
1089
+ * Also see: {@link #partial}.<br><br>
1090
+ *
1091
+ * Usage:
1092
+ * <pre>var barMethBound = bind(myFunction, myObj, 'arg1', 'arg2');
1093
+ * barMethBound('arg3', 'arg4');</pre>
1094
+ *
1095
+ * @param {Function} fn A function to partially apply.
1096
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1097
+ * point to when the function is run.
1098
+ * @param {...*} var_args Additional arguments that are partially
1099
+ * applied to the function.
1100
+ * @return {!Function} A partially-applied form of the function bind() was
1101
+ * invoked as a method of.
1102
+ * @suppress {deprecated} See above.
1103
+ */
1104
+ goog.bind = function(fn, selfObj, var_args) {
1105
+ // TODO(nicksantos): narrow the type signature.
1106
+ if (Function.prototype.bind &&
1107
+ // NOTE(nicksantos): Somebody pulled base.js into the default
1108
+ // Chrome extension environment. This means that for Chrome extensions,
1109
+ // they get the implementation of Function.prototype.bind that
1110
+ // calls goog.bind instead of the native one. Even worse, we don't want
1111
+ // to introduce a circular dependency between goog.bind and
1112
+ // Function.prototype.bind, so we have to hack this to make sure it
1113
+ // works correctly.
1114
+ Function.prototype.bind.toString().indexOf('native code') != -1) {
1115
+ goog.bind = goog.bindNative_;
1116
+ } else {
1117
+ goog.bind = goog.bindJs_;
1118
+ }
1119
+ return goog.bind.apply(null, arguments);
1120
+ };
1121
+
1122
+
1123
+ /**
1124
+ * Like bind(), except that a 'this object' is not required. Useful when the
1125
+ * target function is already bound.
1126
+ *
1127
+ * Usage:
1128
+ * var g = partial(f, arg1, arg2);
1129
+ * g(arg3, arg4);
1130
+ *
1131
+ * @param {Function} fn A function to partially apply.
1132
+ * @param {...*} var_args Additional arguments that are partially
1133
+ * applied to fn.
1134
+ * @return {!Function} A partially-applied form of the function bind() was
1135
+ * invoked as a method of.
1136
+ */
1137
+ goog.partial = function(fn, var_args) {
1138
+ var args = Array.prototype.slice.call(arguments, 1);
1139
+ return function() {
1140
+ // Prepend the bound arguments to the current arguments.
1141
+ var newArgs = Array.prototype.slice.call(arguments);
1142
+ newArgs.unshift.apply(newArgs, args);
1143
+ return fn.apply(this, newArgs);
1144
+ };
1145
+ };
1146
+
1147
+
1148
+ /**
1149
+ * Copies all the members of a source object to a target object. This method
1150
+ * does not work on all browsers for all objects that contain keys such as
1151
+ * toString or hasOwnProperty. Use goog.object.extend for this purpose.
1152
+ * @param {Object} target Target.
1153
+ * @param {Object} source Source.
1154
+ */
1155
+ goog.mixin = function(target, source) {
1156
+ for (var x in source) {
1157
+ target[x] = source[x];
1158
+ }
1159
+
1160
+ // For IE7 or lower, the for-in-loop does not contain any properties that are
1161
+ // not enumerable on the prototype object (for example, isPrototypeOf from
1162
+ // Object.prototype) but also it will not include 'replace' on objects that
1163
+ // extend String and change 'replace' (not that it is common for anyone to
1164
+ // extend anything except Object).
1165
+ };
1166
+
1167
+
1168
+ /**
1169
+ * @return {number} An integer value representing the number of milliseconds
1170
+ * between midnight, January 1, 1970 and the current time.
1171
+ */
1172
+ goog.now = Date.now || (function() {
1173
+ // Unary plus operator converts its operand to a number which in the case of
1174
+ // a date is done by calling getTime().
1175
+ return +new Date();
1176
+ });
1177
+
1178
+
1179
+ /**
1180
+ * Evals javascript in the global scope. In IE this uses execScript, other
1181
+ * browsers use goog.global.eval. If goog.global.eval does not evaluate in the
1182
+ * global scope (for example, in Safari), appends a script tag instead.
1183
+ * Throws an exception if neither execScript or eval is defined.
1184
+ * @param {string} script JavaScript string.
1185
+ */
1186
+ goog.globalEval = function(script) {
1187
+ if (goog.global.execScript) {
1188
+ goog.global.execScript(script, 'JavaScript');
1189
+ } else if (goog.global.eval) {
1190
+ // Test to see if eval works
1191
+ if (goog.evalWorksForGlobals_ == null) {
1192
+ goog.global.eval('var _et_ = 1;');
1193
+ if (typeof goog.global['_et_'] != 'undefined') {
1194
+ delete goog.global['_et_'];
1195
+ goog.evalWorksForGlobals_ = true;
1196
+ } else {
1197
+ goog.evalWorksForGlobals_ = false;
1198
+ }
1199
+ }
1200
+
1201
+ if (goog.evalWorksForGlobals_) {
1202
+ goog.global.eval(script);
1203
+ } else {
1204
+ var doc = goog.global.document;
1205
+ var scriptElt = doc.createElement('script');
1206
+ scriptElt.type = 'text/javascript';
1207
+ scriptElt.defer = false;
1208
+ // Note(user): can't use .innerHTML since "t('<test>')" will fail and
1209
+ // .text doesn't work in Safari 2. Therefore we append a text node.
1210
+ scriptElt.appendChild(doc.createTextNode(script));
1211
+ doc.body.appendChild(scriptElt);
1212
+ doc.body.removeChild(scriptElt);
1213
+ }
1214
+ } else {
1215
+ throw Error('goog.globalEval not available');
1216
+ }
1217
+ };
1218
+
1219
+
1220
+ /**
1221
+ * Indicates whether or not we can call 'eval' directly to eval code in the
1222
+ * global scope. Set to a Boolean by the first call to goog.globalEval (which
1223
+ * empirically tests whether eval works for globals). @see goog.globalEval
1224
+ * @type {?boolean}
1225
+ * @private
1226
+ */
1227
+ goog.evalWorksForGlobals_ = null;
1228
+
1229
+
1230
+ /**
1231
+ * Optional map of CSS class names to obfuscated names used with
1232
+ * goog.getCssName().
1233
+ * @type {Object|undefined}
1234
+ * @private
1235
+ * @see goog.setCssNameMapping
1236
+ */
1237
+ goog.cssNameMapping_;
1238
+
1239
+
1240
+ /**
1241
+ * Optional obfuscation style for CSS class names. Should be set to either
1242
+ * 'BY_WHOLE' or 'BY_PART' if defined.
1243
+ * @type {string|undefined}
1244
+ * @private
1245
+ * @see goog.setCssNameMapping
1246
+ */
1247
+ goog.cssNameMappingStyle_;
1248
+
1249
+
1250
+ /**
1251
+ * Handles strings that are intended to be used as CSS class names.
1252
+ *
1253
+ * This function works in tandem with @see goog.setCssNameMapping.
1254
+ *
1255
+ * Without any mapping set, the arguments are simple joined with a
1256
+ * hyphen and passed through unaltered.
1257
+ *
1258
+ * When there is a mapping, there are two possible styles in which
1259
+ * these mappings are used. In the BY_PART style, each part (i.e. in
1260
+ * between hyphens) of the passed in css name is rewritten according
1261
+ * to the map. In the BY_WHOLE style, the full css name is looked up in
1262
+ * the map directly. If a rewrite is not specified by the map, the
1263
+ * compiler will output a warning.
1264
+ *
1265
+ * When the mapping is passed to the compiler, it will replace calls
1266
+ * to goog.getCssName with the strings from the mapping, e.g.
1267
+ * var x = goog.getCssName('foo');
1268
+ * var y = goog.getCssName(this.baseClass, 'active');
1269
+ * becomes:
1270
+ * var x= 'foo';
1271
+ * var y = this.baseClass + '-active';
1272
+ *
1273
+ * If one argument is passed it will be processed, if two are passed
1274
+ * only the modifier will be processed, as it is assumed the first
1275
+ * argument was generated as a result of calling goog.getCssName.
1276
+ *
1277
+ * @param {string} className The class name.
1278
+ * @param {string=} opt_modifier A modifier to be appended to the class name.
1279
+ * @return {string} The class name or the concatenation of the class name and
1280
+ * the modifier.
1281
+ */
1282
+ goog.getCssName = function(className, opt_modifier) {
1283
+ var getMapping = function(cssName) {
1284
+ return goog.cssNameMapping_[cssName] || cssName;
1285
+ };
1286
+
1287
+ var renameByParts = function(cssName) {
1288
+ // Remap all the parts individually.
1289
+ var parts = cssName.split('-');
1290
+ var mapped = [];
1291
+ for (var i = 0; i < parts.length; i++) {
1292
+ mapped.push(getMapping(parts[i]));
1293
+ }
1294
+ return mapped.join('-');
1295
+ };
1296
+
1297
+ var rename;
1298
+ if (goog.cssNameMapping_) {
1299
+ rename = goog.cssNameMappingStyle_ == 'BY_WHOLE' ?
1300
+ getMapping : renameByParts;
1301
+ } else {
1302
+ rename = function(a) {
1303
+ return a;
1304
+ };
1305
+ }
1306
+
1307
+ if (opt_modifier) {
1308
+ return className + '-' + rename(opt_modifier);
1309
+ } else {
1310
+ return rename(className);
1311
+ }
1312
+ };
1313
+
1314
+
1315
+ /**
1316
+ * Sets the map to check when returning a value from goog.getCssName(). Example:
1317
+ * <pre>
1318
+ * goog.setCssNameMapping({
1319
+ * "goog": "a",
1320
+ * "disabled": "b",
1321
+ * });
1322
+ *
1323
+ * var x = goog.getCssName('goog');
1324
+ * // The following evaluates to: "a a-b".
1325
+ * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')
1326
+ * </pre>
1327
+ * When declared as a map of string literals to string literals, the JSCompiler
1328
+ * will replace all calls to goog.getCssName() using the supplied map if the
1329
+ * --closure_pass flag is set.
1330
+ *
1331
+ * @param {!Object} mapping A map of strings to strings where keys are possible
1332
+ * arguments to goog.getCssName() and values are the corresponding values
1333
+ * that should be returned.
1334
+ * @param {string=} opt_style The style of css name mapping. There are two valid
1335
+ * options: 'BY_PART', and 'BY_WHOLE'.
1336
+ * @see goog.getCssName for a description.
1337
+ */
1338
+ goog.setCssNameMapping = function(mapping, opt_style) {
1339
+ goog.cssNameMapping_ = mapping;
1340
+ goog.cssNameMappingStyle_ = opt_style;
1341
+ };
1342
+
1343
+
1344
+ /**
1345
+ * To use CSS renaming in compiled mode, one of the input files should have a
1346
+ * call to goog.setCssNameMapping() with an object literal that the JSCompiler
1347
+ * can extract and use to replace all calls to goog.getCssName(). In uncompiled
1348
+ * mode, JavaScript code should be loaded before this base.js file that declares
1349
+ * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is
1350
+ * to ensure that the mapping is loaded before any calls to goog.getCssName()
1351
+ * are made in uncompiled mode.
1352
+ *
1353
+ * A hook for overriding the CSS name mapping.
1354
+ * @type {Object|undefined}
1355
+ */
1356
+ goog.global.CLOSURE_CSS_NAME_MAPPING;
1357
+
1358
+
1359
+ if (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {
1360
+ // This does not call goog.setCssNameMapping() because the JSCompiler
1361
+ // requires that goog.setCssNameMapping() be called with an object literal.
1362
+ goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;
1363
+ }
1364
+
1365
+
1366
+ /**
1367
+ * Abstract implementation of goog.getMsg for use with localized messages.
1368
+ * @param {string} str Translatable string, places holders in the form {$foo}.
1369
+ * @param {Object=} opt_values Map of place holder name to value.
1370
+ * @return {string} message with placeholders filled.
1371
+ */
1372
+ goog.getMsg = function(str, opt_values) {
1373
+ var values = opt_values || {};
1374
+ for (var key in values) {
1375
+ var value = ('' + values[key]).replace(/\$/g, '$$$$');
1376
+ str = str.replace(new RegExp('\\{\\$' + key + '\\}', 'gi'), value);
1377
+ }
1378
+ return str;
1379
+ };
1380
+
1381
+
1382
+ /**
1383
+ * Exposes an unobfuscated global namespace path for the given object.
1384
+ * Note that fields of the exported object *will* be obfuscated,
1385
+ * unless they are exported in turn via this function or
1386
+ * goog.exportProperty
1387
+ *
1388
+ * <p>Also handy for making public items that are defined in anonymous
1389
+ * closures.
1390
+ *
1391
+ * ex. goog.exportSymbol('Foo', Foo);
1392
+ *
1393
+ * ex. goog.exportSymbol('public.path.Foo.staticFunction',
1394
+ * Foo.staticFunction);
1395
+ * public.path.Foo.staticFunction();
1396
+ *
1397
+ * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',
1398
+ * Foo.prototype.myMethod);
1399
+ * new public.path.Foo().myMethod();
1400
+ *
1401
+ * @param {string} publicPath Unobfuscated name to export.
1402
+ * @param {*} object Object the name should point to.
1403
+ * @param {Object=} opt_objectToExportTo The object to add the path to; default
1404
+ * is |goog.global|.
1405
+ */
1406
+ goog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {
1407
+ goog.exportPath_(publicPath, object, opt_objectToExportTo);
1408
+ };
1409
+
1410
+
1411
+ /**
1412
+ * Exports a property unobfuscated into the object's namespace.
1413
+ * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);
1414
+ * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);
1415
+ * @param {Object} object Object whose static property is being exported.
1416
+ * @param {string} publicName Unobfuscated name to export.
1417
+ * @param {*} symbol Object the name should point to.
1418
+ */
1419
+ goog.exportProperty = function(object, publicName, symbol) {
1420
+ object[publicName] = symbol;
1421
+ };
1422
+
1423
+
1424
+ /**
1425
+ * Inherit the prototype methods from one constructor into another.
1426
+ *
1427
+ * Usage:
1428
+ * <pre>
1429
+ * function ParentClass(a, b) { }
1430
+ * ParentClass.prototype.foo = function(a) { }
1431
+ *
1432
+ * function ChildClass(a, b, c) {
1433
+ * goog.base(this, a, b);
1434
+ * }
1435
+ * goog.inherits(ChildClass, ParentClass);
1436
+ *
1437
+ * var child = new ChildClass('a', 'b', 'see');
1438
+ * child.foo(); // works
1439
+ * </pre>
1440
+ *
1441
+ * In addition, a superclass' implementation of a method can be invoked
1442
+ * as follows:
1443
+ *
1444
+ * <pre>
1445
+ * ChildClass.prototype.foo = function(a) {
1446
+ * ChildClass.superClass_.foo.call(this, a);
1447
+ * // other code
1448
+ * };
1449
+ * </pre>
1450
+ *
1451
+ * @param {Function} childCtor Child class.
1452
+ * @param {Function} parentCtor Parent class.
1453
+ */
1454
+ goog.inherits = function(childCtor, parentCtor) {
1455
+ /** @constructor */
1456
+ function tempCtor() {};
1457
+ tempCtor.prototype = parentCtor.prototype;
1458
+ childCtor.superClass_ = parentCtor.prototype;
1459
+ childCtor.prototype = new tempCtor();
1460
+ childCtor.prototype.constructor = childCtor;
1461
+ };
1462
+
1463
+
1464
+ /**
1465
+ * Call up to the superclass.
1466
+ *
1467
+ * If this is called from a constructor, then this calls the superclass
1468
+ * contructor with arguments 1-N.
1469
+ *
1470
+ * If this is called from a prototype method, then you must pass
1471
+ * the name of the method as the second argument to this function. If
1472
+ * you do not, you will get a runtime error. This calls the superclass'
1473
+ * method with arguments 2-N.
1474
+ *
1475
+ * This function only works if you use goog.inherits to express
1476
+ * inheritance relationships between your classes.
1477
+ *
1478
+ * This function is a compiler primitive. At compile-time, the
1479
+ * compiler will do macro expansion to remove a lot of
1480
+ * the extra overhead that this function introduces. The compiler
1481
+ * will also enforce a lot of the assumptions that this function
1482
+ * makes, and treat it as a compiler error if you break them.
1483
+ *
1484
+ * @param {!Object} me Should always be "this".
1485
+ * @param {*=} opt_methodName The method name if calling a super method.
1486
+ * @param {...*} var_args The rest of the arguments.
1487
+ * @return {*} The return value of the superclass method.
1488
+ */
1489
+ goog.base = function(me, opt_methodName, var_args) {
1490
+ var caller = arguments.callee.caller;
1491
+ if (caller.superClass_) {
1492
+ // This is a constructor. Call the superclass constructor.
1493
+ return caller.superClass_.constructor.apply(
1494
+ me, Array.prototype.slice.call(arguments, 1));
1495
+ }
1496
+
1497
+ var args = Array.prototype.slice.call(arguments, 2);
1498
+ var foundCaller = false;
1499
+ for (var ctor = me.constructor;
1500
+ ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) {
1501
+ if (ctor.prototype[opt_methodName] === caller) {
1502
+ foundCaller = true;
1503
+ } else if (foundCaller) {
1504
+ return ctor.prototype[opt_methodName].apply(me, args);
1505
+ }
1506
+ }
1507
+
1508
+ // If we did not find the caller in the prototype chain,
1509
+ // then one of two things happened:
1510
+ // 1) The caller is an instance method.
1511
+ // 2) This method was not called by the right caller.
1512
+ if (me[opt_methodName] === caller) {
1513
+ return me.constructor.prototype[opt_methodName].apply(me, args);
1514
+ } else {
1515
+ throw Error(
1516
+ 'goog.base called from a method of one name ' +
1517
+ 'to a method of a different name');
1518
+ }
1519
+ };
1520
+
1521
+
1522
+ /**
1523
+ * Allow for aliasing within scope functions. This function exists for
1524
+ * uncompiled code - in compiled code the calls will be inlined and the
1525
+ * aliases applied. In uncompiled code the function is simply run since the
1526
+ * aliases as written are valid JavaScript.
1527
+ * @param {function()} fn Function to call. This function can contain aliases
1528
+ * to namespaces (e.g. "var dom = goog.dom") or classes
1529
+ * (e.g. "var Timer = goog.Timer").
1530
+ */
1531
+ goog.scope = function(fn) {
1532
+ fn.call(goog.global);
1533
+ };
1534
+
1535
+
1536
+ ;
1537
+ FI"asset_paths;
1538
+ F["_/Volumes/Development/dev-web/yellow-brick-road/vendor/closure-library/closure/goog/base.jsI"dependency_paths;
1539
+ F[{I" path;
1540
+ F"_/Volumes/Development/dev-web/yellow-brick-road/vendor/closure-library/closure/goog/base.jsI"
1541
+ mtime;
1542
+ FIu: Time
1543
+ T: offsetiI"hexdigest;
1544
+ F"%112973cfd6fe1ba93322179fcf0d181bI"
1545
+ F"%46dde6621c301f4928e3b34efee9e3b5