Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Cucumber/Webrat

  • Loading branch information...
commit 9d41a31ed0dfb4b7ac13ce96f8f758a6158de8bb 1 parent d474a52
Joe Ferris authored
Showing with 11,997 additions and 1 deletion.
  1. +3 −0  Rakefile
  2. +4 −1 config/database.yml
  3. +43 −0 config/environments/cucumber.rb
  4. +8 −0 config/environments/test.rb
  5. +119 −0 features/step_definitions/webrat_steps.rb
  6. +24 −0 features/support/env.rb
  7. +27 −0 features/support/paths.rb
  8. +16 −0 lib/tasks/cucumber.rake
  9. +8 −0 script/cucumber
  10. +85 −0 vendor/gems/builder-2.1.2/.specification
  11. +85 −0 vendor/gems/builder-2.1.2/CHANGES
  12. +210 −0 vendor/gems/builder-2.1.2/README
  13. +263 −0 vendor/gems/builder-2.1.2/Rakefile
  14. +31 −0 vendor/gems/builder-2.1.2/doc/releases/builder-1.2.4.rdoc
  15. +46 −0 vendor/gems/builder-2.1.2/doc/releases/builder-2.0.0.rdoc
  16. +58 −0 vendor/gems/builder-2.1.2/doc/releases/builder-2.1.1.rdoc
  17. +113 −0 vendor/gems/builder-2.1.2/lib/blankslate.rb
  18. +13 −0 vendor/gems/builder-2.1.2/lib/builder.rb
  19. +20 −0 vendor/gems/builder-2.1.2/lib/builder/blankslate.rb
  20. +115 −0 vendor/gems/builder-2.1.2/lib/builder/xchar.rb
  21. +139 −0 vendor/gems/builder-2.1.2/lib/builder/xmlbase.rb
  22. +63 −0 vendor/gems/builder-2.1.2/lib/builder/xmlevents.rb
  23. +328 −0 vendor/gems/builder-2.1.2/lib/builder/xmlmarkup.rb
  24. +17 −0 vendor/gems/builder-2.1.2/scripts/publish.rb
  25. +30 −0 vendor/gems/builder-2.1.2/test/performance.rb
  26. +29 −0 vendor/gems/builder-2.1.2/test/preload.rb
  27. +37 −0 vendor/gems/builder-2.1.2/test/test_xchar.rb
  28. +183 −0 vendor/gems/builder-2.1.2/test/testblankslate.rb
  29. +133 −0 vendor/gems/builder-2.1.2/test/testeventbuilder.rb
  30. +449 −0 vendor/gems/builder-2.1.2/test/testmarkupbuilder.rb
  31. +513 −0 vendor/gems/cucumber-0.3.11/.specification
  32. +785 −0 vendor/gems/cucumber-0.3.11/History.txt
  33. +20 −0 vendor/gems/cucumber-0.3.11/License.txt
  34. +405 −0 vendor/gems/cucumber-0.3.11/Manifest.txt
  35. +4 −0 vendor/gems/cucumber-0.3.11/README.txt
  36. +9 −0 vendor/gems/cucumber-0.3.11/Rakefile
  37. +17 −0 vendor/gems/cucumber-0.3.11/bin/cucumber
  38. +77 −0 vendor/gems/cucumber-0.3.11/config/hoe.rb
  39. +15 −0 vendor/gems/cucumber-0.3.11/config/requirements.rb
  40. +1 −0  vendor/gems/cucumber-0.3.11/cucumber.yml
  41. +1 −0  vendor/gems/cucumber-0.3.11/examples/cs/README.textile
  42. +12 −0 vendor/gems/cucumber-0.3.11/examples/cs/Rakefile
  43. +1 −0  vendor/gems/cucumber-0.3.11/examples/cs/compile.bat
  44. +16 −0 vendor/gems/cucumber-0.3.11/examples/cs/features/addition.feature
  45. +19 −0 vendor/gems/cucumber-0.3.11/examples/cs/features/step_definitons/calculator_steps.rb
  46. +20 −0 vendor/gems/cucumber-0.3.11/examples/cs/src/demo/Calculator.cs
  47. +6 −0 vendor/gems/cucumber-0.3.11/examples/dos_line_endings/Rakefile
  48. +9 −0 vendor/gems/cucumber-0.3.11/examples/dos_line_endings/features/dos_line_endings.feature
  49. +18 −0 vendor/gems/cucumber-0.3.11/examples/i18n/README.textile
  50. +30 −0 vendor/gems/cucumber-0.3.11/examples/i18n/Rakefile
  51. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ar/Rakefile
  52. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ar/features/addition.feature
  53. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ar/features/step_definitons/calculator_steps.rb
  54. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ar/lib/calculator.rb
  55. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/Rakefile
  56. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/features/addition.feature
  57. +18 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/features/consecutive_calculations.feature
  58. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/features/division.feature
  59. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/features/step_definitons/calculator_steps.rb
  60. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/features/support/env.rb
  61. +8 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/features/support/world.rb
  62. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/bg/lib/calculator.rb
  63. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/cat/Rakefile
  64. +21 −0 vendor/gems/cucumber-0.3.11/examples/i18n/cat/features/step_definitons/calculator_steps.rb
  65. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/cat/features/suma.feature
  66. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/cat/lib/calculadora.rb
  67. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/da/Rakefile
  68. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/da/features/step_definitons/kalkulator_steps.rb
  69. +17 −0 vendor/gems/cucumber-0.3.11/examples/i18n/da/features/summering.feature
  70. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/da/lib/kalkulator.rb
  71. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/de/Rakefile
  72. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/de/features/addition.feature
  73. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/de/features/division.feature
  74. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/de/features/step_definitons/calculator_steps.rb
  75. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/de/lib/calculator.rb
  76. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en-lol/Rakefile
  77. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb
  78. +8 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en-lol/features/stuffing.feature
  79. +8 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en-lol/features/support/env.rb
  80. +12 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en-lol/lib/basket.rb
  81. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en-lol/lib/belly.rb
  82. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en/Rakefile
  83. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en/features/addition.feature
  84. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en/features/division.feature
  85. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en/features/step_definitons/calculator_steps.rb
  86. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/en/lib/calculator.rb
  87. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/es/Rakefile
  88. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/es/features/adicion.feature
  89. +21 −0 vendor/gems/cucumber-0.3.11/examples/i18n/es/features/step_definitons/calculador_steps.rb
  90. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/es/lib/calculador.rb
  91. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/et/Rakefile
  92. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/et/features/jagamine.feature
  93. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/et/features/liitmine.feature
  94. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb
  95. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/et/lib/kalkulaator.rb
  96. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fi/Rakefile
  97. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fi/features/jakolasku.feature
  98. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fi/features/step_definitons/laskin_steps.rb
  99. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fi/features/yhteenlasku.feature
  100. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fi/lib/laskin.rb
  101. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fr/Rakefile
  102. +17 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fr/features/addition.feature
  103. +25 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb
  104. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/fr/lib/calculatrice.rb
  105. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/he/Rakefile
  106. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/he/features/addition.feature
  107. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/he/features/division.feature
  108. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/he/features/step_definitons/calculator_steps.rb
  109. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/he/lib/calculator.rb
  110. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/hu/Rakefile
  111. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/hu/features/addition.feature
  112. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/hu/features/division.feature
  113. +25 −0 vendor/gems/cucumber-0.3.11/examples/i18n/hu/features/step_definitons/calculator_steps.rb
  114. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/hu/lib/calculator.rb
  115. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/id/Rakefile
  116. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/id/features/addition.feature
  117. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/id/features/division.feature
  118. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/id/features/step_definitons/calculator_steps.rb
  119. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/id/lib/calculator.rb
  120. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/it/Rakefile
  121. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/it/features/somma.feature
  122. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb
  123. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/it/lib/calcolatrice.rb
  124. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ja/Rakefile
  125. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ja/features/addition.feature
  126. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ja/features/division.feature
  127. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ja/features/step_definitons/calculator_steps.rb
  128. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ja/lib/calculator.rb
  129. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ko/Rakefile
  130. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ko/features/addition.feature
  131. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ko/features/division.feature
  132. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ko/features/step_definitons/calculator_steps.rb
  133. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ko/lib/calculator.rb
  134. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lt/Rakefile
  135. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lt/features/addition.feature
  136. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lt/features/division.feature
  137. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lt/features/step_definitons/calculator_steps.rb
  138. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lt/lib/calculator.rb
  139. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lv/Rakefile
  140. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lv/features/addition.feature
  141. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lv/features/division.feature
  142. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lv/features/step_definitons/calculator_steps.rb
  143. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/lv/lib/calculator.rb
  144. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/no/Rakefile
  145. +17 −0 vendor/gems/cucumber-0.3.11/examples/i18n/no/features/step_definitons/kalkulator_steps.rb
  146. +18 −0 vendor/gems/cucumber-0.3.11/examples/i18n/no/features/summering.feature
  147. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/no/features/support/env.rb
  148. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/no/lib/kalkulator.rb
  149. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pl/Rakefile
  150. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pl/features/addition.feature
  151. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pl/features/division.feature
  152. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pl/features/step_definitons/calculator_steps.rb
  153. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pl/features/support/env.rb
  154. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pl/lib/calculator.rb
  155. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pt/Rakefile
  156. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pt/features/adicao.feature
  157. +20 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pt/features/step_definitions/calculadora_steps.rb
  158. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pt/features/support/env.rb
  159. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/pt/lib/calculadora.rb
  160. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ro/Rakefile
  161. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ro/features/step_definitons/calculator_steps.rb
  162. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ro/features/suma.feature
  163. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ro/lib/calculator.rb
  164. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/Rakefile
  165. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/features/addition.feature
  166. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/features/consecutive_calculations.feature
  167. +15 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/features/division.feature
  168. +19 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/features/step_definitons/calculator_steps.rb
  169. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/features/support/env.rb
  170. +8 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/features/support/world.rb
  171. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/ru/lib/calculator.rb
  172. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/se/Rakefile
  173. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/se/features/step_definitons/kalkulator_steps.rb
  174. +17 −0 vendor/gems/cucumber-0.3.11/examples/i18n/se/features/summering.feature
  175. +11 −0 vendor/gems/cucumber-0.3.11/examples/i18n/se/lib/kalkulator.rb
  176. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/sk/Rakefile
  177. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/sk/features/addition.feature
  178. +9 −0 vendor/gems/cucumber-0.3.11/examples/i18n/sk/features/division.feature
  179. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/sk/features/step_definitons/calculator_steps.rb
  180. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/sk/lib/calculator.rb
  181. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-CN/Rakefile
  182. +17 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-CN/features/addition.feature
  183. +26 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
  184. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-CN/lib/calculator.rb
  185. +6 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-TW/Rakefile
  186. +16 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-TW/features/addition.feature
  187. +10 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-TW/features/division.feature
  188. +24 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb
  189. +14 −0 vendor/gems/cucumber-0.3.11/examples/i18n/zh-TW/lib/calculator.rb
  190. +18 −0 vendor/gems/cucumber-0.3.11/examples/java/README.textile
  191. +33 −0 vendor/gems/cucumber-0.3.11/examples/java/build.xml
  192. +11 −0 vendor/gems/cucumber-0.3.11/examples/java/features/hello.feature
  193. +23 −0 vendor/gems/cucumber-0.3.11/examples/java/features/step_definitons/hello_steps.rb
  194. +14 −0 vendor/gems/cucumber-0.3.11/examples/java/features/step_definitons/tree_steps.rb
  195. +9 −0 vendor/gems/cucumber-0.3.11/examples/java/features/tree.feature
  196. +16 −0 vendor/gems/cucumber-0.3.11/examples/java/src/cucumber/demo/Hello.java
  197. +8 −0 vendor/gems/cucumber-0.3.11/examples/junit/features/one_passing_one_failing.feature
  198. +5 −0 vendor/gems/cucumber-0.3.11/examples/junit/features/pending.feature
  199. +11 −0 vendor/gems/cucumber-0.3.11/examples/junit/features/step_definitions/steps.rb
  200. +5 −0 vendor/gems/cucumber-0.3.11/examples/pure_java/README.textile
  201. +6 −0 vendor/gems/cucumber-0.3.11/examples/selenium/Rakefile
  202. +9 −0 vendor/gems/cucumber-0.3.11/examples/selenium/features/search.feature
  203. +13 −0 vendor/gems/cucumber-0.3.11/examples/selenium/features/step_definitons/search_steps.rb
  204. +19 −0 vendor/gems/cucumber-0.3.11/examples/selenium/features/support/env.rb
  205. +6 −0 vendor/gems/cucumber-0.3.11/examples/selenium_webrat/Rakefile
  206. 0  vendor/gems/cucumber-0.3.11/examples/selenium_webrat/config.ru
  207. +9 −0 vendor/gems/cucumber-0.3.11/examples/selenium_webrat/features/search.feature
  208. +13 −0 vendor/gems/cucumber-0.3.11/examples/selenium_webrat/features/step_definitons/search_steps.rb
  209. +45 −0 vendor/gems/cucumber-0.3.11/examples/selenium_webrat/features/support/env.rb
  210. +6 −0 vendor/gems/cucumber-0.3.11/examples/self_test/README.textile
  211. +6 −0 vendor/gems/cucumber-0.3.11/examples/self_test/Rakefile
  212. +12 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/background_tagged_before_on_outline.feature
  213. +7 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/background_with_name.feature
  214. +12 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/failing_background.feature
  215. +11 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/failing_background_after_success.feature
  216. +32 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/multiline_args_background.feature
  217. +10 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/passing_background.feature
  218. +10 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/pending_background.feature
  219. +16 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/scenario_outline_failing_background.feature
  220. +16 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/background/scenario_outline_passing_background.feature
  221. +7 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/call_undefined_step_from_step_def.feature
  222. +4 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/failing_expectation.feature
  223. +8 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/lots_of_undefined.feature
  224. +27 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/multiline_name.feature
  225. +15 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/outline_sample.feature
  226. +21 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/sample.feature
  227. +32 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/search_sample.feature
  228. +81 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/step_definitions/sample_steps.rb
  229. +17 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/support/env.rb
  230. +52 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/tons_of_cukes.feature
  231. +12 −0 vendor/gems/cucumber-0.3.11/examples/self_test/features/undefined_multiline_args.feature
  232. +6 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/Rakefile
  233. +14 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/app.rb
  234. +11 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/features/add.feature
  235. +15 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/features/step_definitions/add_steps.rb
  236. +20 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/features/support/env.rb
  237. +5 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/views/add.erb
  238. +8 −0 vendor/gems/cucumber-0.3.11/examples/sinatra/views/layout.erb
  239. +6 −0 vendor/gems/cucumber-0.3.11/examples/test_unit/Rakefile
  240. +23 −0 vendor/gems/cucumber-0.3.11/examples/test_unit/features/step_definitions/test_unit_steps.rb
  241. +9 −0 vendor/gems/cucumber-0.3.11/examples/test_unit/features/test_unit.feature
  242. +16 −0 vendor/gems/cucumber-0.3.11/examples/tickets/Rakefile
  243. +28 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/172.feature
  244. +29 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/177/1.feature
  245. +21 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/177/2.feature
  246. +18 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/177/3.feature
  247. +7 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/180.feature
  248. +8 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/229/tagged_hooks.feature
  249. +14 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/229/tagged_hooks.rb
  250. +13 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/236.feature
  251. +13 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/241.feature
  252. +4 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/246.feature
  253. +11 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/248.feature
  254. +14 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/270/back.feature
  255. +14 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/270/back.steps.rb
  256. +26 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/272/hooks.feature
  257. +53 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/272/hooks_steps.rb
  258. +25 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/279/py_string_indent.feature
  259. +12 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/279/py_string_indent.steps.rb
  260. +11 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/279/wrong.feature_
  261. +6 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/301/filter_background_tagged_hooks.feature
  262. +12 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/301/filter_background_tagged_hooks_steps.rb
  263. +4 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/306/only_background.feature
  264. +18 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/lib/eatting_machine.rb
  265. +20 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/lib/pantry.rb
  266. +95 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/scenario_outline.feature
  267. +3 −0  vendor/gems/cucumber-0.3.11/examples/tickets/features/step_definitons/246_steps.rb
  268. +15 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/step_definitons/248_steps.rb
  269. +42 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/step_definitons/scenario_outline_steps.rb
  270. +66 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/step_definitons/tickets_steps.rb
  271. +28 −0 vendor/gems/cucumber-0.3.11/examples/tickets/features/tickets.feature
  272. +16 −0 vendor/gems/cucumber-0.3.11/examples/watir/README.textile
  273. +6 −0 vendor/gems/cucumber-0.3.11/examples/watir/Rakefile
  274. +12 −0 vendor/gems/cucumber-0.3.11/examples/watir/features/search.feature
  275. +22 −0 vendor/gems/cucumber-0.3.11/examples/watir/features/step_definitons/search_steps.rb
  276. +32 −0 vendor/gems/cucumber-0.3.11/examples/watir/features/support/env.rb
  277. +99 −0 vendor/gems/cucumber-0.3.11/features/after_block_exceptions.feature
  278. +101 −0 vendor/gems/cucumber-0.3.11/features/after_step_block_exceptions.feature
  279. +305 −0 vendor/gems/cucumber-0.3.11/features/background.feature
  280. +539 −0 vendor/gems/cucumber-0.3.11/features/cucumber_cli.feature
  281. +47 −0 vendor/gems/cucumber-0.3.11/features/cucumber_cli_diff_disabled.feature
  282. +109 −0 vendor/gems/cucumber-0.3.11/features/cucumber_cli_outlines.feature
  283. +11 −0 vendor/gems/cucumber-0.3.11/features/custom_formatter.feature
  284. +92 −0 vendor/gems/cucumber-0.3.11/features/drb_server_integration.feature
  285. +20 −0 vendor/gems/cucumber-0.3.11/features/exclude_files.feature
  286. +48 −0 vendor/gems/cucumber-0.3.11/features/expand.feature
  287. +7 −0 vendor/gems/cucumber-0.3.11/features/html_formatter.feature
  288. +1,671 −0 vendor/gems/cucumber-0.3.11/features/html_formatter/a.html
  289. +71 −0 vendor/gems/cucumber-0.3.11/features/junit_formatter.feature
  290. +43 −0 vendor/gems/cucumber-0.3.11/features/multiline_names.feature
  291. +150 −0 vendor/gems/cucumber-0.3.11/features/rake_task.feature
  292. +35 −0 vendor/gems/cucumber-0.3.11/features/report_called_undefined_steps.feature
  293. +22 −0 vendor/gems/cucumber-0.3.11/features/snippet.feature
  294. +130 −0 vendor/gems/cucumber-0.3.11/features/step_definitions/cucumber_steps.rb
  295. +2 −0  vendor/gems/cucumber-0.3.11/features/step_definitions/extra_steps.rb
  296. +117 −0 vendor/gems/cucumber-0.3.11/features/support/env.rb
  297. +126 −0 vendor/gems/cucumber-0.3.11/features/usage.feature
  298. +148 −0 vendor/gems/cucumber-0.3.11/features/work_in_progress.feature
  299. +11 −0 vendor/gems/cucumber-0.3.11/gem_tasks/deployment.rake
  300. +7 −0 vendor/gems/cucumber-0.3.11/gem_tasks/environment.rake
Sorry, we could not display the entire diff because too many files (612) changed.
View
3  Rakefile
@@ -8,3 +8,6 @@ require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
+
+desc "Run all tests and features"
+task :default => [:test, :features]
View
5 config/database.yml
@@ -8,7 +8,7 @@ development:
host: localhost
encoding: utf8
-test:
+test: &TEST
adapter: mysql
database: CHANGEME_test
username: root
@@ -33,3 +33,6 @@ production:
host: localhost
encoding: utf8
socket: /var/lib/mysql/mysql.sock
+
+cucumber:
+ <<: *TEST
View
43 config/environments/cucumber.rb
@@ -0,0 +1,43 @@
+config.cache_classes = true # This must be true for Cucumber to operate correctly!
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = false
+
+# Disable request forgery protection in test environment
+config.action_controller.allow_forgery_protection = false
+
+# Tell Action Mailer not to deliver emails to the real world.
+# The :test delivery method accumulates sent emails in the
+# ActionMailer::Base.deliveries array.
+config.action_mailer.delivery_method = :test
+
+# Cucumber and dependencies
+config.gem 'polyglot',
+ :version => '0.2.6',
+ :lib => false
+config.gem 'treetop',
+ :version => '1.2.6',
+ :lib => false
+config.gem 'term-ansicolor',
+ :version => '1.0.3',
+ :lib => false
+config.gem 'diff-lcs',
+ :version => '1.1.2',
+ :lib => false
+config.gem 'builder',
+ :version => '2.1.2',
+ :lib => false
+config.gem 'cucumber',
+ :version => '0.3.11'
+
+# Webrat and dependencies
+# NOTE: don't vendor nokogiri - it's a binary Gem
+config.gem 'nokogiri',
+ :version => '1.3.2',
+ :lib => false
+config.gem 'webrat',
+ :version => '0.4.4'
View
8 config/environments/test.rb
@@ -34,6 +34,14 @@
:source => 'http://gems.github.com',
:version => '>= 2.10.1'
+# Webrat and dependencies
+# NOTE: don't vendor nokogiri - it's a binary Gem
+config.gem 'nokogiri',
+ :version => '1.3.2',
+ :lib => false
+config.gem 'webrat',
+ :version => '0.4.4'
+
HOST = 'localhost'
require 'factory_girl'
View
119 features/step_definitions/webrat_steps.rb
@@ -0,0 +1,119 @@
+require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
+
+# Commonly used webrat steps
+# http://github.com/brynary/webrat
+
+Given /^I am on (.+)$/ do |page_name|
+ visit path_to(page_name)
+end
+
+When /^I go to (.+)$/ do |page_name|
+ visit path_to(page_name)
+end
+
+When /^I press "([^\"]*)"$/ do |button|
+ click_button(button)
+end
+
+When /^I follow "([^\"]*)"$/ do |link|
+ click_link(link)
+end
+
+When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
+ fill_in(field, :with => value)
+end
+
+When /^I select "([^\"]*)" from "([^\"]*)"$/ do |value, field|
+ select(value, :from => field)
+end
+
+# Use this step in conjunction with Rail's datetime_select helper. For example:
+# When I select "December 25, 2008 10:00" as the date and time
+When /^I select "([^\"]*)" as the date and time$/ do |time|
+ select_datetime(time)
+end
+
+# Use this step when using multiple datetime_select helpers on a page or
+# you want to specify which datetime to select. Given the following view:
+# <%= f.label :preferred %><br />
+# <%= f.datetime_select :preferred %>
+# <%= f.label :alternative %><br />
+# <%= f.datetime_select :alternative %>
+# The following steps would fill out the form:
+# When I select "November 23, 2004 11:20" as the "Preferred" date and time
+# And I select "November 25, 2004 10:30" as the "Alternative" date and time
+When /^I select "([^\"]*)" as the "([^\"]*)" date and time$/ do |datetime, datetime_label|
+ select_datetime(datetime, :from => datetime_label)
+end
+
+# Use this step in conjunction with Rail's time_select helper. For example:
+# When I select "2:20PM" as the time
+# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
+# will convert the 2:20PM to 14:20 and then select it.
+When /^I select "([^\"]*)" as the time$/ do |time|
+ select_time(time)
+end
+
+# Use this step when using multiple time_select helpers on a page or you want to
+# specify the name of the time on the form. For example:
+# When I select "7:30AM" as the "Gym" time
+When /^I select "([^\"]*)" as the "([^\"]*)" time$/ do |time, time_label|
+ select_time(time, :from => time_label)
+end
+
+# Use this step in conjunction with Rail's date_select helper. For example:
+# When I select "February 20, 1981" as the date
+When /^I select "([^\"]*)" as the date$/ do |date|
+ select_date(date)
+end
+
+# Use this step when using multiple date_select helpers on one page or
+# you want to specify the name of the date on the form. For example:
+# When I select "April 26, 1982" as the "Date of Birth" date
+When /^I select "([^\"]*)" as the "([^\"]*)" date$/ do |date, date_label|
+ select_date(date, :from => date_label)
+end
+
+When /^I check "([^\"]*)"$/ do |field|
+ check(field)
+end
+
+When /^I uncheck "([^\"]*)"$/ do |field|
+ uncheck(field)
+end
+
+When /^I choose "([^\"]*)"$/ do |field|
+ choose(field)
+end
+
+When /^I attach the file at "([^\"]*)" to "([^\"]*)"$/ do |path, field|
+ attach_file(field, path)
+end
+
+Then /^I should see "([^\"]*)"$/ do |text|
+ assert_contain text
+end
+
+Then /^I should not see "([^\"]*)"$/ do |text|
+ assert_not_contain text
+end
+
+Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
+ assert_match /#{value}/, field_labeled(field).value
+end
+
+Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, value|
+ assert_no_match /#{value}/, field_labeled(field).value
+end
+
+Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
+ assert field_labeled(label).checked?
+end
+
+Then /^the "([^\"]*)" checkbox should not be checked$/ do |label|
+ assert ! field_labeled(label).checked?
+end
+
+Then /^I should be on (.+)$/ do |page_name|
+ assert_equal path_to(page_name), URI.parse(current_url).path
+end
View
24 features/support/env.rb
@@ -0,0 +1,24 @@
+# Sets up the Rails environment for Cucumber
+ENV["RAILS_ENV"] ||= "cucumber"
+require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
+require 'cucumber/rails/world'
+
+# Comment out the next line if you don't want Cucumber Unicode support
+require 'cucumber/formatter/unicode'
+
+# Comment out the next line if you don't want transactions to
+# open/roll back around each scenario
+Cucumber::Rails.use_transactional_fixtures
+
+# Comment out the next line if you want Rails' own error handling
+# (e.g. rescue_action_in_public / rescue_responses / rescue_from)
+Cucumber::Rails.bypass_rescue
+
+require 'webrat'
+
+Webrat.configure do |config|
+ config.mode = :rails
+end
+
+# require 'cucumber/rails/rspec'
+require 'webrat/core/matchers'
View
27 features/support/paths.rb
@@ -0,0 +1,27 @@
+module NavigationHelpers
+ # Maps a name to a path. Used by the
+ #
+ # When /^I go to (.+)$/ do |page_name|
+ #
+ # step definition in webrat_steps.rb
+ #
+ def path_to(page_name)
+ case page_name
+
+ when /the homepage/
+ '/'
+
+ # Add more mappings here.
+ # Here is a more fancy example:
+ #
+ # when /^(.*)'s profile page$/i
+ # user_profile_path(User.find_by_login($1))
+
+ else
+ raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
+ "Now, go and add a mapping in #{__FILE__}"
+ end
+ end
+end
+
+World(NavigationHelpers)
View
16 lib/tasks/cucumber.rake
@@ -0,0 +1,16 @@
+$LOAD_PATH.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib') if File.directory?(RAILS_ROOT + '/vendor/plugins/cucumber/lib')
+
+begin
+ require 'cucumber/rake/task'
+
+ Cucumber::Rake::Task.new(:features) do |t|
+ t.fork = true
+ t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
+ end
+ task :features => 'db:test:prepare'
+rescue LoadError
+ desc 'Cucumber rake task not available'
+ task :features do
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
+ end
+end
View
8 script/cucumber
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/cucumber/bin/cucumber")
+rescue LoadError => e
+ raise unless e.to_s =~ /cucumber/
+ require "rubygems"
+ load File.join(Gem.bindir, "cucumber")
+end
View
85 vendor/gems/builder-2.1.2/.specification
@@ -0,0 +1,85 @@
+--- !ruby/object:Gem::Specification
+name: builder
+version: !ruby/object:Gem::Version
+ version: 2.1.2
+platform: ruby
+authors:
+- Jim Weirich
+autorequire: builder
+bindir: bin
+cert_chain:
+date: 2007-06-15 00:00:00 -04:00
+default_executable:
+dependencies: []
+
+description: "Builder provides a number of builder objects that make creating structured data simple to do. Currently the following builder objects are supported: * XML Markup * XML Events"
+email: jim@weirichhouse.org
+executables: []
+
+extensions: []
+
+extra_rdoc_files:
+- CHANGES
+- Rakefile
+- README
+- doc/releases/builder-1.2.4.rdoc
+- doc/releases/builder-2.0.0.rdoc
+- doc/releases/builder-2.1.1.rdoc
+files:
+- lib/blankslate.rb
+- lib/builder.rb
+- lib/builder/blankslate.rb
+- lib/builder/xchar.rb
+- lib/builder/xmlbase.rb
+- lib/builder/xmlevents.rb
+- lib/builder/xmlmarkup.rb
+- test/performance.rb
+- test/preload.rb
+- test/test_xchar.rb
+- test/testblankslate.rb
+- test/testeventbuilder.rb
+- test/testmarkupbuilder.rb
+- scripts/publish.rb
+- CHANGES
+- Rakefile
+- README
+- doc/releases/builder-1.2.4.rdoc
+- doc/releases/builder-2.0.0.rdoc
+- doc/releases/builder-2.1.1.rdoc
+has_rdoc: true
+homepage: http://onestepback.org
+licenses: []
+
+post_install_message:
+rdoc_options:
+- --title
+- Builder -- Easy XML Building
+- --main
+- README
+- --line-numbers
+require_paths:
+- lib
+required_ruby_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">"
+ - !ruby/object:Gem::Version
+ version: 0.0.0
+ version:
+required_rubygems_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: "0"
+ version:
+requirements: []
+
+rubyforge_project:
+rubygems_version: 1.3.4
+signing_key:
+specification_version: 1
+summary: Builders for MarkUp.
+test_files:
+- test/test_xchar.rb
+- test/testblankslate.rb
+- test/testeventbuilder.rb
+- test/testmarkupbuilder.rb
View
85 vendor/gems/builder-2.1.2/CHANGES
@@ -0,0 +1,85 @@
+= Change Log
+
+== Version 2.1.2
+
+* Fixed bug where private methods in kernel could leak through using
+ tag!(). Thanks to Hagen Overdick for finding and diagnosing this
+ bug.
+
+
+== Version 2.1.1
+
+* Fixed typo in XmlMarkup class docs (ident => indent). (from Martin
+ Fowler).
+* Removed extra directory indirection from legacy CVS to SVN move.
+* Removed some extraneous tabs from source.
+* Fixed test on private methods in blankslate to differentiate between
+ targetted and untargetted private methods.
+* Removed legacy capture of @self in XmlBase (@self was used back when
+ we used instance eval).
+* Added additional tests for global functions (both direct and included).
+
+== Version 2.1.0
+
+* Fixed bug in BlankSlate where including a module into Object could
+ cause methods to leak into BlankSlate.
+* Made BlankSlate available as its own gem. Currently the builder gem
+ still directly includes the BlankSlate code.
+* Added reveal capability to BlankSlate.
+
+== Version 2.0.0
+
+* Added doc directory
+* Added unit tests for XmlEvents.
+* Added XChar module and used it in the _escape method.
+* Attributes are now quoted by default when strings. Use Symbol
+ attribute values for unquoted behavior.
+
+== Version 1.2.4
+
+* Added a cdata! command to an XML Builder (from Josh Knowles).
+
+== Version 1.2.3
+
+The attributes in the <?xml ... ?> instruction will be ordered:
+version, encoding, standalone.
+
+== Version 1.2.2
+
+Another fix for BlankSlate. The Kernal/Object traps added in 1.2.1
+failed when a method was defined late more than once. Since the
+method was already marked as removed, another attempt to undefine it
+raised an error. The fix was to check the list of instance methods
+before attempting the undef operation. Thanks to Florian Gross and
+David Heinemeier Hansson for the patch.
+
+== Version 1.2.1
+
+BlankSlate now traps method definitions in Kernel and Object to avoid
+late method definitions inadvertently becoming part of the definition
+of BlankSlate as well.
+
+== Version 1.2.0
+
+Improved support for entity declarations by allowing nested
+declarations and removal of the attribute processing.
+
+Added namespace support.
+
+== Version 1.1.0
+
+Added support for comments, entity declarations and processing instructions.
+
+== Version 1.0.0
+
+Removed use of <tt>instace_eval</tt> making the use of XmlMarkup much
+less prone to error.
+
+== Version 0.1.1
+
+Bug fix.
+
+== Version 0.1.0
+
+Initial version release.
+
View
210 vendor/gems/builder-2.1.2/README
@@ -0,0 +1,210 @@
+= Project: Builder
+
+== Goal
+
+Provide a simple way to create XML markup and data structures.
+
+== Classes
+
+Builder::XmlMarkup:: Generate XML markup notiation
+Builder::XmlEvents:: Generate XML events (i.e. SAX-like)
+
+<b>Notes</b>::
+
+* An <tt>Builder::XmlTree</tt> class to generate XML tree
+ (i.e. DOM-like) structures is also planned, but not yet implemented.
+ Also, the events builder is currently lagging the markup builder in
+ features.
+
+== Usage
+
+ require 'rubygems'
+ require_gem 'builder', '~> 2.0'
+
+ builder = Builder::XmlMarkup.new
+ xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") }
+ xml #=> <person><name>Jim</name><phone>555-1234</phone></person>
+
+or
+
+ require 'rubygems'
+ require_gem 'builder'
+
+ builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
+ builder.person { |b| b.name("Jim"); b.phone("555-1234") }
+ #
+ # Prints:
+ # <person>
+ # <name>Jim</name>
+ # <phone>555-1234</phone>
+ # </person>
+
+== Compatibility
+
+=== Version 2.0.0 Compatibility Changes
+
+Version 2.0.0 introduces automatically escaped attribute values for
+the first time. Versions prior to 2.0.0 did not insert escape
+characters into attribute values in the XML markup. This allowed
+attribute values to explicitly reference entities, which was
+occasionally used by a small number of developers. Since strings
+could always be explicitly escaped by hand, this was not a major
+restriction in functionality.
+
+However, it did suprise most users of builder. Since the body text is
+normally escaped, everybody expected the attribute values to be
+escaped as well. Escaped attribute values were the number one support
+request on the 1.x Builder series.
+
+Starting with Builder version 2.0.0, all attribute values expressed as
+strings will be processed and the appropriate characters will be
+escaped (e.g. "&" will be tranlated to "&amp;"). Attribute values
+that are expressed as Symbol values will not be processed for escaped
+characters and will be unchanged in output. (Yes, this probably counts
+as Symbol abuse, but the convention is convenient and flexible).
+
+Example:
+
+ xml = Builder::XmlMarkup.new
+ xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There")
+ xml.target! =>
+ <sample escaped="This&amp;That" unescaped="Here&amp;There"/>
+
+=== Version 1.0.0 Compatibility Changes
+
+Version 1.0.0 introduces some changes that are not backwards
+compatible with earlier releases of builder. The main areas of
+incompatibility are:
+
+* Keyword based arguments to +new+ (rather than positional based). It
+ was found that a developer would often like to specify indentation
+ without providing an explicit target, or specify a target without
+ indentation. Keyword based arguments handle this situation nicely.
+
+* Builder must now be an explicit target for markup tags. Instead of
+ writing
+
+ xml_markup = Builder::XmlMarkup.new
+ xml_markup.div { strong("text") }
+
+ you need to write
+
+ xml_markup = Builder::XmlMarkup.new
+ xml_markup.div { xml_markup.strong("text") }
+
+* The builder object is passed as a parameter to all nested markup
+ blocks. This allows you to create a short alias for the builder
+ object that can be used within the block. For example, the previous
+ example can be written as:
+
+ xml_markup = Builder::XmlMarkup.new
+ xml_markup.div { |xml| xml.strong("text") }
+
+* If you have both a pre-1.0 and a post-1.0 gem of builder installed,
+ you can choose which version to use through the RubyGems
+ +require_gem+ facility.
+
+ require_gem 'builder', "~> 0.0" # Gets the old version
+ require_gem 'builder', "~> 1.0" # Gets the new version
+
+== Features
+
+* XML Comments are supported ...
+
+ xml_markup.comment! "This is a comment"
+ #=> <!-- This is a comment -->
+
+* XML processing instructions are supported ...
+
+ xml_markup.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
+ #=> <?xml version="1.0" encoding="UTF-8"?>
+
+ If the processing instruction is omitted, it defaults to "xml".
+ When the processing instruction is "xml", the defaults attributes
+ are:
+
+ <b>version</b>:: 1.0
+ <b>encoding</b>:: "UTF-8"
+
+* XML entity declarations are now supported to a small degree.
+
+ xml_markup.declare! :DOCTYPE, :chapter, :SYSTEM, "../dtds/chapter.dtd"
+ #=> <!DOCTYPE chapter SYSTEM "../dtds/chapter.dtd">
+
+ The parameters to a declare! method must be either symbols or
+ strings. Symbols are inserted without quotes, and strings are
+ inserted with double quotes. Attribute-like arguments in hashes are
+ not allowed.
+
+ If you need to have an argument to declare! be inserted without
+ quotes, but the arguement does not conform to the typical Ruby
+ syntax for symbols, then use the :"string" form to specify a symbol.
+
+ For example:
+
+ xml_markup.declare! :ELEMENT, :chapter, :"(title,para+)"
+ #=> <!ELEMENT chapter (title,para+)>
+
+ Nested entity declarations are allowed. For example:
+
+ @xml_markup.declare! :DOCTYPE, :chapter do |x|
+ x.declare! :ELEMENT, :chapter, :"(title,para+)"
+ x.declare! :ELEMENT, :title, :"(#PCDATA)"
+ x.declare! :ELEMENT, :para, :"(#PCDATA)"
+ end
+
+ #=>
+
+ <!DOCTYPE chapter [
+ <!ELEMENT chapter (title,para+)>
+ <!ELEMENT title (#PCDATA)>
+ <!ELEMENT para (#PCDATA)>
+ ]>
+
+* Some support for XML namespaces is now available. If the first
+ argument to a tag call is a symbol, it will be joined to the tag to
+ produce a namespace:tag combination. It is easier to show this than
+ describe it.
+
+ xml.SOAP :Envelope do ... end
+
+ Just put a space before the colon in a namespace to produce the
+ right form for builder (e.g. "<tt>SOAP:Envelope</tt>" =>
+ "<tt>xml.SOAP :Envelope</tt>")
+
+* String attribute values are <em>now</em> escaped by default by
+ Builder (<b>NOTE:</b> this is _new_ behavior as of version 2.0).
+
+ However, occasionally you need to use entities in attribute values.
+ Using a symbols (rather than a string) for an attribute value will
+ cause Builder to not run its quoting/escaping algorithm on that
+ particular value.
+
+ (<b>Note:</b> The +escape_attrs+ option for builder is now
+ obsolete).
+
+ Example:
+
+ xml = Builder::XmlMarkup.new
+ xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There")
+ xml.target! =>
+ <sample escaped="This&amp;That" unescaped="Here&amp;There"/>
+
+* UTF-8 Support
+
+ Builder correctly translates UTF-8 characters into valid XML. (New
+ in version 2.0.0). Thanks to Sam Ruby for the translation code.
+
+ Example:
+
+ xml = Builder::Markup.new
+ xml.sample("I�t�rn�ti�n�l")
+ xml.target! =>
+ "<sample>I&#241;t&#235;rn&#226;ti&#244;n&#224;l</sample>"
+
+== Contact
+
+Author:: Jim Weirich
+Email:: jim@weirichhouse.org
+Home Page:: http://onestepback.org
+License:: MIT Licence (http://www.opensource.org/licenses/mit-license.html)
View
263 vendor/gems/builder-2.1.2/Rakefile
@@ -0,0 +1,263 @@
+# Rakefile for rake -*- ruby -*-
+
+# Copyright 2004, 2005, 2006 by Jim Weirich (jim@weirichhouse.org).
+# All rights reserved.
+
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as the
+# above copyright notice is included.
+
+require 'rake/clean'
+require 'rake/testtask'
+require 'rake/rdoctask'
+begin
+ require 'rubygems'
+ require 'rake/gempackagetask'
+rescue Exception
+ nil
+end
+
+# Determine the current version of the software
+
+CLOBBER.include('pkg')
+
+CURRENT_VERSION = '2.1.2'
+PKG_VERSION = ENV['REL'] ? ENV['REL'] : CURRENT_VERSION
+
+SRC_RB = FileList['lib/**/*.rb']
+
+# The default task is run if rake is given no explicit arguments.
+
+desc "Default Task"
+task :default => :test_all
+
+# Test Tasks ---------------------------------------------------------
+
+desc "Run all tests"
+task :test_all => [:test_units]
+task :ta => [:test_all]
+
+task :tu => [:test_units]
+
+Rake::TestTask.new("test_units") do |t|
+ t.test_files = FileList['test/test*.rb']
+ t.verbose = false
+end
+
+# Create a task to build the RDOC documentation tree.
+
+rd = Rake::RDocTask.new("rdoc") { |rdoc|
+ rdoc.rdoc_dir = 'html'
+ rdoc.title = "Builder for Markup"
+ rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
+ rdoc.rdoc_files.include('lib/**/*.rb', '[A-Z]*', 'doc/**/*.rdoc')
+ rdoc.template = 'doc/jamis.rb'
+}
+
+# ====================================================================
+# Create a task that will package the Rake software into distributable
+# gem files.
+
+PKG_FILES = FileList[
+ 'lib/**/*.rb',
+ 'test/**/*.rb',
+ 'scripts/**/*.rb'
+]
+PKG_FILES.exclude('test/testcssbuilder.rb')
+PKG_FILES.exclude('lib/builder/css.rb')
+
+BLANKSLATE_FILES = FileList[
+ 'lib/blankslate.rb',
+ 'test/testblankslate.rb'
+]
+
+if ! defined?(Gem)
+ puts "Package Target requires RubyGEMs"
+else
+ spec = Gem::Specification.new do |s|
+
+ #### Basic information.
+
+ s.name = 'builder'
+ s.version = PKG_VERSION
+ s.summary = "Builders for MarkUp."
+ s.description = %{\
+Builder provides a number of builder objects that make creating structured data
+simple to do. Currently the following builder objects are supported:
+
+* XML Markup
+* XML Events
+}
+
+ s.files = PKG_FILES.to_a
+ s.require_path = 'lib'
+ s.autorequire = 'builder'
+
+ s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ }
+
+ s.has_rdoc = true
+ s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
+ s.rdoc_options <<
+ '--title' << 'Builder -- Easy XML Building' <<
+ '--main' << 'README' <<
+ '--line-numbers'
+
+ s.author = "Jim Weirich"
+ s.email = "jim@weirichhouse.org"
+ s.homepage = "http://onestepback.org"
+ end
+
+ blankslate_spec = Gem::Specification.new do |s|
+
+ #### Basic information.
+
+ s.name = 'blankslate'
+ s.version = PKG_VERSION
+ s.summary = "Blank Slate base class."
+ s.description = %{\
+BlankSlate provides a base class where almost all of the methods from Object and
+Kernel have been removed. This is useful when providing proxy object and other
+classes that make heavy use of method_missing.
+}
+
+ s.files = BLANKSLATE_FILES.to_a
+ s.require_path = 'lib'
+ s.autorequire = 'builder'
+
+ s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ }
+
+ s.has_rdoc = true
+ s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
+ s.rdoc_options <<
+ '--title' << 'BlankSlate -- Base Class for building proxies.' <<
+ '--main' << 'README' <<
+ '--line-numbers'
+
+ s.author = "Jim Weirich"
+ s.email = "jim@weirichhouse.org"
+ s.homepage = "http://onestepback.org"
+ end
+
+ namespace 'builder' do
+ Rake::GemPackageTask.new(spec) do |t|
+ t.need_tar = true
+ end
+ end
+
+ namespace 'blankslate' do
+ Rake::GemPackageTask.new(blankslate_spec) do |t|
+ t.need_tar = true
+ end
+ end
+
+ task :package => ['builder:package', 'blankslate:package']
+end
+
+desc "Look for Debugging print lines"
+task :dbg do
+ FileList['**/*.rb'].egrep /\bDBG|\bbreakpoint\b/
+end
+
+# --------------------------------------------------------------------
+# Creating a release
+
+def announce(msg='')
+ STDERR.puts msg
+end
+
+desc "Make a new release"
+task :release => [
+ :prerelease,
+ :clobber,
+ :test_all,
+ :update_version,
+ :package,
+ :tag] do
+
+ announce
+ announce "**************************************************************"
+ announce "* Release #{PKG_VERSION} Complete."
+ announce "* Packages ready to upload."
+ announce "**************************************************************"
+ announce
+end
+
+# Validate that everything is ready to go for a release.
+task :prerelease do
+ announce
+ announce "**************************************************************"
+ announce "* Making RubyGem Release #{PKG_VERSION}"
+ announce "* (current version #{CURRENT_VERSION})"
+ announce "**************************************************************"
+ announce
+
+ # Is a release number supplied?
+ unless ENV['REL']
+ fail "Usage: rake release REL=x.y.z [REUSE=tag_suffix]"
+ end
+
+ # Is the release different than the current release.
+ # (or is REUSE set?)
+ if PKG_VERSION == CURRENT_VERSION && ! ENV['REUSE']
+ fail "Current version is #{PKG_VERSION}, must specify REUSE=tag_suffix to reuse version"
+ end
+
+ # Are all source files checked in?
+ if ENV['RELTEST']
+ announce "Release Task Testing, skipping checked-in file test"
+ else
+ announce "Checking for unchecked-in files..."
+ data = `cvs -q update`
+ unless data =~ /^$/
+ fail "CVS update is not clean ... do you have unchecked-in files?"
+ end
+ announce "No outstanding checkins found ... OK"
+ end
+end
+
+task :update_version => [:prerelease] do
+ if PKG_VERSION == CURRENT_VERSION
+ announce "No version change ... skipping version update"
+ else
+ announce "Updating Builder version to #{PKG_VERSION}"
+ open("Rakefile") do |rakein|
+ open("Rakefile.new", "w") do |rakeout|
+ rakein.each do |line|
+ if line =~ /^CURRENT_VERSION\s*=\s*/
+ rakeout.puts "CURRENT_VERSION = '#{PKG_VERSION}'"
+ else
+ rakeout.puts line
+ end
+ end
+ end
+ end
+ mv "Rakefile.new", "Rakefile"
+ if ENV['RELTEST']
+ announce "Release Task Testing, skipping commiting of new version"
+ else
+ sh %{cvs commit -m "Updated to version #{PKG_VERSION}" Rakefile}
+ end
+ end
+end
+
+desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
+task :tag => [:prerelease] do
+ reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
+ reltag << ENV['REUSE'].gsub(/\./, '_') if ENV['REUSE']
+ announce "Tagging CVS with [#{reltag}]"
+ if ENV['RELTEST']
+ announce "Release Task Testing, skipping CVS tagging"
+ else
+ sh %{cvs tag #{reltag}}
+ end
+end
+
+desc "Install the jamis RDoc template"
+task :install_jamis_template do
+ require 'rbconfig'
+ dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
+ fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
+ install "doc/jamis.rb", dest_dir, :verbose => true
+end
+
+require 'scripts/publish'
View
31 vendor/gems/builder-2.1.2/doc/releases/builder-1.2.4.rdoc
@@ -0,0 +1,31 @@
+= Builder 1.2.4 Released.
+
+Added a "CDATA" method to the XML Markup builder (from Josh Knowles).
+
+== What is Builder?
+
+Builder::XmlMarkup allows easy programmatic creation of XML markup.
+For example:
+
+ builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
+ builder.person { |b| b.name("Jim"); b.phone("555-1234") }
+ puts builder.target!
+
+will generate:
+
+ <person>
+ <name>Jim</name>
+ <phone>555-1234</phone>
+ </person>
+
+== Availability
+
+The easiest way to get and install builder is via RubyGems ...
+
+ gem install builder (you may need root/admin privileges)
+
+== Thanks
+
+* Josh Knowles for the cdata! patch.
+
+-- Jim Weirich
View
46 vendor/gems/builder-2.1.2/doc/releases/builder-2.0.0.rdoc
@@ -0,0 +1,46 @@
+= Builder 2.0.0 Released.
+
+== Changes in 2.0.0
+
+* UTF-8 characters in data are now correctly translated to their XML
+ equivalents. (Thanks to Sam Ruby)
+
+* Attribute values are now escaped by default. See the README
+ file for details.
+
+<b>NOTE:</b> The escaping attribute values by default is different
+than in previous releases of Builder. This makes version 2.0.0
+somewhat incompatible with the 1.x series of Builder. If you use "&",
+"<", or ">" in attributes values, you may have to change your
+code. (Essentially you remove the manual escaping. The new way is
+easier, believe me).
+
+== What is Builder?
+
+Builder::XmlMarkup is a library that allows easy programmatic creation
+of XML markup. For example:
+
+ builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
+ builder.person { |b| b.name("Jim"); b.phone("555-1234") }
+
+will generate:
+
+ <person>
+ <name>Jim</name>
+ <phone>555-1234</phone>
+ </person>
+
+== Availability
+
+The easiest way to get and install builder is via RubyGems ...
+
+ gem install builder (you may need root/admin privileges)
+
+== Thanks
+
+* Sam Ruby for the XChar module and the related UTF-8 translation
+ tools.
+* Also to Sam Ruby for gently persuading me to start quoting attribute
+ values.
+
+-- Jim Weirich
View
58 vendor/gems/builder-2.1.2/doc/releases/builder-2.1.1.rdoc
@@ -0,0 +1,58 @@
+= Builder 2.1.1 Released.
+
+Release 2.1.1 of Builder is mainly a bug fix release.
+
+== Changes in 2.1.1
+
+* Added <tt>reveal</tt> capability to BlankSlate.
+
+* Fixed a bug in BlankSlate where including a module into Object could
+ cause methods to leak into BlankSlate.
+
+* Fixed typo in XmlMarkup class docs (from Martin Fowler).
+
+* Fixed test on private methods to differentiate between targetted and
+ untargetted private methods.
+
+* Removed legacy capture of @self in XmlBase (@self was used back when
+ we used instance eval).
+
+* Added additional tests for global functions (both direct and
+ included).
+
+* Several misc internal cleanups, including rearranging the source
+ code tree.
+
+<b>NOTE:</b> The escaping attribute values by default is different
+than in previous releases of Builder. This makes version 2.0.x
+somewhat incompatible with the 1.x series of Builder. If you use "&",
+"<", or ">" in attributes values, you may have to change your
+code. (Essentially you remove the manual escaping. The new way is
+easier, believe me).
+
+== What is Builder?
+
+Builder::XmlMarkup is a library that allows easy programmatic creation
+of XML markup. For example:
+
+ builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
+ builder.person { |b| b.name("Jim"); b.phone("555-1234") }
+
+will generate:
+
+ <person>
+ <name>Jim</name>
+ <phone>555-1234</phone>
+ </person>
+
+== Availability
+
+The easiest way to get and install builder is via RubyGems ...
+
+ gem install builder (you may need root/admin privileges)
+
+== Thanks
+
+* Martin Fowler for spotting some typos in the documentation.
+
+-- Jim Weirich
View
113 vendor/gems/builder-2.1.2/lib/blankslate.rb
@@ -0,0 +1,113 @@
+#!/usr/bin/env ruby
+#--
+# Copyright 2004, 2006 by Jim Weirich (jim@weirichhouse.org).
+# All rights reserved.
+
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as the
+# above copyright notice is included.
+#++
+
+######################################################################
+# BlankSlate provides an abstract base class with no predefined
+# methods (except for <tt>\_\_send__</tt> and <tt>\_\_id__</tt>).
+# BlankSlate is useful as a base class when writing classes that
+# depend upon <tt>method_missing</tt> (e.g. dynamic proxies).
+#
+class BlankSlate
+ class << self
+
+ # Hide the method named +name+ in the BlankSlate class. Don't
+ # hide +instance_eval+ or any method beginning with "__".
+ def hide(name)
+ if instance_methods.include?(name.to_s) and
+ name !~ /^(__|instance_eval)/
+ @hidden_methods ||= {}
+ @hidden_methods[name.to_sym] = instance_method(name)
+ undef_method name
+ end
+ end
+
+ def find_hidden_method(name)
+ @hidden_methods ||= {}
+ @hidden_methods[name] || superclass.find_hidden_method(name)
+ end
+
+ # Redefine a previously hidden method so that it may be called on a blank
+ # slate object.
+ def reveal(name)
+ bound_method = nil
+ unbound_method = find_hidden_method(name)
+ fail "Don't know how to reveal method '#{name}'" unless unbound_method
+ define_method(name) do |*args|
+ bound_method ||= unbound_method.bind(self)
+ bound_method.call(*args)
+ end
+ end
+ end
+
+ instance_methods.each { |m| hide(m) }
+end
+
+######################################################################
+# Since Ruby is very dynamic, methods added to the ancestors of
+# BlankSlate <em>after BlankSlate is defined</em> will show up in the
+# list of available BlankSlate methods. We handle this by defining a
+# hook in the Object and Kernel classes that will hide any method
+# defined after BlankSlate has been loaded.
+#
+module Kernel
+ class << self
+ alias_method :blank_slate_method_added, :method_added
+
+ # Detect method additions to Kernel and remove them in the
+ # BlankSlate class.
+ def method_added(name)
+ result = blank_slate_method_added(name)
+ return result if self != Kernel
+ BlankSlate.hide(name)
+ result
+ end
+ end
+end
+
+######################################################################
+# Same as above, except in Object.
+#
+class Object
+ class << self
+ alias_method :blank_slate_method_added, :method_added
+
+ # Detect method additions to Object and remove them in the
+ # BlankSlate class.
+ def method_added(name)
+ result = blank_slate_method_added(name)
+ return result if self != Object
+ BlankSlate.hide(name)
+ result
+ end
+
+ def find_hidden_method(name)
+ nil
+ end
+ end
+end
+
+######################################################################
+# Also, modules included into Object need to be scanned and have their
+# instance methods removed from blank slate. In theory, modules
+# included into Kernel would have to be removed as well, but a
+# "feature" of Ruby prevents late includes into modules from being
+# exposed in the first place.
+#
+class Module
+ alias blankslate_original_append_features append_features
+ def append_features(mod)
+ result = blankslate_original_append_features(mod)
+ return result if mod != Object
+ instance_methods.each do |name|
+ BlankSlate.hide(name)
+ end
+ result
+ end
+end
View
13 vendor/gems/builder-2.1.2/lib/builder.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+
+#--
+# Copyright 2004 by Jim Weirich (jim@weirichhouse.org).
+# All rights reserved.
+
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as the
+# above copyright notice is included.
+#++
+
+require 'builder/xmlmarkup'
+require 'builder/xmlevents'
View
20 vendor/gems/builder-2.1.2/lib/builder/blankslate.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+#--
+# Copyright 2004, 2006 by Jim Weirich (jim@weirichhouse.org).
+# All rights reserved.
+
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as the
+# above copyright notice is included.
+#++
+
+require 'blankslate'
+
+######################################################################
+# BlankSlate has been promoted to a top level name and is now
+# available as a standalone gem. We make the name available in the
+# Builder namespace for compatibility.
+#
+module Builder
+ BlankSlate = ::BlankSlate
+end
View
115 vendor/gems/builder-2.1.2/lib/builder/xchar.rb
@@ -0,0 +1,115 @@
+#!/usr/bin/env ruby
+
+# The XChar library is provided courtesy of Sam Ruby (See
+# http://intertwingly.net/stories/2005/09/28/xchar.rb)
+
+# --------------------------------------------------------------------
+
+# If the Builder::XChar module is not currently defined, fail on any
+# name clashes in standard library classes.
+
+module Builder
+ def self.check_for_name_collision(klass, method_name, defined_constant=nil)
+ if klass.instance_methods.include?(method_name)
+ fail RuntimeError,
+ "Name Collision: Method '#{method_name}' is already defined in #{klass}"
+ end
+ end
+end
+
+if ! defined?(Builder::XChar)
+ Builder.check_for_name_collision(String, "to_xs")
+ Builder.check_for_name_collision(Fixnum, "xchr")
+end
+
+######################################################################
+module Builder
+
+ ####################################################################
+ # XML Character converter, from Sam Ruby:
+ # (see http://intertwingly.net/stories/2005/09/28/xchar.rb).
+ #
+ module XChar # :nodoc:
+
+ # See
+ # http://intertwingly.net/stories/2004/04/14/i18n.html#CleaningWindows
+ # for details.
+ CP1252 = { # :nodoc:
+ 128 => 8364, # euro sign
+ 130 => 8218, # single low-9 quotation mark
+ 131 => 402, # latin small letter f with hook
+ 132 => 8222, # double low-9 quotation mark
+ 133 => 8230, # horizontal ellipsis
+ 134 => 8224, # dagger
+ 135 => 8225, # double dagger
+ 136 => 710, # modifier letter circumflex accent
+ 137 => 8240, # per mille sign
+ 138 => 352, # latin capital letter s with caron
+ 139 => 8249, # single left-pointing angle quotation mark
+ 140 => 338, # latin capital ligature oe
+ 142 => 381, # latin capital letter z with caron
+ 145 => 8216, # left single quotation mark
+ 146 => 8217, # right single quotation mark
+ 147 => 8220, # left double quotation mark
+ 148 => 8221, # right double quotation mark
+ 149 => 8226, # bullet
+ 150 => 8211, # en dash
+ 151 => 8212, # em dash
+ 152 => 732, # small tilde
+ 153 => 8482, # trade mark sign
+ 154 => 353, # latin small letter s with caron
+ 155 => 8250, # single right-pointing angle quotation mark
+ 156 => 339, # latin small ligature oe
+ 158 => 382, # latin small letter z with caron
+ 159 => 376, # latin capital letter y with diaeresis
+ }
+
+ # See http://www.w3.org/TR/REC-xml/#dt-chardata for details.
+ PREDEFINED = {
+ 38 => '&amp;', # ampersand
+ 60 => '&lt;', # left angle bracket
+ 62 => '&gt;', # right angle bracket
+ }
+
+ # See http://www.w3.org/TR/REC-xml/#charsets for details.
+ VALID = [
+ 0x9, 0xA, 0xD,
+ (0x20..0xD7FF),
+ (0xE000..0xFFFD),
+ (0x10000..0x10FFFF)
+ ]
+ end
+
+end
+
+
+######################################################################
+# Enhance the Fixnum class with a XML escaped character conversion.
+#
+class Fixnum
+ XChar = Builder::XChar if ! defined?(XChar)
+
+ # XML escaped version of chr
+ def xchr
+ n = XChar::CP1252[self] || self
+ case n when *XChar::VALID
+ XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};")
+ else
+ '*'
+ end
+ end
+end
+
+
+######################################################################
+# Enhance the String class with a XML escaped character version of
+# to_s.
+#
+class String
+ # XML escaped version of to_s
+ def to_xs
+ unpack('U*').map {|n| n.xchr}.join # ASCII, UTF-8
+ rescue
+ unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252
+ end
+end
View
139 vendor/gems/builder-2.1.2/lib/builder/xmlbase.rb
@@ -0,0 +1,139 @@
+#!/usr/bin/env ruby
+
+require 'builder/blankslate'
+
+module Builder
+
+ # Generic error for builder
+ class IllegalBlockError < RuntimeError; end
+
+ # XmlBase is a base class for building XML builders. See
+ # Builder::XmlMarkup and Builder::XmlEvents for examples.
+ class XmlBase < BlankSlate
+
+ # Create an XML markup builder.
+ #
+ # out:: Object receiving the markup. +out+ must respond to
+ # <tt><<</tt>.
+ # indent:: Number of spaces used for indentation (0 implies no
+ # indentation and no line breaks).
+ # initial:: Level of initial indentation.
+ #
+ def initialize(indent=0, initial=0)
+ @indent = indent
+ @level = initial
+ end
+
+ # Create a tag named +sym+. Other than the first argument which
+ # is the tag name, the arguements are the same as the tags
+ # implemented via <tt>method_missing</tt>.
+ def tag!(sym, *args, &block)
+ method_missing(sym.to_sym, *args, &block)
+ end
+
+ # Create XML markup based on the name of the method. This method
+ # is never invoked directly, but is called for each markup method
+ # in the markup block.
+ def method_missing(sym, *args, &block)
+ text = nil
+ attrs = nil
+ sym = "#{sym}:#{args.shift}" if args.first.kind_of?(Symbol)
+ args.each do |arg|
+ case arg
+ when Hash
+ attrs ||= {}
+ attrs.merge!(arg)
+ else
+ text ||= ''
+ text << arg.to_s
+ end
+ end
+ if block
+ unless text.nil?
+ raise ArgumentError, "XmlMarkup cannot mix a text argument with a block"
+ end
+ _indent
+ _start_tag(sym, attrs)
+ _newline
+ _nested_structures(block)
+ _indent
+ _end_tag(sym)
+ _newline
+ elsif text.nil?
+ _indent
+ _start_tag(sym, attrs, true)
+ _newline
+ else
+ _indent
+ _start_tag(sym, attrs)
+ text! text
+ _end_tag(sym)
+ _newline
+ end
+ @target
+ end
+
+ # Append text to the output target. Escape any markup. May be
+ # used within the markup brakets as:
+ #
+ # builder.p { |b| b.br; b.text! "HI" } #=> <p><br/>HI</p>
+ def text!(text)
+ _text(_escape(text))
+ end
+
+ # Append text to the output target without escaping any markup.
+ # May be used within the markup brakets as:
+ #
+ # builder.p { |x| x << "<br/>HI" } #=> <p><br/>HI</p>
+ #
+ # This is useful when using non-builder enabled software that
+ # generates strings. Just insert the string directly into the
+ # builder without changing the inserted markup.
+ #
+ # It is also useful for stacking builder objects. Builders only
+ # use <tt><<</tt> to append to the target, so by supporting this
+ # method/operation builders can use other builders as their
+ # targets.
+ def <<(text)
+ _text(text)
+ end
+
+ # For some reason, nil? is sent to the XmlMarkup object. If nil?
+ # is not defined and method_missing is invoked, some strange kind
+ # of recursion happens. Since nil? won't ever be an XML tag, it
+ # is pretty safe to define it here. (Note: this is an example of
+ # cargo cult programming,
+ # cf. http://fishbowl.pastiche.org/2004/10/13/cargo_cult_programming).
+ def nil?
+ false
+ end
+
+ private
+
+ require 'builder/xchar'
+ def _escape(text)
+ text.to_xs
+ end
+
+ def _escape_quote(text)
+ _escape(text).gsub(%r{"}, '&quot;') # " WART
+ end
+
+ def _newline
+ return if @indent == 0
+ text! "\n"
+ end
+
+ def _indent
+ return if @indent == 0 || @level == 0
+ text!(" " * (@level * @indent))
+ end
+
+ def _nested_structures(block)
+ @level += 1
+ block.call(self)
+ ensure
+ @level -= 1
+ end
+ end
+end
View
63 vendor/gems/builder-2.1.2/lib/builder/xmlevents.rb
@@ -0,0 +1,63 @@
+#!/usr/bin/env ruby
+
+#--
+# Copyright 2004 by Jim Weirich (jim@weirichhouse.org).
+# All rights reserved.
+
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as the
+# above copyright notice is included.
+#++
+
+require 'builder/xmlmarkup'
+
+module Builder
+
+ # Create a series of SAX-like XML events (e.g. start_tag, end_tag)
+ # from the markup code. XmlEvent objects are used in a way similar
+ # to XmlMarkup objects, except that a series of events are generated
+ # and passed to a handler rather than generating character-based
+ # markup.
+ #
+ # Usage:
+ # xe = Builder::XmlEvents.new(hander)
+ # xe.title("HI") # Sends start_tag/end_tag/text messages to the handler.
+ #
+ # Indentation may also be selected by providing value for the
+ # indentation size and initial indentation level.
+ #
+ # xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level)
+ #
+ # == XML Event Handler
+ #
+ # The handler object must expect the following events.
+ #
+ # [<tt>start_tag(tag, attrs)</tt>]
+ # Announces that a new tag has been found. +tag+ is the name of
+ # the tag and +attrs+ is a hash of attributes for the tag.
+ #
+ # [<tt>end_tag(tag)</tt>]
+ # Announces that an end tag for +tag+ has been found.
+ #
+ # [<tt>text(text)</tt>]
+ # Announces that a string of characters (+text+) has been found.
+ # A series of characters may be broken up into more than one
+ # +text+ call, so the client cannot assume that a single
+ # callback contains all the text data.
+ #
+ class XmlEvents < XmlMarkup
+ def text!(text)
+ @target.text(text)
+ end
+
+ def _start_tag(sym, attrs, end_too=false)
+ @target.start_tag(sym, attrs)
+ _end_tag(sym) if end_too
+ end
+
+ def _end_tag(sym)
+ @target.end_tag(sym)
+ end
+ end
+
+end
View
328 vendor/gems/builder-2.1.2/lib/builder/xmlmarkup.rb
@@ -0,0 +1,328 @@
+#!/usr/bin/env ruby
+#--
+# Copyright 2004, 2005 by Jim Weirich (jim@weirichhouse.org).
+# All rights reserved.
+
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as the
+# above copyright notice is included.
+#++
+
+# Provide a flexible and easy to use Builder for creating XML markup.
+# See XmlBuilder for usage details.
+
+require 'builder/xmlbase'
+
+module Builder
+
+ # Create XML markup easily. All (well, almost all) methods sent to
+ # an XmlMarkup object will be translated to the equivalent XML
+ # markup. Any method with a block will be treated as an XML markup
+ # tag with nested markup in the block.
+ #
+ # Examples will demonstrate this easier than words. In the
+ # following, +xm+ is an +XmlMarkup+ object.
+ #
+ # xm.em("emphasized") # => <em>emphasized</em>
+ # xm.em { xmm.b("emp & bold") } # => <em><b>emph &amp; bold</b></em>
+ # xm.a("A Link", "href"=>"http://onestepback.org")
+ # # => <a href="http://onestepback.org">A Link</a>
+ # xm.div { br } # => <div><br/></div>
+ # xm.target("name"=>"compile", "option"=>"fast")
+ # # => <target option="fast" name="compile"\>
+ # # NOTE: order of attributes is not specified.
+ #
+ # xm.instruct! # <?xml version="1.0" encoding="UTF-8"?>
+ # xm.html { # <html>
+ # xm.head { # <head>
+ # xm.title("History") # <title>History</title>
+ # } # </head>
+ # xm.body { # <body>
+ # xm.comment! "HI" # <!-- HI -->
+ # xm.h1("Header") # <h1>Header</h1>
+ # xm.p("paragraph") # <p>paragraph</p>
+ # } # </body>
+ # } # </html>
+ #
+ # == Notes:
+ #
+ # * The order that attributes are inserted in markup tags is
+ # undefined.
+ #
+ # * Sometimes you wish to insert text without enclosing tags. Use
+ # the <tt>text!</tt> method to accomplish this.
+ #
+ # Example:
+ #
+ # xm.div { # <div>
+ # xm.text! "line"; xm.br # line<br/>
+ # xm.text! "another line"; xmbr # another line<br/>
+ # } # </div>
+ #
+ # * The special XML characters <, >, and & are converted to &lt;,
+ # &gt; and &amp; automatically. Use the <tt><<</tt> operation to
+ # insert text without modification.
+ #
+ # * Sometimes tags use special characters not allowed in ruby
+ # identifiers. Use the <tt>tag!</tt> method to handle these
+ # cases.
+ #
+ # Example:
+ #
+ # xml.tag!("SOAP:Envelope") { ... }
+ #
+ # will produce ...
+ #
+ # <SOAP:Envelope> ... </SOAP:Envelope>"
+ #
+ # <tt>tag!</tt> will also take text and attribute arguments (after
+ # the tag name) like normal markup methods. (But see the next
+ # bullet item for a better way to handle XML namespaces).
+ #
+ # * Direct support for XML namespaces is now available. If the
+ # first argument to a tag call is a symbol, it will be joined to
+ # the tag to produce a namespace:tag combination. It is easier to
+ # show this than describe it.
+ #
+ # xml.SOAP :Envelope do ... end
+ #
+ # Just put a space before the colon in a namespace to produce the
+ # right form for builder (e.g. "<tt>SOAP:Envelope</tt>" =>
+ # "<tt>xml.SOAP :Envelope</tt>")
+ #
+ # * XmlMarkup builds the markup in any object (called a _target_)
+ # that accepts the <tt><<</tt> method. If no target is given,
+ # then XmlMarkup defaults to a string target.
+ #
+ # Examples:
+ #
+ # xm = Builder::XmlMarkup.new
+ # result = xm.title("yada")
+ # # result is a string containing the markup.
+ #
+ # buffer = ""
+ # xm = Builder::XmlMarkup.new(buffer)
+ # # The markup is appended to buffer (using <<)
+ #
+ # xm = Builder::XmlMarkup.new(STDOUT)
+ # # The markup is written to STDOUT (using <<)
+ #
+ # xm = Builder::XmlMarkup.new
+ # x2 = Builder::XmlMarkup.new(:target=>xm)
+ # # Markup written to +x2+ will be send to +xm+.
+ #
+ # * Indentation is enabled by providing the number of spaces to
+ # indent for each level as a second argument to XmlBuilder.new.
+ # Initial indentation may be specified using a third parameter.
+ #
+ # Example:
+ #
+ # xm = Builder.new(:indent=>2)
+ # # xm will produce nicely formatted and indented XML.
+ #
+ # xm = Builder.new(:indent=>2, :margin=>4)
+ # # xm will produce nicely formatted and indented XML with 2
+ # # spaces per indent and an over all indentation level of 4.
+ #
+ # builder = Builder::XmlMarkup.new(:target=>$stdout, :indent=>2)
+ # builder.name { |b| b.first("Jim"); b.last("Weirich) }
+ # # prints:
+ # # <name>
+ # # <first>Jim</first>
+ # # <last>Weirich</last>
+ # # </name>
+ #
+ # * The instance_eval implementation which forces self to refer to
+ # the message receiver as self is now obsolete. We now use normal
+ # block calls to execute the markup block. This means that all
+ # markup methods must now be explicitly send to the xml builder.
+ # For instance, instead of
+ #
+ # xml.div { strong("text") }
+ #
+ # you need to write:
+ #
+ # xml.div { xml.strong("text") }
+ #
+ # Although more verbose, the subtle change in semantics within the
+ # block was found to be prone to error. To make this change a
+ # little less cumbersome, the markup block now gets the markup
+ # object sent as an argument, allowing you to use a shorter alias
+ # within the block.
+ #
+ # For example:
+ #
+ # xml_builder = Builder::XmlMarkup.new
+ # xml_builder.div { |xml|
+ # xml.stong("text")
+ # }
+ #
+ class XmlMarkup < XmlBase
+
+ # Create an XML markup builder. Parameters are specified by an
+ # option hash.
+ #
+ # :target=><em>target_object</em>::
+ # Object receiving the markup. +out+ must respond to the
+ # <tt><<</tt> operator. The default is a plain string target.
+ #
+ # :indent=><em>indentation</em>::
+ # Number of spaces used for indentation. The default is no
+ # indentation and no line breaks.
+ #
+ # :margin=><em>initial_indentation_level</em>::
+ # Amount of initial indentation (specified in levels, not
+ # spaces).
+ #
+ # :escape_attrs=><b>OBSOLETE</em>::
+ # The :escape_attrs option is no longer supported by builder
+ # (and will be quietly ignored). String attribute values are
+ # now automatically escaped. If you need unescaped attribute
+ # values (perhaps you are using entities in the attribute
+ # values), then give the value as a Symbol. This allows much
+ # finer control over escaping attribute values.
+ #
+ def initialize(options={})
+ indent = options[:indent] || 0
+ margin = options[:margin] || 0
+ super(indent, margin)
+ @target = options[:target] || ""
+ end
+
+ # Return the target of the builder.
+ def target!
+ @target
+ end
+
+ def comment!(comment_text)
+ _ensure_no_block block_given?
+ _special("<!-- ", " -->", comment_text, nil)
+ end
+
+ # Insert an XML declaration into the XML markup.
+ #
+ # For example:
+ #
+ # xml.declare! :ELEMENT, :blah, "yada"
+ # # => <!ELEMENT blah "yada">
+ def declare!(inst, *args, &block)
+ _indent
+ @target << "<!#{inst}"
+ args.each do |arg|
+ case arg
+ when String
+ @target << %{ "#{arg}"} # " WART
+ when Symbol
+ @target << " #{arg}"
+ end
+ end
+ if block_given?
+ @target << " ["
+ _newline
+ _nested_structures(block)
+ @target << "]"
+ end
+ @target << ">"
+ _newline
+ end
+
+ # Insert a processing instruction into the XML markup. E.g.
+ #
+ # For example:
+ #
+ # xml.instruct!
+ # #=> <?xml version="1.0" encoding="UTF-8"?>
+ # xml.instruct! :aaa, :bbb=>"ccc"
+ # #=> <?aaa bbb="ccc"?>
+ #
+ def instruct!(directive_tag=:xml, attrs={})
+ _ensure_no_block block_given?
+ if directive_tag == :xml
+ a = { :version=>"1.0", :encoding=>"UTF-8" }
+ attrs = a.merge attrs
+ end
+ _special(
+ "<?#{directive_tag}",
+ "?>",
+ nil,
+ attrs,
+ [:version, :encoding, :standalone])
+ end
+
+ # Insert a CDATA section into the XML markup.
+ #
+ # For example:
+ #
+ # xml.cdata!("text to be included in cdata")
+ # #=> <![CDATA[text to be included in cdata]]>
+ #
+ def cdata!(text)
+ _ensure_no_block block_given?
+ _special("<![CDATA[", "]]>", text, nil)
+ end
+
+ private
+
+ # NOTE: All private methods of a builder object are prefixed when
+ # a "_" character to avoid possible conflict with XML tag names.
+
+ # Insert text directly in to the builder's target.
+ def _text(text)
+ @target << text
+ end
+
+ # Insert special instruction.
+ def _special(open, close, data=nil, attrs=nil, order=[])
+ _indent
+ @target << open
+ @target << data if data
+ _insert_attributes(attrs, order) if attrs
+ @target << close
+ _newline
+ end
+
+ # Start an XML tag. If <tt>end_too</tt> is true, then the start
+ # tag is also the end tag (e.g. <br/>
+ def _start_tag(sym, attrs, end_too=false)
+ @target << "<#{sym}"
+ _insert_attributes(attrs)
+ @target << "/" if end_too
+ @target << ">"
+ end
+
+ # Insert an ending tag.
+ def _end_tag(sym)
+ @target << "</#{sym}>"
+ end
+
+ # Insert the attributes (given in the hash).
+ def _insert_attributes(attrs, order=[])
+ return if attrs.nil?
+ order.each do |k|