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,1088 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325441615.695779: @value{ I" length:EFiZ�I" digest;
2
+ F"%de995f132bd79d6da6945b9a955480fdI" source;
3
+ FI"Z�// Copyright 2006 The Closure Library Authors. All Rights Reserved.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS-IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+
17
+ /**
18
+ * @fileoverview Wrapper class for handling XmlHttpRequests.
19
+ *
20
+ * One off requests can be sent through goog.net.XhrIo.send() or an
21
+ * instance can be created to send multiple requests. Each request uses its
22
+ * own XmlHttpRequest object and handles clearing of the event callback to
23
+ * ensure no leaks.
24
+ *
25
+ * XhrIo is event based, it dispatches events when a request finishes, fails or
26
+ * succeeds or when the ready-state changes. The ready-state or timeout event
27
+ * fires first, followed by a generic completed event. Then the abort, error,
28
+ * or success event is fired as appropriate. Lastly, the ready event will fire
29
+ * to indicate that the object may be used to make another request.
30
+ *
31
+ * The error event may also be called before completed and
32
+ * ready-state-change if the XmlHttpRequest.open() or .send() methods throw.
33
+ *
34
+ * This class does not support multiple requests, queuing, or prioritization.
35
+ *
36
+ * Tested = IE6, FF1.5, Safari, Opera 8.5
37
+ *
38
+ * TODO(user): Error cases aren't playing nicely in Safari.
39
+ *
40
+ */
41
+
42
+
43
+
44
+ goog.provide('goog.net.XhrIo');
45
+ goog.provide('goog.net.XhrIo.ResponseType');
46
+
47
+ goog.require('goog.Timer');
48
+ goog.require('goog.debug.Logger');
49
+ goog.require('goog.debug.entryPointRegistry');
50
+ goog.require('goog.debug.errorHandlerWeakDep');
51
+ goog.require('goog.events.EventTarget');
52
+ goog.require('goog.json');
53
+ goog.require('goog.net.ErrorCode');
54
+ goog.require('goog.net.EventType');
55
+ goog.require('goog.net.HttpStatus');
56
+ goog.require('goog.net.XmlHttp');
57
+ goog.require('goog.object');
58
+ goog.require('goog.structs');
59
+ goog.require('goog.structs.Map');
60
+ goog.require('goog.uri.utils');
61
+
62
+
63
+
64
+ /**
65
+ * Basic class for handling XMLHttpRequests.
66
+ * @param {goog.net.XmlHttpFactory=} opt_xmlHttpFactory Factory to use when
67
+ * creating XMLHttpRequest objects.
68
+ * @constructor
69
+ * @extends {goog.events.EventTarget}
70
+ */
71
+ goog.net.XhrIo = function(opt_xmlHttpFactory) {
72
+ goog.events.EventTarget.call(this);
73
+
74
+ /**
75
+ * Map of default headers to add to every request, use:
76
+ * XhrIo.headers.set(name, value)
77
+ * @type {goog.structs.Map}
78
+ */
79
+ this.headers = new goog.structs.Map();
80
+
81
+ /**
82
+ * Optional XmlHttpFactory
83
+ * @type {goog.net.XmlHttpFactory}
84
+ * @private
85
+ */
86
+ this.xmlHttpFactory_ = opt_xmlHttpFactory || null;
87
+ };
88
+ goog.inherits(goog.net.XhrIo, goog.events.EventTarget);
89
+
90
+
91
+ /**
92
+ * Response types that may be requested for XMLHttpRequests.
93
+ * @enum {string}
94
+ * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute
95
+ */
96
+ goog.net.XhrIo.ResponseType = {
97
+ DEFAULT: '',
98
+ TEXT: 'text',
99
+ DOCUMENT: 'document',
100
+ // Not supported as of Chrome 10.0.612.1 dev
101
+ BLOB: 'blob',
102
+ ARRAY_BUFFER: 'arraybuffer'
103
+ };
104
+
105
+
106
+ /**
107
+ * A reference to the XhrIo logger
108
+ * @type {goog.debug.Logger}
109
+ * @private
110
+ */
111
+ goog.net.XhrIo.prototype.logger_ =
112
+ goog.debug.Logger.getLogger('goog.net.XhrIo');
113
+
114
+
115
+ /**
116
+ * The Content-Type HTTP header name
117
+ * @type {string}
118
+ */
119
+ goog.net.XhrIo.CONTENT_TYPE_HEADER = 'Content-Type';
120
+
121
+
122
+ /**
123
+ * The pattern matching the 'http' and 'https' URI schemes
124
+ * @type {!RegExp}
125
+ */
126
+ goog.net.XhrIo.HTTP_SCHEME_PATTERN = /^https?$/i;
127
+
128
+
129
+ /**
130
+ * The Content-Type HTTP header value for a url-encoded form
131
+ * @type {string}
132
+ */
133
+ goog.net.XhrIo.FORM_CONTENT_TYPE =
134
+ 'application/x-www-form-urlencoded;charset=utf-8';
135
+
136
+
137
+ /**
138
+ * All non-disposed instances of goog.net.XhrIo created
139
+ * by {@link goog.net.XhrIo.send} are in this Array.
140
+ * @see goog.net.XhrIo.cleanup
141
+ * @type {Array.<goog.net.XhrIo>}
142
+ * @private
143
+ */
144
+ goog.net.XhrIo.sendInstances_ = [];
145
+
146
+
147
+ /**
148
+ * Static send that creates a short lived instance of XhrIo to send the
149
+ * request.
150
+ * @see goog.net.XhrIo.cleanup
151
+ * @param {string|goog.Uri} url Uri to make request to.
152
+ * @param {Function=} opt_callback Callback function for when request is
153
+ * complete.
154
+ * @param {string=} opt_method Send method, default: GET.
155
+ * @param {string|GearsBlob=} opt_content Post data. This can be a Gears blob
156
+ * if the underlying HTTP request object is a Gears HTTP request.
157
+ * @param {Object|goog.structs.Map=} opt_headers Map of headers to add to the
158
+ * request.
159
+ * @param {number=} opt_timeoutInterval Number of milliseconds after which an
160
+ * incomplete request will be aborted; 0 means no timeout is set.
161
+ */
162
+ goog.net.XhrIo.send = function(url, opt_callback, opt_method, opt_content,
163
+ opt_headers, opt_timeoutInterval) {
164
+ var x = new goog.net.XhrIo();
165
+ goog.net.XhrIo.sendInstances_.push(x);
166
+ if (opt_callback) {
167
+ goog.events.listen(x, goog.net.EventType.COMPLETE, opt_callback);
168
+ }
169
+ goog.events.listen(x,
170
+ goog.net.EventType.READY,
171
+ goog.partial(goog.net.XhrIo.cleanupSend_, x));
172
+ if (opt_timeoutInterval) {
173
+ x.setTimeoutInterval(opt_timeoutInterval);
174
+ }
175
+ x.send(url, opt_method, opt_content, opt_headers);
176
+ };
177
+
178
+
179
+ /**
180
+ * Disposes all non-disposed instances of goog.net.XhrIo created by
181
+ * {@link goog.net.XhrIo.send}.
182
+ * {@link goog.net.XhrIo.send} cleans up the goog.net.XhrIo instance
183
+ * it creates when the request completes or fails. However, if
184
+ * the request never completes, then the goog.net.XhrIo is not disposed.
185
+ * This can occur if the window is unloaded before the request completes.
186
+ * We could have {@link goog.net.XhrIo.send} return the goog.net.XhrIo
187
+ * it creates and make the client of {@link goog.net.XhrIo.send} be
188
+ * responsible for disposing it in this case. However, this makes things
189
+ * significantly more complicated for the client, and the whole point
190
+ * of {@link goog.net.XhrIo.send} is that it's simple and easy to use.
191
+ * Clients of {@link goog.net.XhrIo.send} should call
192
+ * {@link goog.net.XhrIo.cleanup} when doing final
193
+ * cleanup on window unload.
194
+ */
195
+ goog.net.XhrIo.cleanup = function() {
196
+ var instances = goog.net.XhrIo.sendInstances_;
197
+ while (instances.length) {
198
+ instances.pop().dispose();
199
+ }
200
+ };
201
+
202
+
203
+ /**
204
+ * Installs exception protection for all entry point introduced by
205
+ * goog.net.XhrIo instances which are not protected by
206
+ * {@link goog.debug.ErrorHandler#protectWindowSetTimeout},
207
+ * {@link goog.debug.ErrorHandler#protectWindowSetInterval}, or
208
+ * {@link goog.events.protectBrowserEventEntryPoint}.
209
+ *
210
+ * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to
211
+ * protect the entry point(s).
212
+ */
213
+ goog.net.XhrIo.protectEntryPoints = function(errorHandler) {
214
+ goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =
215
+ errorHandler.protectEntryPoint(
216
+ goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);
217
+ };
218
+
219
+
220
+ /**
221
+ * Disposes of the specified goog.net.XhrIo created by
222
+ * {@link goog.net.XhrIo.send} and removes it from
223
+ * {@link goog.net.XhrIo.pendingStaticSendInstances_}.
224
+ * @param {goog.net.XhrIo} XhrIo An XhrIo created by
225
+ * {@link goog.net.XhrIo.send}.
226
+ * @private
227
+ */
228
+ goog.net.XhrIo.cleanupSend_ = function(XhrIo) {
229
+ XhrIo.dispose();
230
+ goog.array.remove(goog.net.XhrIo.sendInstances_, XhrIo);
231
+ };
232
+
233
+
234
+ /**
235
+ * Whether XMLHttpRequest is active. A request is active from the time send()
236
+ * is called until onReadyStateChange() is complete, or error() or abort()
237
+ * is called.
238
+ * @type {boolean}
239
+ * @private
240
+ */
241
+ goog.net.XhrIo.prototype.active_ = false;
242
+
243
+
244
+ /**
245
+ * Reference to an XMLHttpRequest object that is being used for the transfer.
246
+ * @type {XMLHttpRequest|GearsHttpRequest}
247
+ * @private
248
+ */
249
+ goog.net.XhrIo.prototype.xhr_ = null;
250
+
251
+
252
+ /**
253
+ * The options to use with the current XMLHttpRequest object.
254
+ * @type {Object}
255
+ * @private
256
+ */
257
+ goog.net.XhrIo.prototype.xhrOptions_ = null;
258
+
259
+
260
+ /**
261
+ * Last URL that was requested.
262
+ * @type {string|goog.Uri}
263
+ * @private
264
+ */
265
+ goog.net.XhrIo.prototype.lastUri_ = '';
266
+
267
+
268
+ /**
269
+ * Method for the last request.
270
+ * @type {string}
271
+ * @private
272
+ */
273
+ goog.net.XhrIo.prototype.lastMethod_ = '';
274
+
275
+
276
+ /**
277
+ * Last error code.
278
+ * @type {goog.net.ErrorCode}
279
+ * @private
280
+ */
281
+ goog.net.XhrIo.prototype.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;
282
+
283
+
284
+ /**
285
+ * Last error message.
286
+ * @type {Error|string}
287
+ * @private
288
+ */
289
+ goog.net.XhrIo.prototype.lastError_ = '';
290
+
291
+
292
+ /**
293
+ * This is used to ensure that we don't dispatch an multiple ERROR events. This
294
+ * can happen in IE when it does a synchronous load and one error is handled in
295
+ * the ready statte change and one is handled due to send() throwing an
296
+ * exception.
297
+ * @type {boolean}
298
+ * @private
299
+ */
300
+ goog.net.XhrIo.prototype.errorDispatched_ = false;
301
+
302
+
303
+ /**
304
+ * Used to make sure we don't fire the complete event from inside a send call.
305
+ * @type {boolean}
306
+ * @private
307
+ */
308
+ goog.net.XhrIo.prototype.inSend_ = false;
309
+
310
+
311
+ /**
312
+ * Used in determining if a call to {@link #onReadyStateChange_} is from within
313
+ * a call to this.xhr_.open.
314
+ * @type {boolean}
315
+ * @private
316
+ */
317
+ goog.net.XhrIo.prototype.inOpen_ = false;
318
+
319
+
320
+ /**
321
+ * Used in determining if a call to {@link #onReadyStateChange_} is from within
322
+ * a call to this.xhr_.abort.
323
+ * @type {boolean}
324
+ * @private
325
+ */
326
+ goog.net.XhrIo.prototype.inAbort_ = false;
327
+
328
+
329
+ /**
330
+ * Number of milliseconds after which an incomplete request will be aborted and
331
+ * a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no timeout is set.
332
+ * @type {number}
333
+ * @private
334
+ */
335
+ goog.net.XhrIo.prototype.timeoutInterval_ = 0;
336
+
337
+
338
+ /**
339
+ * Window timeout ID used to cancel the timeout event handler if the request
340
+ * completes successfully.
341
+ * @type {Object}
342
+ * @private
343
+ */
344
+ goog.net.XhrIo.prototype.timeoutId_ = null;
345
+
346
+
347
+ /**
348
+ * The requested type for the response. The empty string means use the default
349
+ * XHR behavior.
350
+ * @type {goog.net.XhrIo.ResponseType}
351
+ * @private
352
+ */
353
+ goog.net.XhrIo.prototype.responseType_ = goog.net.XhrIo.ResponseType.DEFAULT;
354
+
355
+
356
+ /**
357
+ * Whether a "credentialed" request is to be sent (one that is aware of cookies
358
+ * and authentication) . This is applicable only for cross-domain requests and
359
+ * more recent browsers that support this part of the HTTP Access Control
360
+ * standard.
361
+ *
362
+ * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#withcredentials
363
+ *
364
+ * @type {boolean}
365
+ * @private
366
+ */
367
+ goog.net.XhrIo.prototype.withCredentials_ = false;
368
+
369
+
370
+ /**
371
+ * Returns the number of milliseconds after which an incomplete request will be
372
+ * aborted, or 0 if no timeout is set.
373
+ * @return {number} Timeout interval in milliseconds.
374
+ */
375
+ goog.net.XhrIo.prototype.getTimeoutInterval = function() {
376
+ return this.timeoutInterval_;
377
+ };
378
+
379
+
380
+ /**
381
+ * Sets the number of milliseconds after which an incomplete request will be
382
+ * aborted and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no
383
+ * timeout is set.
384
+ * @param {number} ms Timeout interval in milliseconds; 0 means none.
385
+ */
386
+ goog.net.XhrIo.prototype.setTimeoutInterval = function(ms) {
387
+ this.timeoutInterval_ = Math.max(0, ms);
388
+ };
389
+
390
+
391
+ /**
392
+ * Sets the desired type for the response. At time of writing, this is only
393
+ * supported in very recent versions of WebKit (10.0.612.1 dev and later).
394
+ *
395
+ * If this is used, the response may only be accessed via {@link #getResponse}.
396
+ *
397
+ * @param {goog.net.XhrIo.ResponseType} type The desired type for the response.
398
+ */
399
+ goog.net.XhrIo.prototype.setResponseType = function(type) {
400
+ this.responseType_ = type;
401
+ };
402
+
403
+
404
+ /**
405
+ * Gets the desired type for the response.
406
+ * @return {goog.net.XhrIo.ResponseType} The desired type for the response.
407
+ */
408
+ goog.net.XhrIo.prototype.getResponseType = function() {
409
+ return this.responseType_;
410
+ };
411
+
412
+
413
+ /**
414
+ * Sets whether a "credentialed" request that is aware of cookie and
415
+ * authentication information should be made. This option is only supported by
416
+ * browsers that support HTTP Access Control. As of this writing, this option
417
+ * is not supported in IE.
418
+ *
419
+ * @param {boolean} withCredentials Whether this should be a "credentialed"
420
+ * request.
421
+ */
422
+ goog.net.XhrIo.prototype.setWithCredentials = function(withCredentials) {
423
+ this.withCredentials_ = withCredentials;
424
+ };
425
+
426
+
427
+ /**
428
+ * Gets whether a "credentialed" request is to be sent.
429
+ * @return {boolean} The desired type for the response.
430
+ */
431
+ goog.net.XhrIo.prototype.getWithCredentials = function() {
432
+ return this.withCredentials_;
433
+ };
434
+
435
+
436
+ /**
437
+ * Instance send that actually uses XMLHttpRequest to make a server call.
438
+ * @param {string|goog.Uri} url Uri to make request to.
439
+ * @param {string=} opt_method Send method, default: GET.
440
+ * @param {string|GearsBlob=} opt_content Post data. This can be a Gears blob
441
+ * if the underlying HTTP request object is a Gears HTTP request.
442
+ * @param {Object|goog.structs.Map=} opt_headers Map of headers to add to the
443
+ * request.
444
+ */
445
+ goog.net.XhrIo.prototype.send = function(url, opt_method, opt_content,
446
+ opt_headers) {
447
+ if (this.xhr_) {
448
+ throw Error('[goog.net.XhrIo] Object is active with another request');
449
+ }
450
+
451
+ var method = opt_method ? opt_method.toUpperCase() : 'GET';
452
+
453
+ this.lastUri_ = url;
454
+ this.lastError_ = '';
455
+ this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;
456
+ this.lastMethod_ = method;
457
+ this.errorDispatched_ = false;
458
+ this.active_ = true;
459
+
460
+ // Use the factory to create the XHR object and options
461
+ this.xhr_ = this.createXhr();
462
+ this.xhrOptions_ = this.xmlHttpFactory_ ?
463
+ this.xmlHttpFactory_.getOptions() : goog.net.XmlHttp.getOptions();
464
+
465
+ // Set up the onreadystatechange callback
466
+ this.xhr_.onreadystatechange = goog.bind(this.onReadyStateChange_, this);
467
+
468
+ /**
469
+ * Try to open the XMLHttpRequest (always async), if an error occurs here it
470
+ * is generally permission denied
471
+ * @preserveTry
472
+ */
473
+ try {
474
+ this.logger_.fine(this.formatMsg_('Opening Xhr'));
475
+ this.inOpen_ = true;
476
+ this.xhr_.open(method, url, true); // Always async!
477
+ this.inOpen_ = false;
478
+ } catch (err) {
479
+ this.logger_.fine(this.formatMsg_('Error opening Xhr: ' + err.message));
480
+ this.error_(goog.net.ErrorCode.EXCEPTION, err);
481
+ return;
482
+ }
483
+
484
+ // We can't use null since this won't allow POSTs to have a content length
485
+ // specified which will cause some proxies to return a 411 error.
486
+ var content = opt_content || '';
487
+
488
+ var headers = this.headers.clone();
489
+
490
+ // Add headers specific to this request
491
+ if (opt_headers) {
492
+ goog.structs.forEach(opt_headers, function(value, key) {
493
+ headers.set(key, value);
494
+ });
495
+ }
496
+
497
+ if (method == 'POST' &&
498
+ !headers.containsKey(goog.net.XhrIo.CONTENT_TYPE_HEADER)) {
499
+ // For POST requests, default to the url-encoded form content type.
500
+ headers.set(goog.net.XhrIo.CONTENT_TYPE_HEADER,
501
+ goog.net.XhrIo.FORM_CONTENT_TYPE);
502
+ }
503
+
504
+ // Add the headers to the Xhr object
505
+ goog.structs.forEach(headers, function(value, key) {
506
+ this.xhr_.setRequestHeader(key, value);
507
+ }, this);
508
+
509
+ if (this.responseType_) {
510
+ this.xhr_.responseType = this.responseType_;
511
+ }
512
+
513
+ if (goog.object.containsKey(this.xhr_, 'withCredentials')) {
514
+ this.xhr_.withCredentials = this.withCredentials_;
515
+ }
516
+
517
+ /**
518
+ * Try to send the request, or other wise report an error (404 not found).
519
+ * @preserveTry
520
+ */
521
+ try {
522
+ if (this.timeoutId_) {
523
+ // This should never happen, since the if (this.active_) above shouldn't
524
+ // let execution reach this point if there is a request in progress...
525
+ goog.Timer.defaultTimerObject.clearTimeout(this.timeoutId_);
526
+ this.timeoutId_ = null;
527
+ }
528
+ if (this.timeoutInterval_ > 0) {
529
+ this.logger_.fine(this.formatMsg_('Will abort after ' +
530
+ this.timeoutInterval_ + 'ms if incomplete'));
531
+ this.timeoutId_ = goog.Timer.defaultTimerObject.setTimeout(
532
+ goog.bind(this.timeout_, this), this.timeoutInterval_);
533
+ }
534
+ this.logger_.fine(this.formatMsg_('Sending request'));
535
+ this.inSend_ = true;
536
+ this.xhr_.send(content);
537
+ this.inSend_ = false;
538
+
539
+ } catch (err) {
540
+ this.logger_.fine(this.formatMsg_('Send error: ' + err.message));
541
+ this.error_(goog.net.ErrorCode.EXCEPTION, err);
542
+ }
543
+ };
544
+
545
+
546
+ /**
547
+ * Creates a new XHR object.
548
+ * @return {XMLHttpRequest|GearsHttpRequest} The newly created XHR object.
549
+ * @protected
550
+ */
551
+ goog.net.XhrIo.prototype.createXhr = function() {
552
+ return this.xmlHttpFactory_ ?
553
+ this.xmlHttpFactory_.createInstance() : goog.net.XmlHttp();
554
+ };
555
+
556
+
557
+ /**
558
+ * The request didn't complete after {@link goog.net.XhrIo#timeoutInterval_}
559
+ * milliseconds; raises a {@link goog.net.EventType.TIMEOUT} event and aborts
560
+ * the request.
561
+ * @private
562
+ */
563
+ goog.net.XhrIo.prototype.timeout_ = function() {
564
+ if (typeof goog == 'undefined') {
565
+ // If goog is undefined then the callback has occurred as the application
566
+ // is unloading and will error. Thus we let it silently fail.
567
+ } else if (this.xhr_) {
568
+ this.lastError_ = 'Timed out after ' + this.timeoutInterval_ +
569
+ 'ms, aborting';
570
+ this.lastErrorCode_ = goog.net.ErrorCode.TIMEOUT;
571
+ this.logger_.fine(this.formatMsg_(this.lastError_));
572
+ this.dispatchEvent(goog.net.EventType.TIMEOUT);
573
+ this.abort(goog.net.ErrorCode.TIMEOUT);
574
+ }
575
+ };
576
+
577
+
578
+ /**
579
+ * Something errorred, so inactivate, fire error callback and clean up
580
+ * @param {goog.net.ErrorCode} errorCode The error code.
581
+ * @param {Error} err The error object.
582
+ * @private
583
+ */
584
+ goog.net.XhrIo.prototype.error_ = function(errorCode, err) {
585
+ this.active_ = false;
586
+ if (this.xhr_) {
587
+ this.inAbort_ = true;
588
+ this.xhr_.abort(); // Ensures XHR isn't hung (FF)
589
+ this.inAbort_ = false;
590
+ }
591
+ this.lastError_ = err;
592
+ this.lastErrorCode_ = errorCode;
593
+ this.dispatchErrors_();
594
+ this.cleanUpXhr_();
595
+ };
596
+
597
+
598
+ /**
599
+ * Dispatches COMPLETE and ERROR in case of an error. This ensures that we do
600
+ * not dispatch multiple error events.
601
+ * @private
602
+ */
603
+ goog.net.XhrIo.prototype.dispatchErrors_ = function() {
604
+ if (!this.errorDispatched_) {
605
+ this.errorDispatched_ = true;
606
+ this.dispatchEvent(goog.net.EventType.COMPLETE);
607
+ this.dispatchEvent(goog.net.EventType.ERROR);
608
+ }
609
+ };
610
+
611
+
612
+ /**
613
+ * Abort the current XMLHttpRequest
614
+ * @param {goog.net.ErrorCode=} opt_failureCode Optional error code to use -
615
+ * defaults to ABORT.
616
+ */
617
+ goog.net.XhrIo.prototype.abort = function(opt_failureCode) {
618
+ if (this.xhr_ && this.active_) {
619
+ this.logger_.fine(this.formatMsg_('Aborting'));
620
+ this.active_ = false;
621
+ this.inAbort_ = true;
622
+ this.xhr_.abort();
623
+ this.inAbort_ = false;
624
+ this.lastErrorCode_ = opt_failureCode || goog.net.ErrorCode.ABORT;
625
+ this.dispatchEvent(goog.net.EventType.COMPLETE);
626
+ this.dispatchEvent(goog.net.EventType.ABORT);
627
+ this.cleanUpXhr_();
628
+ }
629
+ };
630
+
631
+
632
+ /**
633
+ * Nullifies all callbacks to reduce risks of leaks.
634
+ * @override
635
+ * @protected
636
+ */
637
+ goog.net.XhrIo.prototype.disposeInternal = function() {
638
+ if (this.xhr_) {
639
+ // We explicitly do not call xhr_.abort() unless active_ is still true.
640
+ // This is to avoid unnecessarily aborting a successful request when
641
+ // dispose() is called in a callback triggered by a complete response, but
642
+ // in which browser cleanup has not yet finished.
643
+ // (See http://b/issue?id=1684217.)
644
+ if (this.active_) {
645
+ this.active_ = false;
646
+ this.inAbort_ = true;
647
+ this.xhr_.abort();
648
+ this.inAbort_ = false;
649
+ }
650
+ this.cleanUpXhr_(true);
651
+ }
652
+
653
+ goog.net.XhrIo.superClass_.disposeInternal.call(this);
654
+ };
655
+
656
+
657
+ /**
658
+ * Internal handler for the XHR object's readystatechange event. This method
659
+ * checks the status and the readystate and fires the correct callbacks.
660
+ * If the request has ended, the handlers are cleaned up and the XHR object is
661
+ * nullified.
662
+ * @private
663
+ */
664
+ goog.net.XhrIo.prototype.onReadyStateChange_ = function() {
665
+ if (!this.inOpen_ && !this.inSend_ && !this.inAbort_) {
666
+ // Were not being called from within a call to this.xhr_.send
667
+ // this.xhr_.abort, or this.xhr_.open, so this is an entry point
668
+ this.onReadyStateChangeEntryPoint_();
669
+ } else {
670
+ this.onReadyStateChangeHelper_();
671
+ }
672
+ };
673
+
674
+
675
+ /**
676
+ * Used to protect the onreadystatechange handler entry point. Necessary
677
+ * as {#onReadyStateChange_} maybe called from within send or abort, this
678
+ * method is only called when {#onReadyStateChange_} is called as an
679
+ * entry point.
680
+ * {@see #protectEntryPoints}
681
+ * @private
682
+ */
683
+ goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = function() {
684
+ this.onReadyStateChangeHelper_();
685
+ };
686
+
687
+
688
+ /**
689
+ * Helper for {@link #onReadyStateChange_}. This is used so that
690
+ * entry point calls to {@link #onReadyStateChange_} can be routed through
691
+ * {@link #onReadyStateChangeEntryPoint_}.
692
+ * @private
693
+ */
694
+ goog.net.XhrIo.prototype.onReadyStateChangeHelper_ = function() {
695
+ if (!this.active_) {
696
+ // can get called inside abort call
697
+ return;
698
+ }
699
+
700
+ if (typeof goog == 'undefined') {
701
+ // NOTE(user): If goog is undefined then the callback has occurred as the
702
+ // application is unloading and will error. Thus we let it silently fail.
703
+
704
+ } else if (
705
+ this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] &&
706
+ this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE &&
707
+ this.getStatus() == 2) {
708
+ // NOTE(user): In IE if send() errors on a *local* request the readystate
709
+ // is still changed to COMPLETE. We need to ignore it and allow the
710
+ // try/catch around send() to pick up the error.
711
+ this.logger_.fine(this.formatMsg_(
712
+ 'Local request error detected and ignored'));
713
+
714
+ } else {
715
+
716
+ // In IE when the response has been cached we sometimes get the callback
717
+ // from inside the send call and this usually breaks code that assumes that
718
+ // XhrIo is asynchronous. If that is the case we delay the callback
719
+ // using a timer.
720
+ if (this.inSend_ &&
721
+ this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE) {
722
+ goog.Timer.defaultTimerObject.setTimeout(
723
+ goog.bind(this.onReadyStateChange_, this), 0);
724
+ return;
725
+ }
726
+
727
+ this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE);
728
+
729
+ // readyState indicates the transfer has finished
730
+ if (this.isComplete()) {
731
+ this.logger_.fine(this.formatMsg_('Request complete'));
732
+
733
+ this.active_ = false;
734
+
735
+ // Call the specific callbacks for success or failure. Only call the
736
+ // success if the status is 200 (HTTP_OK) or 304 (HTTP_CACHED)
737
+ if (this.isSuccess()) {
738
+ this.dispatchEvent(goog.net.EventType.COMPLETE);
739
+ this.dispatchEvent(goog.net.EventType.SUCCESS);
740
+ } else {
741
+ this.lastErrorCode_ = goog.net.ErrorCode.HTTP_ERROR;
742
+ this.lastError_ = this.getStatusText() + ' [' + this.getStatus() + ']';
743
+ this.dispatchErrors_();
744
+ }
745
+
746
+ this.cleanUpXhr_();
747
+ }
748
+ }
749
+ };
750
+
751
+
752
+ /**
753
+ * Remove the listener to protect against leaks, and nullify the XMLHttpRequest
754
+ * object.
755
+ * @param {boolean=} opt_fromDispose If this is from the dispose (don't want to
756
+ * fire any events).
757
+ * @private
758
+ */
759
+ goog.net.XhrIo.prototype.cleanUpXhr_ = function(opt_fromDispose) {
760
+ if (this.xhr_) {
761
+ // Save reference so we can mark it as closed after the READY event. The
762
+ // READY event may trigger another request, thus we must nullify this.xhr_
763
+ var xhr = this.xhr_;
764
+ var clearedOnReadyStateChange =
765
+ this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] ?
766
+ goog.nullFunction : null;
767
+ this.xhr_ = null;
768
+ this.xhrOptions_ = null;
769
+
770
+ if (this.timeoutId_) {
771
+ // Cancel any pending timeout event handler.
772
+ goog.Timer.defaultTimerObject.clearTimeout(this.timeoutId_);
773
+ this.timeoutId_ = null;
774
+ }
775
+
776
+ if (!opt_fromDispose) {
777
+ this.dispatchEvent(goog.net.EventType.READY);
778
+ }
779
+
780
+ try {
781
+ // NOTE(user): Not nullifying in FireFox can still leak if the callbacks
782
+ // are defined in the same scope as the instance of XhrIo. But, IE doesn't
783
+ // allow you to set the onreadystatechange to NULL so nullFunction is
784
+ // used.
785
+ xhr.onreadystatechange = clearedOnReadyStateChange;
786
+ } catch (e) {
787
+ // This seems to occur with a Gears HTTP request. Delayed the setting of
788
+ // this onreadystatechange until after READY is sent out and catching the
789
+ // error to see if we can track down the problem.
790
+ this.logger_.severe('Problem encountered resetting onreadystatechange: ' +
791
+ e.message);
792
+ }
793
+ }
794
+ };
795
+
796
+
797
+ /**
798
+ * @return {boolean} Whether there is an active request.
799
+ */
800
+ goog.net.XhrIo.prototype.isActive = function() {
801
+ return !!this.xhr_;
802
+ };
803
+
804
+
805
+ /**
806
+ * @return {boolean} Whether the request has completed.
807
+ */
808
+ goog.net.XhrIo.prototype.isComplete = function() {
809
+ return this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE;
810
+ };
811
+
812
+
813
+ /**
814
+ * @return {boolean} Whether the request completed with a success.
815
+ */
816
+ goog.net.XhrIo.prototype.isSuccess = function() {
817
+ var status = this.getStatus();
818
+ // A zero status code is considered successful for local files.
819
+ return goog.net.HttpStatus.isSuccess(status) ||
820
+ status === 0 && !this.isLastUriEffectiveSchemeHttp_();
821
+ };
822
+
823
+
824
+ /**
825
+ * @return {boolean} whether the effective scheme of the last URI that was
826
+ * fetched was 'http' or 'https'.
827
+ * @private
828
+ */
829
+ goog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_ = function() {
830
+ var scheme = goog.uri.utils.getEffectiveScheme(String(this.lastUri_));
831
+ return goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(scheme);
832
+ };
833
+
834
+
835
+ /**
836
+ * Get the readystate from the Xhr object
837
+ * Will only return correct result when called from the context of a callback
838
+ * @return {goog.net.XmlHttp.ReadyState} goog.net.XmlHttp.ReadyState.*.
839
+ */
840
+ goog.net.XhrIo.prototype.getReadyState = function() {
841
+ return this.xhr_ ?
842
+ /** @type {goog.net.XmlHttp.ReadyState} */ (this.xhr_.readyState) :
843
+ goog.net.XmlHttp.ReadyState.UNINITIALIZED;
844
+ };
845
+
846
+
847
+ /**
848
+ * Get the status from the Xhr object
849
+ * Will only return correct result when called from the context of a callback
850
+ * @return {number} Http status.
851
+ */
852
+ goog.net.XhrIo.prototype.getStatus = function() {
853
+ /**
854
+ * IE doesn't like you checking status until the readystate is greater than 2
855
+ * (i.e. it is recieving or complete). The try/catch is used for when the
856
+ * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.
857
+ * @preserveTry
858
+ */
859
+ try {
860
+ return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?
861
+ this.xhr_.status : -1;
862
+ } catch (e) {
863
+ this.logger_.warning('Can not get status: ' + e.message);
864
+ return -1;
865
+ }
866
+ };
867
+
868
+
869
+ /**
870
+ * Get the status text from the Xhr object
871
+ * Will only return correct result when called from the context of a callback
872
+ * @return {string} Status text.
873
+ */
874
+ goog.net.XhrIo.prototype.getStatusText = function() {
875
+ /**
876
+ * IE doesn't like you checking status until the readystate is greater than 2
877
+ * (i.e. it is recieving or complete). The try/catch is used for when the
878
+ * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.
879
+ * @preserveTry
880
+ */
881
+ try {
882
+ return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?
883
+ this.xhr_.statusText : '';
884
+ } catch (e) {
885
+ this.logger_.fine('Can not get status: ' + e.message);
886
+ return '';
887
+ }
888
+ };
889
+
890
+
891
+ /**
892
+ * Get the last Uri that was requested
893
+ * @return {string} Last Uri.
894
+ */
895
+ goog.net.XhrIo.prototype.getLastUri = function() {
896
+ return String(this.lastUri_);
897
+ };
898
+
899
+
900
+ /**
901
+ * Get the response text from the Xhr object
902
+ * Will only return correct result when called from the context of a callback.
903
+ * @return {string} Result from the server, or '' if no result available.
904
+ */
905
+ goog.net.XhrIo.prototype.getResponseText = function() {
906
+ /** @preserveTry */
907
+ try {
908
+ return this.xhr_ ? this.xhr_.responseText : '';
909
+ } catch (e) {
910
+ // http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute
911
+ // states that responseText should return '' (and responseXML null)
912
+ // when the state is not LOADING or DONE. Instead, IE and Gears can
913
+ // throw unexpected exceptions, eg, when a request is aborted or no
914
+ // data is available yet.
915
+ this.logger_.fine('Can not get responseText: ' + e.message);
916
+ return '';
917
+ }
918
+ };
919
+
920
+
921
+ /**
922
+ * Get the response XML from the Xhr object
923
+ * Will only return correct result when called from the context of a callback.
924
+ * @return {Document} The DOM Document representing the XML file, or null
925
+ * if no result available.
926
+ */
927
+ goog.net.XhrIo.prototype.getResponseXml = function() {
928
+ /** @preserveTry */
929
+ try {
930
+ return this.xhr_ ? this.xhr_.responseXML : null;
931
+ } catch (e) {
932
+ this.logger_.fine('Can not get responseXML: ' + e.message);
933
+ return null;
934
+ }
935
+ };
936
+
937
+
938
+ /**
939
+ * Get the response and evaluates it as JSON from the Xhr object
940
+ * Will only return correct result when called from the context of a callback
941
+ * @param {string=} opt_xssiPrefix Optional XSSI prefix string to use for
942
+ * stripping of the response before parsing. This needs to be set only if
943
+ * your backend server prepends the same prefix string to the JSON response.
944
+ * @return {Object|undefined} JavaScript object.
945
+ */
946
+ goog.net.XhrIo.prototype.getResponseJson = function(opt_xssiPrefix) {
947
+ if (!this.xhr_) {
948
+ return undefined;
949
+ }
950
+
951
+ var responseText = this.xhr_.responseText;
952
+ if (opt_xssiPrefix && responseText.indexOf(opt_xssiPrefix) == 0) {
953
+ responseText = responseText.substring(opt_xssiPrefix.length);
954
+ }
955
+
956
+ return goog.json.parse(responseText);
957
+ };
958
+
959
+
960
+ /**
961
+ * Get the response as the type specificed by {@link #setResponseType}. At time
962
+ * of writing, this is only directly supported in very recent versions of WebKit
963
+ * (10.0.612.1 dev and later). If the field is not supported directly, we will
964
+ * try to emulate it.
965
+ *
966
+ * Emulating the response means following the rules laid out at
967
+ * http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-response-attribute.
968
+ *
969
+ * On browsers with no support for this (Chrome < 10, Firefox < 4, etc), only
970
+ * response types of DEFAULT or TEXT may be used, and the response returned will
971
+ * be the text response.
972
+ *
973
+ * On browsers with Mozilla's draft support for array buffers (Firefox 4, 5),
974
+ * only response types of DEFAULT, TEXT, and ARRAY_BUFFER may be used, and the
975
+ * response returned will be either the text response or the Mozilla
976
+ * implementation of the array buffer response.
977
+ *
978
+ * On browsers will full support, any valid response type supported by the
979
+ * browser may be used, and the response provided by the browser will be
980
+ * returned.
981
+ *
982
+ * @return {*} The response.
983
+ */
984
+ goog.net.XhrIo.prototype.getResponse = function() {
985
+ /** @preserveTry */
986
+ try {
987
+ if (!this.xhr_) {
988
+ return null;
989
+ }
990
+ if ('response' in this.xhr_) {
991
+ return this.xhr_.response;
992
+ }
993
+ switch (this.responseType_) {
994
+ case goog.net.XhrIo.ResponseType.DEFAULT:
995
+ case goog.net.XhrIo.ResponseType.TEXT:
996
+ return this.xhr_.responseText;
997
+ // DOCUMENT and BLOB don't need to be handled here because they are
998
+ // introduced in the same spec that adds the .response field, and would
999
+ // have been caught above.
1000
+ // ARRAY_BUFFER needs an implementation for Firefox 4, where it was
1001
+ // implemented using a draft spec rather than the final spec.
1002
+ case goog.net.XhrIo.ResponseType.ARRAY_BUFFER:
1003
+ if ('mozResponseArrayBuffer' in this.xhr_) {
1004
+ return this.xhr_.mozResponseArrayBuffer;
1005
+ }
1006
+ }
1007
+ // Fell through to a response type that is not supported on this browser.
1008
+ this.logger_.severe('Response type ' + this.responseType_ + ' is not ' +
1009
+ 'supported on this browser');
1010
+ return null;
1011
+ } catch (e) {
1012
+ this.logger_.fine('Can not get response: ' + e.message);
1013
+ return null;
1014
+ }
1015
+ };
1016
+
1017
+
1018
+ /**
1019
+ * Get the value of the response-header with the given name from the Xhr object
1020
+ * Will only return correct result when called from the context of a callback
1021
+ * and the request has completed
1022
+ * @param {string} key The name of the response-header to retrieve.
1023
+ * @return {string|undefined} The value of the response-header named key.
1024
+ */
1025
+ goog.net.XhrIo.prototype.getResponseHeader = function(key) {
1026
+ return this.xhr_ && this.isComplete() ?
1027
+ this.xhr_.getResponseHeader(key) : undefined;
1028
+ };
1029
+
1030
+
1031
+ /**
1032
+ * Gets the text of all the headers in the response.
1033
+ * Will only return correct result when called from the context of a callback
1034
+ * and the request has completed.
1035
+ * @return {string} The value of the response headers or empty string.
1036
+ */
1037
+ goog.net.XhrIo.prototype.getAllResponseHeaders = function() {
1038
+ return this.xhr_ && this.isComplete() ?
1039
+ this.xhr_.getAllResponseHeaders() : '';
1040
+ };
1041
+
1042
+
1043
+ /**
1044
+ * Get the last error message
1045
+ * @return {goog.net.ErrorCode} Last error code.
1046
+ */
1047
+ goog.net.XhrIo.prototype.getLastErrorCode = function() {
1048
+ return this.lastErrorCode_;
1049
+ };
1050
+
1051
+
1052
+ /**
1053
+ * Get the last error message
1054
+ * @return {string} Last error message.
1055
+ */
1056
+ goog.net.XhrIo.prototype.getLastError = function() {
1057
+ return goog.isString(this.lastError_) ? this.lastError_ :
1058
+ String(this.lastError_);
1059
+ };
1060
+
1061
+
1062
+ /**
1063
+ * Adds the last method, status and URI to the message. This is used to add
1064
+ * this information to the logging calls.
1065
+ * @param {string} msg The message text that we want to add the extra text to.
1066
+ * @return {string} The message with the extra text appended.
1067
+ * @private
1068
+ */
1069
+ goog.net.XhrIo.prototype.formatMsg_ = function(msg) {
1070
+ return msg + ' [' + this.lastMethod_ + ' ' + this.lastUri_ + ' ' +
1071
+ this.getStatus() + ']';
1072
+ };
1073
+
1074
+
1075
+ // Register the xhr handler as an entry point, so that
1076
+ // it can be monitored for exception handling, etc.
1077
+ goog.debug.entryPointRegistry.register(
1078
+ /**
1079
+ * @param {function(!Function): !Function} transformer The transforming
1080
+ * function.
1081
+ */
1082
+ function(transformer) {
1083
+ goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =
1084
+ transformer(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);
1085
+ });
1086
+ ;
1087
+ FI"
1088
+ F"%59a326aca6895e0598635e27205b2d9d