narf 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. data/ChangeLog +22 -0
  2. data/lib/web/htmltools/xmltree.rb +2 -2
  3. data/lib/web/htmltools/xpath.rb +1 -1
  4. data/narf.gemspec +1 -1
  5. metadata +2 -460
  6. data/InstalledFiles +0 -2227
  7. data/config.save +0 -12
  8. data/doc/apache_cgi.txt~ +0 -17
  9. data/doc/fastcgi.txt~ +0 -19
  10. data/doc/rdoc/classes/Web.html +0 -369
  11. data/doc/rdoc/classes/Web.src/M000002.html +0 -15
  12. data/doc/rdoc/classes/Web.src/M000003.html +0 -15
  13. data/doc/rdoc/classes/Web.src/M000004.html +0 -15
  14. data/doc/rdoc/classes/Web.src/M000005.html +0 -15
  15. data/doc/rdoc/classes/Web.src/M000006.html +0 -20
  16. data/doc/rdoc/classes/Web.src/M000007.html +0 -18
  17. data/doc/rdoc/classes/Web.src/M000008.html +0 -18
  18. data/doc/rdoc/classes/Web.src/M000009.html +0 -18
  19. data/doc/rdoc/classes/Web.src/M000010.html +0 -15
  20. data/doc/rdoc/classes/Web.src/M000011.html +0 -15
  21. data/doc/rdoc/classes/Web.src/M000012.html +0 -15
  22. data/doc/rdoc/classes/Web/CGD.html +0 -173
  23. data/doc/rdoc/classes/Web/CGD.src/M000037.html +0 -24
  24. data/doc/rdoc/classes/Web/CGD.src/M000038.html +0 -24
  25. data/doc/rdoc/classes/Web/CGD.src/M000039.html +0 -15
  26. data/doc/rdoc/classes/Web/CGD.src/M000040.html +0 -15
  27. data/doc/rdoc/classes/Web/CGD.src/M000041.html +0 -23
  28. data/doc/rdoc/classes/Web/CGI.html +0 -946
  29. data/doc/rdoc/classes/Web/CGI.src/M000051.html +0 -15
  30. data/doc/rdoc/classes/Web/CGI.src/M000052.html +0 -24
  31. data/doc/rdoc/classes/Web/CGI.src/M000053.html +0 -15
  32. data/doc/rdoc/classes/Web/CGI.src/M000054.html +0 -15
  33. data/doc/rdoc/classes/Web/CGI.src/M000055.html +0 -15
  34. data/doc/rdoc/classes/Web/CGI.src/M000056.html +0 -15
  35. data/doc/rdoc/classes/Web/CGI.src/M000057.html +0 -17
  36. data/doc/rdoc/classes/Web/CGI.src/M000058.html +0 -34
  37. data/doc/rdoc/classes/Web/CGI.src/M000059.html +0 -22
  38. data/doc/rdoc/classes/Web/CGI.src/M000060.html +0 -15
  39. data/doc/rdoc/classes/Web/CGI.src/M000061.html +0 -15
  40. data/doc/rdoc/classes/Web/CGI.src/M000062.html +0 -19
  41. data/doc/rdoc/classes/Web/CGI.src/M000063.html +0 -18
  42. data/doc/rdoc/classes/Web/CGI.src/M000064.html +0 -19
  43. data/doc/rdoc/classes/Web/CGI.src/M000065.html +0 -15
  44. data/doc/rdoc/classes/Web/CGI.src/M000066.html +0 -15
  45. data/doc/rdoc/classes/Web/CGI.src/M000067.html +0 -15
  46. data/doc/rdoc/classes/Web/CGI.src/M000068.html +0 -13
  47. data/doc/rdoc/classes/Web/CGI.src/M000069.html +0 -13
  48. data/doc/rdoc/classes/Web/CGI.src/M000070.html +0 -13
  49. data/doc/rdoc/classes/Web/CGI.src/M000071.html +0 -13
  50. data/doc/rdoc/classes/Web/CGI.src/M000072.html +0 -19
  51. data/doc/rdoc/classes/Web/CGI.src/M000073.html +0 -15
  52. data/doc/rdoc/classes/Web/CGI.src/M000074.html +0 -19
  53. data/doc/rdoc/classes/Web/CGI.src/M000075.html +0 -15
  54. data/doc/rdoc/classes/Web/CGI.src/M000076.html +0 -15
  55. data/doc/rdoc/classes/Web/CGI.src/M000077.html +0 -15
  56. data/doc/rdoc/classes/Web/CGI.src/M000078.html +0 -20
  57. data/doc/rdoc/classes/Web/CGI.src/M000079.html +0 -36
  58. data/doc/rdoc/classes/Web/CGI.src/M000080.html +0 -19
  59. data/doc/rdoc/classes/Web/CGI.src/M000081.html +0 -18
  60. data/doc/rdoc/classes/Web/CGI.src/M000082.html +0 -15
  61. data/doc/rdoc/classes/Web/CGI.src/M000083.html +0 -17
  62. data/doc/rdoc/classes/Web/CGI.src/M000084.html +0 -15
  63. data/doc/rdoc/classes/Web/CGI.src/M000085.html +0 -16
  64. data/doc/rdoc/classes/Web/CGI.src/M000086.html +0 -15
  65. data/doc/rdoc/classes/Web/CGI.src/M000087.html +0 -15
  66. data/doc/rdoc/classes/Web/CGI.src/M000088.html +0 -15
  67. data/doc/rdoc/classes/Web/CGI.src/M000089.html +0 -16
  68. data/doc/rdoc/classes/Web/CGI.src/M000090.html +0 -15
  69. data/doc/rdoc/classes/Web/CGI.src/M000091.html +0 -15
  70. data/doc/rdoc/classes/Web/CGI.src/M000092.html +0 -15
  71. data/doc/rdoc/classes/Web/CGI.src/M000093.html +0 -15
  72. data/doc/rdoc/classes/Web/CGI.src/M000094.html +0 -15
  73. data/doc/rdoc/classes/Web/CGI.src/M000095.html +0 -15
  74. data/doc/rdoc/classes/Web/CGI.src/M000096.html +0 -19
  75. data/doc/rdoc/classes/Web/CGI.src/M000097.html +0 -15
  76. data/doc/rdoc/classes/Web/CGI.src/M000098.html +0 -15
  77. data/doc/rdoc/classes/Web/CGI.src/M000099.html +0 -43
  78. data/doc/rdoc/classes/Web/CGI.src/M000100.html +0 -18
  79. data/doc/rdoc/classes/Web/CGI.src/M000101.html +0 -20
  80. data/doc/rdoc/classes/Web/CGI.src/M000102.html +0 -15
  81. data/doc/rdoc/classes/Web/CGI.src/M000103.html +0 -15
  82. data/doc/rdoc/classes/Web/CGI.src/M000104.html +0 -15
  83. data/doc/rdoc/classes/Web/CGI.src/M000105.html +0 -24
  84. data/doc/rdoc/classes/Web/CGI.src/M000106.html +0 -24
  85. data/doc/rdoc/classes/Web/CGI.src/M000107.html +0 -22
  86. data/doc/rdoc/classes/Web/CaseInsensitiveHash.html +0 -104
  87. data/doc/rdoc/classes/Web/CaseInsensitiveHash.src/M000118.html +0 -15
  88. data/doc/rdoc/classes/Web/CaseInsensitiveHash.src/M000119.html +0 -15
  89. data/doc/rdoc/classes/Web/CaseInsensitiveHash.src/M000120.html +0 -15
  90. data/doc/rdoc/classes/Web/Mime.html +0 -122
  91. data/doc/rdoc/classes/Web/Mime.src/M000118.html +0 -15
  92. data/doc/rdoc/classes/Web/Mime.src/M000119.html +0 -15
  93. data/doc/rdoc/classes/Web/Mime.src/M000120.html +0 -23
  94. data/doc/rdoc/classes/Web/Mime.src/M000121.html +0 -15
  95. data/doc/rdoc/classes/Web/Mime.src/M000122.html +0 -15
  96. data/doc/rdoc/classes/Web/Mime.src/M000123.html +0 -23
  97. data/doc/rdoc/classes/Web/Mime.src/M000124.html +0 -15
  98. data/doc/rdoc/classes/Web/Narflates.html +0 -134
  99. data/doc/rdoc/classes/Web/Parser.html +0 -219
  100. data/doc/rdoc/classes/Web/Parser.src/M000013.html +0 -21
  101. data/doc/rdoc/classes/Web/Parser.src/M000014.html +0 -19
  102. data/doc/rdoc/classes/Web/Parser.src/M000015.html +0 -21
  103. data/doc/rdoc/classes/Web/Parser.src/M000016.html +0 -15
  104. data/doc/rdoc/classes/Web/Parser.src/M000017.html +0 -30
  105. data/doc/rdoc/classes/Web/Parser.src/M000018.html +0 -15
  106. data/doc/rdoc/classes/Web/Parser.src/M000019.html +0 -19
  107. data/doc/rdoc/classes/Web/Parser.src/M000020.html +0 -27
  108. data/doc/rdoc/classes/Web/Parser.src/M000021.html +0 -15
  109. data/doc/rdoc/classes/Web/Parser.src/M000022.html +0 -16
  110. data/doc/rdoc/classes/Web/Parser.src/M000023.html +0 -18
  111. data/doc/rdoc/classes/Web/Session.html +0 -178
  112. data/doc/rdoc/classes/Web/Session.src/M000042.html +0 -20
  113. data/doc/rdoc/classes/Web/Session.src/M000043.html +0 -19
  114. data/doc/rdoc/classes/Web/Session.src/M000044.html +0 -21
  115. data/doc/rdoc/classes/Web/Session.src/M000045.html +0 -21
  116. data/doc/rdoc/classes/Web/Session.src/M000046.html +0 -15
  117. data/doc/rdoc/classes/Web/Session.src/M000047.html +0 -17
  118. data/doc/rdoc/classes/Web/Session.src/M000048.html +0 -15
  119. data/doc/rdoc/classes/Web/Session.src/M000049.html +0 -15
  120. data/doc/rdoc/classes/Web/Session.src/M000050.html +0 -16
  121. data/doc/rdoc/classes/Web/Testing.html +0 -474
  122. data/doc/rdoc/classes/Web/Testing.src/M000024.html +0 -15
  123. data/doc/rdoc/classes/Web/Testing.src/M000025.html +0 -25
  124. data/doc/rdoc/classes/Web/Testing.src/M000026.html +0 -15
  125. data/doc/rdoc/classes/Web/Testing.src/M000027.html +0 -25
  126. data/doc/rdoc/classes/Web/Testing.src/M000028.html +0 -57
  127. data/doc/rdoc/classes/Web/Testing.src/M000029.html +0 -15
  128. data/doc/rdoc/classes/Web/Testing.src/M000030.html +0 -15
  129. data/doc/rdoc/classes/Web/Testing.src/M000031.html +0 -15
  130. data/doc/rdoc/classes/Web/Testing.src/M000032.html +0 -15
  131. data/doc/rdoc/classes/Web/Testing.src/M000033.html +0 -15
  132. data/doc/rdoc/classes/Web/Testing.src/M000034.html +0 -15
  133. data/doc/rdoc/classes/Web/Testing.src/M000035.html +0 -15
  134. data/doc/rdoc/classes/Web/Testing.src/M000036.html +0 -18
  135. data/doc/rdoc/classes/Web/Upload.html +0 -160
  136. data/doc/rdoc/classes/Web/Upload.src/M000108.html +0 -25
  137. data/doc/rdoc/classes/Web/Upload.src/M000109.html +0 -18
  138. data/doc/rdoc/classes/Web/Upload.src/M000110.html +0 -16
  139. data/doc/rdoc/classes/Web/Upload.src/M000111.html +0 -16
  140. data/doc/rdoc/classes/Web/Wiki.html +0 -249
  141. data/doc/rdoc/classes/Web/Wiki.src/M000112.html +0 -25
  142. data/doc/rdoc/classes/Web/Wiki.src/M000113.html +0 -15
  143. data/doc/rdoc/classes/Web/Wiki.src/M000114.html +0 -26
  144. data/doc/rdoc/classes/Web/Wiki.src/M000115.html +0 -21
  145. data/doc/rdoc/classes/Web/Wiki.src/M000116.html +0 -18
  146. data/doc/rdoc/classes/Web/Wiki.src/M000117.html +0 -19
  147. data/doc/rdoc/created.rid +0 -1
  148. data/doc/rdoc/files/README.html +0 -230
  149. data/doc/rdoc/files/doc/apache_cgi_txt.html +0 -76
  150. data/doc/rdoc/files/doc/fastcgi_txt.html +0 -82
  151. data/doc/rdoc/files/doc/mod_ruby_txt.html +0 -62
  152. data/doc/rdoc/files/doc/webrick_txt.html +0 -79
  153. data/doc/rdoc/files/examples/examples_rdoc.html +0 -73
  154. data/doc/rdoc/files/lib/web/cgi_rb.html +0 -75
  155. data/doc/rdoc/files/lib/web/mime_rb.html +0 -67
  156. data/doc/rdoc/files/lib/web/parser_rb.html +0 -73
  157. data/doc/rdoc/files/lib/web/session_rb.html +0 -73
  158. data/doc/rdoc/files/lib/web/template_rb.html +0 -73
  159. data/doc/rdoc/files/lib/web/testing_rb.html +0 -67
  160. data/doc/rdoc/files/lib/web/upload_rb.html +0 -73
  161. data/doc/rdoc/files/lib/web/wiki_rb.html +0 -79
  162. data/doc/rdoc/files/lib/web_rb.html +0 -116
  163. data/doc/rdoc/files/lib/web_rb.src/M000001.html +0 -15
  164. data/doc/rdoc/fr_class_index.html +0 -47
  165. data/doc/rdoc/fr_file_index.html +0 -52
  166. data/doc/rdoc/fr_method_index.html +0 -158
  167. data/doc/rdoc/index.html +0 -22
  168. data/doc/rdoc/rdoc-style.css +0 -99
  169. data/examples/admin.rb~ +0 -5
  170. data/examples/cookbook.rdoc~ +0 -238
  171. data/examples/examples.rdoc~ +0 -17
  172. data/examples/hello.world.rb~ +0 -3
  173. data/examples/session.rb~ +0 -31
  174. data/examples/test/test.hello.world.rb~ +0 -9
  175. data/examples/test/test.session.rb~ +0 -37
  176. data/examples/wiki.rb~ +0 -5
  177. data/lib/web.rb~ +0 -290
  178. data/lib/web/#assertinclude.rb# +0 -110
  179. data/lib/web/assertinclude.rb~ +0 -110
  180. data/lib/web/cgi.rb~ +0 -640
  181. data/lib/web/htmlparser/html-parser.rb~ +0 -429
  182. data/lib/web/htmlparser/sgml-parser.rb~ +0 -332
  183. data/lib/web/htmltools/element.rb~ +0 -296
  184. data/lib/web/htmltools/stparser.rb~ +0 -276
  185. data/lib/web/htmltools/tags.rb~ +0 -286
  186. data/lib/web/htmltools/tree.rb~ +0 -139
  187. data/lib/web/htmltools/xmltree.rb~ +0 -160
  188. data/lib/web/htmltools/xpath.rb~ +0 -71
  189. data/lib/web/parser.rb~ +0 -288
  190. data/lib/web/request.rb~ +0 -238
  191. data/lib/web/runner.rb~ +0 -26
  192. data/lib/web/sapi/fastcgi.rb~ +0 -25
  193. data/lib/web/sapi/mod_ruby.rb~ +0 -46
  194. data/lib/web/sapi/webrick.rb~ +0 -89
  195. data/lib/web/session.rb~ +0 -75
  196. data/lib/web/tagparser.rb~ +0 -96
  197. data/lib/web/template.rb~ +0 -613
  198. data/lib/web/testing.rb~ +0 -546
  199. data/lib/web/unit/response.rb~ +0 -461
  200. data/lib/web/unit/ui/cui/testrunner.rb~ +0 -50
  201. data/lib/web/upload.rb~ +0 -262
  202. data/lib/web/wiki.rb~ +0 -517
  203. data/lib/web/wiki/linker.rb~ +0 -72
  204. data/lib/web/wiki/mime.rb~ +0 -68
  205. data/lib/web/wiki/page.rb~ +0 -192
  206. data/lib/web/wiki/resources/#edit.html# +0 -65
  207. data/lib/web/wiki/resources/admin.html~ +0 -13
  208. data/lib/web/wiki/resources/default-content_editor.html~ +0 -1
  209. data/lib/web/wiki/resources/edit.html~ +0 -2
  210. data/lib/web/wiki/resources/home.html~ +0 -10
  211. data/lib/web/wiki/resources/htmlarea/ChangeLog +0 -1185
  212. data/lib/web/wiki/resources/htmlarea/dialog.js +0 -72
  213. data/lib/web/wiki/resources/htmlarea/examples/2-areas.cgi +0 -16
  214. data/lib/web/wiki/resources/htmlarea/examples/2-areas.html +0 -158
  215. data/lib/web/wiki/resources/htmlarea/examples/context-menu.html +0 -95
  216. data/lib/web/wiki/resources/htmlarea/examples/core.html +0 -184
  217. data/lib/web/wiki/resources/htmlarea/examples/css.html +0 -88
  218. data/lib/web/wiki/resources/htmlarea/examples/custom.css +0 -29
  219. data/lib/web/wiki/resources/htmlarea/examples/full-page.html +0 -75
  220. data/lib/web/wiki/resources/htmlarea/examples/fully-loaded.html +0 -248
  221. data/lib/web/wiki/resources/htmlarea/examples/index.html +0 -40
  222. data/lib/web/wiki/resources/htmlarea/examples/spell-checker.html +0 -132
  223. data/lib/web/wiki/resources/htmlarea/examples/table-operations.html +0 -116
  224. data/lib/web/wiki/resources/htmlarea/examples/test.cgi +0 -21
  225. data/lib/web/wiki/resources/htmlarea/htmlarea.css +0 -180
  226. data/lib/web/wiki/resources/htmlarea/htmlarea.js +0 -2175
  227. data/lib/web/wiki/resources/htmlarea/images/ed_about.gif +0 -0
  228. data/lib/web/wiki/resources/htmlarea/images/ed_align_center.gif +0 -0
  229. data/lib/web/wiki/resources/htmlarea/images/ed_align_justify.gif +0 -0
  230. data/lib/web/wiki/resources/htmlarea/images/ed_align_left.gif +0 -0
  231. data/lib/web/wiki/resources/htmlarea/images/ed_align_right.gif +0 -0
  232. data/lib/web/wiki/resources/htmlarea/images/ed_blank.gif +0 -0
  233. data/lib/web/wiki/resources/htmlarea/images/ed_charmap.gif +0 -0
  234. data/lib/web/wiki/resources/htmlarea/images/ed_color_bg.gif +0 -0
  235. data/lib/web/wiki/resources/htmlarea/images/ed_color_fg.gif +0 -0
  236. data/lib/web/wiki/resources/htmlarea/images/ed_copy.gif +0 -0
  237. data/lib/web/wiki/resources/htmlarea/images/ed_custom.gif +0 -0
  238. data/lib/web/wiki/resources/htmlarea/images/ed_cut.gif +0 -0
  239. data/lib/web/wiki/resources/htmlarea/images/ed_delete.gif +0 -0
  240. data/lib/web/wiki/resources/htmlarea/images/ed_format_bold.gif +0 -0
  241. data/lib/web/wiki/resources/htmlarea/images/ed_format_italic.gif +0 -0
  242. data/lib/web/wiki/resources/htmlarea/images/ed_format_strike.gif +0 -0
  243. data/lib/web/wiki/resources/htmlarea/images/ed_format_sub.gif +0 -0
  244. data/lib/web/wiki/resources/htmlarea/images/ed_format_sup.gif +0 -0
  245. data/lib/web/wiki/resources/htmlarea/images/ed_format_underline.gif +0 -0
  246. data/lib/web/wiki/resources/htmlarea/images/ed_help.gif +0 -0
  247. data/lib/web/wiki/resources/htmlarea/images/ed_hr.gif +0 -0
  248. data/lib/web/wiki/resources/htmlarea/images/ed_html.gif +0 -0
  249. data/lib/web/wiki/resources/htmlarea/images/ed_image.gif +0 -0
  250. data/lib/web/wiki/resources/htmlarea/images/ed_indent_less.gif +0 -0
  251. data/lib/web/wiki/resources/htmlarea/images/ed_indent_more.gif +0 -0
  252. data/lib/web/wiki/resources/htmlarea/images/ed_left_to_right.gif +0 -0
  253. data/lib/web/wiki/resources/htmlarea/images/ed_link.gif +0 -0
  254. data/lib/web/wiki/resources/htmlarea/images/ed_list_bullet.gif +0 -0
  255. data/lib/web/wiki/resources/htmlarea/images/ed_list_num.gif +0 -0
  256. data/lib/web/wiki/resources/htmlarea/images/ed_paste.gif +0 -0
  257. data/lib/web/wiki/resources/htmlarea/images/ed_redo.gif +0 -0
  258. data/lib/web/wiki/resources/htmlarea/images/ed_right_to_left.gif +0 -0
  259. data/lib/web/wiki/resources/htmlarea/images/ed_save.gif +0 -0
  260. data/lib/web/wiki/resources/htmlarea/images/ed_show_border.gif +0 -0
  261. data/lib/web/wiki/resources/htmlarea/images/ed_splitcel.gif +0 -0
  262. data/lib/web/wiki/resources/htmlarea/images/ed_undo.gif +0 -0
  263. data/lib/web/wiki/resources/htmlarea/images/fullscreen_maximize.gif +0 -0
  264. data/lib/web/wiki/resources/htmlarea/images/fullscreen_minimize.gif +0 -0
  265. data/lib/web/wiki/resources/htmlarea/images/insert_table.gif +0 -0
  266. data/lib/web/wiki/resources/htmlarea/index.html +0 -199
  267. data/lib/web/wiki/resources/htmlarea/lang/b5.js +0 -36
  268. data/lib/web/wiki/resources/htmlarea/lang/cz.js +0 -63
  269. data/lib/web/wiki/resources/htmlarea/lang/da.js +0 -38
  270. data/lib/web/wiki/resources/htmlarea/lang/de.js +0 -54
  271. data/lib/web/wiki/resources/htmlarea/lang/ee.js +0 -63
  272. data/lib/web/wiki/resources/htmlarea/lang/el.js +0 -75
  273. data/lib/web/wiki/resources/htmlarea/lang/en.js +0 -88
  274. data/lib/web/wiki/resources/htmlarea/lang/es.js +0 -51
  275. data/lib/web/wiki/resources/htmlarea/lang/fi.js +0 -46
  276. data/lib/web/wiki/resources/htmlarea/lang/fr.js +0 -61
  277. data/lib/web/wiki/resources/htmlarea/lang/gb.js +0 -36
  278. data/lib/web/wiki/resources/htmlarea/lang/he.js +0 -63
  279. data/lib/web/wiki/resources/htmlarea/lang/hu.js +0 -63
  280. data/lib/web/wiki/resources/htmlarea/lang/it.js +0 -54
  281. data/lib/web/wiki/resources/htmlarea/lang/ja-euc.js +0 -37
  282. data/lib/web/wiki/resources/htmlarea/lang/ja-jis.js +0 -37
  283. data/lib/web/wiki/resources/htmlarea/lang/ja-sjis.js +0 -37
  284. data/lib/web/wiki/resources/htmlarea/lang/ja-utf8.js +0 -37
  285. data/lib/web/wiki/resources/htmlarea/lang/lt.js +0 -55
  286. data/lib/web/wiki/resources/htmlarea/lang/lv.js +0 -55
  287. data/lib/web/wiki/resources/htmlarea/lang/nb.js +0 -36
  288. data/lib/web/wiki/resources/htmlarea/lang/nl.js +0 -90
  289. data/lib/web/wiki/resources/htmlarea/lang/no.js +0 -79
  290. data/lib/web/wiki/resources/htmlarea/lang/pl.js +0 -36
  291. data/lib/web/wiki/resources/htmlarea/lang/pt_br.js +0 -37
  292. data/lib/web/wiki/resources/htmlarea/lang/ro.js +0 -80
  293. data/lib/web/wiki/resources/htmlarea/lang/ru.js +0 -63
  294. data/lib/web/wiki/resources/htmlarea/lang/se.js +0 -38
  295. data/lib/web/wiki/resources/htmlarea/lang/si.js +0 -63
  296. data/lib/web/wiki/resources/htmlarea/lang/vn.js +0 -51
  297. data/lib/web/wiki/resources/htmlarea/license.txt +0 -30
  298. data/lib/web/wiki/resources/htmlarea/plugins/CSS/css.js +0 -116
  299. data/lib/web/wiki/resources/htmlarea/plugins/CSS/lang/en.js +0 -2
  300. data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/context-menu.js +0 -416
  301. data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/de.js +0 -59
  302. data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/el.js +0 -57
  303. data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/en.js +0 -66
  304. data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/nl.js +0 -66
  305. data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/menu.css +0 -64
  306. data/lib/web/wiki/resources/htmlarea/plugins/FullPage/full-page.js +0 -143
  307. data/lib/web/wiki/resources/htmlarea/plugins/FullPage/img/docprop.gif +0 -0
  308. data/lib/web/wiki/resources/htmlarea/plugins/FullPage/lang/en.js +0 -25
  309. data/lib/web/wiki/resources/htmlarea/plugins/FullPage/lang/ro.js +0 -25
  310. data/lib/web/wiki/resources/htmlarea/plugins/FullPage/popups/docprop.html +0 -131
  311. data/lib/web/wiki/resources/htmlarea/plugins/FullPage/test.html +0 -89
  312. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/img/spell-check.gif +0 -0
  313. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/cz.js +0 -37
  314. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/da.js +0 -37
  315. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/de.js +0 -28
  316. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/en.js +0 -38
  317. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/hu.js +0 -37
  318. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/it.js +0 -28
  319. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/ro.js +0 -37
  320. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/readme-tech.html +0 -114
  321. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-logic.cgi +0 -210
  322. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-style.css +0 -10
  323. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-ui.html +0 -122
  324. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-ui.js +0 -397
  325. data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-checker.js +0 -79
  326. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-delete.gif +0 -0
  327. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-insert-after.gif +0 -0
  328. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-insert-before.gif +0 -0
  329. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-merge.gif +0 -0
  330. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-prop.gif +0 -0
  331. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-split.gif +0 -0
  332. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-delete.gif +0 -0
  333. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-insert-after.gif +0 -0
  334. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-insert-before.gif +0 -0
  335. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-split.gif +0 -0
  336. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-delete.gif +0 -0
  337. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-insert-above.gif +0 -0
  338. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-insert-under.gif +0 -0
  339. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-prop.gif +0 -0
  340. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-split.gif +0 -0
  341. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/table-prop.gif +0 -0
  342. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/cz.js +0 -90
  343. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/da.js +0 -90
  344. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/de.js +0 -81
  345. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/el.js +0 -81
  346. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/en.js +0 -90
  347. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/fi.js +0 -66
  348. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/hu.js +0 -63
  349. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/it.js +0 -81
  350. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/nl.js +0 -90
  351. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/no.js +0 -91
  352. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/ro.js +0 -90
  353. data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/table-operations.js +0 -1160
  354. data/lib/web/wiki/resources/htmlarea/popupdiv.js +0 -369
  355. data/lib/web/wiki/resources/htmlarea/popups/about.html +0 -378
  356. data/lib/web/wiki/resources/htmlarea/popups/blank.html +0 -2
  357. data/lib/web/wiki/resources/htmlarea/popups/custom2.html +0 -35
  358. data/lib/web/wiki/resources/htmlarea/popups/editor_help.html +0 -16
  359. data/lib/web/wiki/resources/htmlarea/popups/fullscreen.html +0 -133
  360. data/lib/web/wiki/resources/htmlarea/popups/insert_image.html +0 -191
  361. data/lib/web/wiki/resources/htmlarea/popups/insert_table.html +0 -174
  362. data/lib/web/wiki/resources/htmlarea/popups/link.html +0 -142
  363. data/lib/web/wiki/resources/htmlarea/popups/old-fullscreen.html +0 -131
  364. data/lib/web/wiki/resources/htmlarea/popups/old_insert_image.html +0 -206
  365. data/lib/web/wiki/resources/htmlarea/popups/popup.js +0 -109
  366. data/lib/web/wiki/resources/htmlarea/popups/select_color.html +0 -347
  367. data/lib/web/wiki/resources/htmlarea/popupwin.js +0 -139
  368. data/lib/web/wiki/resources/htmlarea/reference.html +0 -523
  369. data/lib/web/wiki/resources/htmlarea/release-notes.html +0 -165
  370. data/lib/web/wiki/resources/illustration.html~ +0 -1
  371. data/lib/web/wiki/resources/index.html~ +0 -4
  372. data/lib/web/wiki/resources/more_news.html~ +0 -5
  373. data/lib/web/wiki/resources/more_news_rss_0.91.html +0 -23
  374. data/lib/web/wiki/resources/page_history.html~ +0 -19
  375. data/lib/web/wiki/resources/template.html~ +0 -13
  376. data/narf.gemspec~ +0 -40
  377. data/sapi/apache_cgi/INSTALL.txt~ +0 -9
  378. data/sapi/apache_cgi/README~ +0 -0
  379. data/sapi/fastcgi/INSTALL.txt~ +0 -17
  380. data/sapi/mod_ruby/INSTALL.txt~ +0 -5
  381. data/sapi/webrick/INSTALL.txt~ +0 -21
  382. data/sapi/webrick/run_webrick.rb~ +0 -16
  383. data/scripts/makedist.rb~ +0 -49
  384. data/test/mod_ruby_stub.rb~ +0 -38
  385. data/test/test.action.rb~ +0 -142
  386. data/test/test.assertinclude.rb~ +0 -109
  387. data/test/test.narf.cgi.rb~ +0 -105
  388. data/test/test.request.rb~ +0 -328
  389. data/test/test.response.rb~ +0 -556
  390. data/test/test.template.rb~ +0 -832
  391. data/test/test.web.test.rb~ +0 -461
  392. data/test/webunit/test_cookie.rb~ +0 -128
  393. data/test/webunit/test_form.rb~ +0 -43
  394. data/test/webunit/test_multipart.rb~ +0 -53
  395. data/test/webunit/test_params.rb~ +0 -211
  396. data/test/webunit/test_response.rb~ +0 -145
  397. data/test/webunit/test_site/assert.html~ +0 -1
  398. data/test/webunit/test_site/auth/index.html~ +0 -1
  399. data/test/webunit/test_site/badtags.html~ +0 -1
  400. data/test/webunit/test_site/cookie.cgi~ +0 -35
  401. data/test/webunit/test_site/document.xml~ +0 -1
  402. data/test/webunit/test_site/form.html~ +0 -1
  403. data/test/webunit/test_site/frame-0.html~ +0 -1
  404. data/test/webunit/test_site/frame-1.html~ +0 -1
  405. data/test/webunit/test_site/frame.html~ +0 -1
  406. data/test/webunit/test_site/image.html~ +0 -1
  407. data/test/webunit/test_site/include.cgi~ +0 -10
  408. data/test/webunit/test_site/jscript-0.html~ +0 -1
  409. data/test/webunit/test_site/jscript-1.html~ +0 -1
  410. data/test/webunit/test_site/jscript.html~ +0 -1
  411. data/test/webunit/test_site/link.html~ +0 -1
  412. data/test/webunit/test_site/multipart.cgi~ +0 -25
  413. data/test/webunit/test_site/multipart.html~ +0 -1
  414. data/test/webunit/test_site/params.html~ +0 -1
  415. data/test/webunit/test_site/redirect.cgi~ +0 -14
  416. data/test/webunit/test_site/response.html~ +0 -1
  417. data/test/webunit/test_site/simple.cgi~ +0 -17
  418. data/test/webunit/test_site/stock.cgi~ +0 -34
  419. data/test/webunit/test_site/table.html~ +0 -1
  420. data/test/webunit/test_site/test.cgi~ +0 -25
  421. data/test/wiki/test.history.rb~ +0 -254
  422. data/test/wiki/test.illustration_page.rb~ +0 -287
  423. data/test/wiki/test.tarpit.rb~ +0 -40
  424. data/test/wiki/test.wiki.rb~ +0 -295
@@ -1,110 +0,0 @@
1
- class Array # :nodoc:
2
- def has_key?(index)
3
- index >= 0 && index < length
4
- end
5
-
6
- def __index(key)
7
- self[key]
8
- end
9
-
10
- def compare_includes? haystack, prefix=[]
11
- message = ""
12
- each_with_index{ |v, k|
13
- fullname = prefix.clone
14
- if fullname.length > 0
15
- fullname[fullname.length-1] = "#{fullname.last}[#{k}]"
16
- else
17
- fullname[0] = "<Array>[#{k}]"
18
- end
19
- fullname_str = fullname.join(".")
20
- message += do_thing(haystack, k, v, fullname, fullname_str)
21
- }
22
- message
23
- end
24
- end
25
-
26
-
27
- class Object # :nodoc:
28
- def has_key? key
29
- respond_to? key.intern
30
- end
31
-
32
- def __index(key)
33
- send key.intern
34
- end
35
-
36
- def do_thing haystack, k, v, fullname, fullname_str
37
- message = ""
38
- # get key
39
- if !haystack.has_key?(k)
40
- if v
41
- message += "Missing from actual: #{fullname_str} => #{v.inspect}\n"
42
- end
43
- else
44
- # inspect key
45
- # if we are looking for a collection
46
- if v.kind_of?(Hash) || v.kind_of?(Array)
47
- # and the haystack has a collection
48
- if !(haystack.__index(k).kind_of?(String) || haystack.__index(k).kind_of?(TrueClass) || haystack.__index(k).kind_of?(FalseClass) || haystack.__index(k).kind_of?(Fixnum) || haystack.__index(k).kind_of?(Bignum))
49
- # recurse if both are collections
50
- message += v.compare_includes?(haystack.__index(k),fullname)
51
-
52
- # otherwise, complain that we aren't the same
53
- else
54
- message += "Difference: required <#{fullname_str} => #{v.inspect}> was <#{fullname_str} => #{haystack.__index(k).inspect}>\n"
55
- end
56
-
57
- # if we aren't looking for a collection, see if we aren't the same
58
- else
59
- haystack_value = haystack.__index(k)
60
- if (haystack_value.kind_of? Array and
61
- haystack_value.length == 1)
62
- haystack_value = haystack_value.first
63
- end
64
- if (haystack_value != v)
65
- message += "Difference: required <#{fullname_str} => #{v.inspect}> was <#{fullname_str} => #{haystack_value.inspect}>\n"
66
- end
67
- end
68
- end
69
- message
70
- end
71
- end
72
- �Á�
73
- class Hash # :nodoc:
74
- def __index(key)
75
- self[key]
76
- end
77
-
78
- def compare_includes? haystack, prefix=[]
79
- message = ""
80
- # check that haystack is the same type?
81
-
82
- # iterate over your self (particular to self)
83
- self.each do |k,v|
84
-
85
- # make a sensible name for each element of the needle (particular to self)
86
- fullname = prefix.clone.push k
87
- fullname_str = fullname.join(".")
88
-
89
- message += do_thing(haystack, k, v, fullname, fullname_str)
90
- end
91
-
92
- message
93
- end
94
- end
95
-
96
- module Test # :nodoc: all
97
- module Unit
98
- module Assertions
99
- def assert_includes needle, haystack, message=""
100
- _wrap_assertion {
101
- message = needle.compare_includes?( haystack )
102
- unless( message == "")
103
- flunk(message.chomp)
104
- end
105
- }
106
- end
107
- end
108
- end
109
- end
110
-
@@ -1,110 +0,0 @@
1
- class Array # :nodoc:
2
- def has_key?(index)
3
- index >= 0 && index < length
4
- end
5
-
6
- def __index(key)
7
- self[key]
8
- end
9
-
10
- def compare_includes? haystack, prefix=[]
11
- message = ""
12
- each_with_index{ |v, k|
13
- fullname = prefix.clone
14
- if fullname.length > 0
15
- fullname[fullname.length-1] = "#{fullname.last}[#{k}]"
16
- else
17
- fullname[0] = "<Array>[#{k}]"
18
- end
19
- fullname_str = fullname.join(".")
20
- message += do_thing(haystack, k, v, fullname, fullname_str)
21
- }
22
- message
23
- end
24
- end
25
-
26
-
27
- class Object # :nodoc:
28
- def has_key? key
29
- respond_to? key.intern
30
- end
31
-
32
- def __index(key)
33
- send key.intern
34
- end
35
-
36
- def do_thing haystack, k, v, fullname, fullname_str
37
- message = ""
38
- # get key
39
- if !haystack.has_key?(k)
40
- if v
41
- message += "Missing from actual: #{fullname_str} => #{v.inspect}\n"
42
- end
43
- else
44
- # inspect key
45
- # if we are looking for a collection
46
- if v.kind_of?(Hash) || v.kind_of?(Array)
47
- # and the haystack has a collection
48
- if !(haystack.__index(k).kind_of?(String) || haystack.__index(k).kind_of?(TrueClass) || haystack.__index(k).kind_of?(FalseClass) || haystack.__index(k).kind_of?(Fixnum) || haystack.__index(k).kind_of?(Bignum))
49
- # recurse if both are collections
50
- message += v.compare_includes?(haystack.__index(k),fullname)
51
-
52
- # otherwise, complain that we aren't the same
53
- else
54
- message += "Difference: required <#{fullname_str} => #{v.inspect}> was <#{fullname_str} => #{haystack.__index(k).inspect}>\n"
55
- end
56
-
57
- # if we aren't looking for a collection, see if we aren't the same
58
- else
59
- haystack_value = haystack.__index(k)
60
- if (haystack_value.kind_of? Array and
61
- haystack_value.length == 1)
62
- haystack_value = haystack_value.first
63
- end
64
- if (haystack_value != v)
65
- message += "Difference: required <#{fullname_str} => #{v.inspect}> was <#{fullname_str} => #{haystack_value.inspect}>\n"
66
- end
67
- end
68
- end
69
- message
70
- end
71
- end
72
-
73
- class Hash # :nodoc:
74
- def __index(key)
75
- self[key]
76
- end
77
-
78
- def compare_includes? haystack, prefix=[]
79
- message = ""
80
- # check that haystack is the same type?
81
-
82
- # iterate over your self (particular to self)
83
- self.each do |k,v|
84
-
85
- # make a sensible name for each element of the needle (particular to self)
86
- fullname = prefix.clone.push k
87
- fullname_str = fullname.join(".")
88
-
89
- message += do_thing(haystack, k, v, fullname, fullname_str)
90
- end
91
-
92
- message
93
- end
94
- end
95
-
96
- module Test # :nodoc: all
97
- module Unit
98
- module Assertions
99
- def assert_includes needle, haystack, message=""
100
- _wrap_assertion {
101
- message = needle.compare_includes?( haystack )
102
- unless( message == "")
103
- flunk(message)
104
- end
105
- }
106
- end
107
- end
108
- end
109
- end
110
-
data/lib/web/cgi.rb~ DELETED
@@ -1,640 +0,0 @@
1
- module Web
2
- # == Purpose
3
- #
4
- # Web::CGI is the core of Narf. You will find documentation for many
5
- # useful methods here. I recommend calling these methods through the
6
- # Web module, which will manage the current CGI object and delegate
7
- # to it.
8
- #
9
- class CGI
10
-
11
- @@__web__cgi = nil
12
-
13
- # set the singleton cgi object for Web
14
- def CGI.set_cgi cgi
15
- @@__web__cgi = cgi
16
- end
17
-
18
- # get the singleton cgi object for Web
19
- def CGI.get_cgi( options={} )
20
- unless @@__web__cgi
21
- @@__web__cgi = Web::CGI.new(options)
22
-
23
- at_exit {
24
- @@__web__cgi.close if @@__web__cgi
25
- }
26
- end
27
-
28
- @@__web__cgi
29
-
30
- end
31
-
32
- def CGI.process( options={} ) #:nodoc:
33
- cgi = Web::CGI.get_cgi( options )
34
- yield cgi
35
- cgi.close
36
- cgi
37
- end
38
-
39
- include Test::Unit::Assertions
40
-
41
- attr_reader :session, :options
42
-
43
- def document_root
44
- @cgd.env['document_root']
45
- end
46
-
47
- def script_name
48
- @cgd.env['script_name']
49
- end
50
-
51
- def path_info
52
- @cgd.env['path_info']
53
- end
54
-
55
- def cgd
56
- @cgd
57
- end
58
-
59
- @@cgi_instances = {}
60
- def CGI::create(options={})
61
-
62
- options[:out] ||= $stdout
63
- @@cgi_instances[ options[:out].id ] ||= CGI.new(options)
64
- end
65
-
66
- # Construct cgi with the given options. Defaults are in parenthesis.
67
- # These options are alpha and due for change as narf supports
68
- # different backends.
69
- #
70
- # [:session] set the session to the given hash (Web::Session).
71
- # [:cgd] pass in a CGD driver
72
- # [:env] pass in the ENV variables
73
- # [:in] set the input stream to the given IO ($stdin).
74
- # [:out] set the output stream to the given IO ($stdout).
75
- # [:unbuffered] flag whether output should(n't) be buffered. (false)
76
- # [:path_info] path_info is the part of the query that is after the script,
77
- # i.e. the Narf.html in /wiki.rb/Narf.html (Request.path_info)
78
- # [:document_root] Document root of website. (Request.document_root)
79
- # [:script_name] Script name, ie /wiki.rb in /wiki.rb/Narf.html (Request.script_name)
80
- def initialize(options={})
81
- @options = options
82
- @cgd = options[:cgd] || CGD.create( options )
83
-
84
- ENV_KEYS.each { |symbol|
85
- env[symbol.to_s.downcase] = options[symbol] if options[symbol]
86
- }
87
-
88
- # set output buffer
89
- @content = StringIO.new
90
- if (unbuffered?)
91
- @output = @cgd.output
92
- else
93
- @output = StringIO.new
94
- end
95
-
96
- @session = if (options.has_key? :session)
97
- options[:session]
98
- else
99
- Session.new( self, options )
100
- end
101
- end
102
-
103
- def trace_output
104
- templater = Narflates.new(CGI.trace_output_template,{})
105
- templater.parse(self,{ "parameters" =>
106
- multiple_params.collect { |key,value| { "key" => key, "value" => value } },
107
- "cookies" =>
108
- cookies.collect { |key,value| { "key" => key, "value" => value } },
109
- "session" =>
110
- session.collect { |key,value| { "key" => key, "value" => value } } })
111
- flush
112
- end
113
-
114
-
115
- # returns params as a hash of arrays
116
- def multiple_params
117
- @cgd.multiple_params
118
- end
119
-
120
- # set multiple params, in case you want to change the state of your app
121
- # without a round trip to the client.
122
- def multiple_params= other
123
- @cgd.multiple_params = other
124
- end
125
-
126
- MULTIPLE_KEY = /\[\]\z/
127
-
128
- # access parameters. If the key is array-style,
129
- # aka param[], return the array. Otherwise,
130
- # return the joined string.
131
- def [] (key)
132
- if (MULTIPLE_KEY =~ key)
133
- multiple_params[key]
134
- else
135
- single_param(key)
136
- end
137
- end
138
-
139
- # set param at the given key. This is useful to change state
140
- # in your app without asking the browser to redirect
141
- def []= (key, value)
142
- unless value.kind_of? Array
143
- value = [value]
144
- end
145
- multiple_params[key] = value
146
- end
147
-
148
- # If params[key][0] is a Web::Upload, returns that value.
149
- # Otherwise it returns params[key].join( "," )
150
- def single_param(key)
151
- if (multiple_params[key].first.kind_of? Web::Upload)
152
- multiple_params[key].first
153
- else
154
- multiple_params[key].join( "," )
155
- end
156
- end
157
-
158
- def split_params #:nodoc:
159
- Web::Testing::MultiHashTree.new(multiple_params).fields
160
- end
161
-
162
- # list the submitted params
163
- def keys
164
- multiple_params.keys
165
- end
166
-
167
- # test whether a param was submitted
168
- def key? (key)
169
- multiple_params.has_key? key
170
- end
171
-
172
- # array of cookies sent by the client
173
- def cookies
174
- @cgd.cookies
175
- end
176
-
177
- #----------------------------------
178
- # Response methods
179
- #----------------------------------
180
-
181
- # these are documentation stubs for rdoc
182
-
183
- # Append output to client
184
- def << (*args) end
185
- # Append output to client with line endings
186
- def puts(*args) end
187
- # Append output to client
188
- def write(*args) end
189
- # Append output to client
190
- def print(*args) end
191
-
192
- # Append output to client
193
- [ :<<, :puts, :write, :print ].each{ |symbol|
194
- define_method(symbol) { |*args|
195
- send_header if (unbuffered?)
196
- @content.send( symbol, args )
197
- @output.send( symbol, args )
198
- }
199
- }
200
-
201
- # Reset output buffer. Fails if headers have been sent.
202
- def clear()
203
- if header_sent?
204
- raise( Exception.new( "Can't call Web::clear()" ) )
205
- else
206
- @output = StringIO.new
207
- end
208
- end
209
-
210
- def unbuffered?
211
- @options[:unbuffered]
212
- end
213
-
214
- # send header to the client, and flush any buffered output
215
- def flush
216
- unless unbuffered?
217
- send_header
218
- @cgd.output << @output.string
219
- @output = StringIO.new
220
- end
221
- end
222
-
223
- # returns the body content of the response
224
- # (sans headers).
225
- def get_content
226
- @content.string
227
- end
228
-
229
- # for testing: raises Test::Unit exception if content
230
- # is not set to the provided string.
231
- def assert_content expected, message=""
232
- assert_equal( expected, get_content, message );
233
- end
234
-
235
- def get_formreader #:nodoc:
236
- return @form_fields_cache ||= FormReader.new( get_content )
237
- end
238
-
239
- def get_form( name ) #:nodoc:
240
- get_formreader[name]
241
- end
242
-
243
- def get_form_fields(name) #:nodoc:
244
- get_formreader.get_fields(name)
245
- end
246
-
247
- def get_form_value formname, name #:nodoc:
248
- form = get_form_fields(formname)
249
- if form == nil
250
- raise Web::Error.new("Form '#{formname}' does not exist")
251
- end
252
-
253
- value = form[name]
254
- value
255
- end
256
-
257
- # assert output content contains a form
258
- # that includes the given hash of values. See Web::Testing
259
- def assert_form_includes formname, vars
260
- assert_includes vars, get_form_fields(formname)
261
- end
262
-
263
- # flushes the output and, if applicable, saves the session
264
- def close
265
- flush
266
- if $DISPLAY_TRACE
267
- trace_output
268
- end
269
- @session.save if (@session.respond_to? :save)
270
- @cgd.close
271
- end
272
-
273
- # There's a bit of special casing in here, for the follow reasons:
274
- # * some headers should only be sent once. If you add
275
- # Content-Encoding, Location, or Status, it will overwrite the old headers
276
- # instead of adding a second header
277
- # * content-type is a strange header. It is a combination of the content-type
278
- # and charset attributes. setting content-type will cause the content-type
279
- # attribute to be set; setting charset will cause the charset attribute to
280
- # be set.
281
- #
282
- # I don't know if this is the correct behavior. Should this method assume that
283
- # the content-type set here is the full content type, and try to split the
284
- # header into it's two parts?
285
- #
286
- # * If the headers have been sent, this will throw a Web::Error
287
- def add_header(name , value )
288
- unless header_sent?
289
- if (/content-encoding/i =~ name )
290
- header['Content-Encoding'] = [value]
291
- elsif( /location/i =~ name )
292
- header['Location'] = [value]
293
- elsif( /status/i =~ name )
294
- if /^\d*$/ =~ value.to_s
295
- self.status = value
296
- else
297
- header['Status'] = [value]
298
- end
299
- elsif(/content-type/i =~ name)
300
- header['Content-Type'] = [value]
301
- elsif(/charset/i =~ name)
302
- self.charset = value
303
- else
304
- header[name] ||= []
305
- header[name].push value
306
- end
307
- else
308
- raise Web::Error.new( "Can't add_header after header have been sent to client" )
309
- end
310
- end
311
-
312
- # returns an array of header values set with the given name.
313
- def get_header name
314
- header.keys.find_all { |key|
315
- key.downcase == name.downcase
316
- }.collect{ |key|
317
- header[key].dup
318
- }.flatten
319
- end
320
-
321
-
322
- # Send header to the client. No more header values can be sent after this method is called!
323
- def send_header
324
- unless header_sent?
325
- @cgd.send_header( self.header )
326
- @header_sent = true
327
- end
328
- end
329
-
330
- def header_sent?
331
- @header_sent
332
- end
333
-
334
- def header
335
- @header ||= {"Content-Type" => ["text/html"],
336
- "Status" => ["200 OK"] }
337
- @header
338
- end
339
-
340
- # Raises Test::Unit::AssertionFailedError if the header
341
- # has not been set to the provided value(s)
342
- def assert_header( name, values, message="" )
343
- assert_equal( [values].flatten, get_header(name), message )
344
- end
345
-
346
- # the default status is 200
347
- def status
348
- get_header( "Status" ).first =~ /^(\d+)( .*)?$/
349
- $1
350
- end
351
-
352
- def status= new_status
353
- add_header( "Status", "#{ new_status } #{ Web::HTTP_STATUS[new_status.to_s] }" )
354
- end
355
-
356
- def location
357
- get_header( "Location" ).first
358
- end
359
-
360
- # see set redirect
361
- def location= location
362
- add_header( "Location", location )
363
- end
364
-
365
- # Sets the status and the location appropriately.
366
- def set_redirect( new_location )
367
- self.status = "302"
368
- self.location = new_location
369
- end
370
-
371
- def encoding
372
- get_header( "Content-Encoding" ).first
373
- end
374
-
375
- def encoding=( new_encoding )
376
- add_header( "Content-Encoding", new_encoding )
377
- end
378
-
379
- def split_content_type( target = full_content_type )
380
- target.split( Regexp.new('; charset=') )
381
- end
382
-
383
- # The content type header is a combination of the content_type and the charset.
384
- # This method returns that combination.
385
- def full_content_type
386
- get_header( "Content-Type" ).first
387
- end
388
-
389
- def set_full_content_type( new_content, new_charset )
390
- add_header( "Content-type", [ new_content, new_charset ].compact.join('; charset=') )
391
- end
392
-
393
- # the default content-type is "text/html"
394
- def content_type
395
- split_content_type[0]
396
- end
397
-
398
- def content_type= new_content_type
399
- content1, charset1 = split_content_type
400
- content2, charset2 = split_content_type( new_content_type )
401
-
402
- set_full_content_type( content2 || content1,
403
- charset2 || charset1 )
404
- end
405
-
406
- def charset
407
- split_content_type[1]
408
- end
409
-
410
- def charset= new_charset
411
- set_full_content_type( content_type, new_charset )
412
- end
413
-
414
- # Cookies require a name and a value. You can also use these
415
- # optional keyword arguments:
416
- # <b>:path</b> => <i>string<i>:: path (need better description)
417
- # <b>:domain</b> => <i>string</i>:: domain (need better description)
418
- # <b>:expires</b> => <i>date</i>:: date this cookie should expire
419
- # <b>:secure</b> => <i>true || false </i>:: whether this cookie should be
420
- # tagged as secure.
421
- def set_cookie( name, value, options={} )
422
- value = Array(value).collect{ |field|
423
- Web::escape(field)
424
- }.join("&")
425
-
426
- cookie = "#{ name }=#{ value }"
427
-
428
-
429
- path = if (options[:path])
430
- options[:path]
431
- else
432
- %r|^(.*/)|.match(env["script_name"])
433
- ($1 or "")
434
- end
435
-
436
- cookie += "; path=#{ path }"
437
-
438
- if (options[:domain])
439
- cookie += "; domain=#{ options[:domain] }"
440
- end
441
-
442
- if (options[:expires])
443
- cookie += "; expires=#{ Web::rfc1123_date( options[:expires] ) }"
444
- end
445
-
446
- if (options[:secure])
447
- cookie += "; secure"
448
- end
449
-
450
- add_header( "Set-Cookie", cookie )
451
- end
452
-
453
- # returns an array of cookie values that have been set.
454
- # path / expires / etc. info is currently not returned, should
455
- # be added in?
456
- def get_cookie key
457
- get_header("Set-Cookie").collect{ |cookie|
458
- /\A(#{ key })=([^;]*)/ =~ cookie
459
- $2
460
- }.compact
461
- end
462
-
463
- # returns a hash of all the cookie n/v pairs that have
464
- # been set on the cgi
465
- def cookies_sent
466
- cookies = {}
467
- get_header("Set-Cookie").each do |cookie|
468
- /\A(.*?)=([^;]*)/ =~ cookie
469
- cookies[$1] = $2
470
- end
471
- cookies
472
- end
473
-
474
- # Throws Test::Unit::AssertionFailedException if
475
- # cookie values are not present.
476
- def assert_cookie( name, values, message="" )
477
- assert_equal( [values].flatten, get_cookie(name), message )
478
- end
479
-
480
- # Aside from when :nph is set in the options, scripts running in IIS always
481
- # use nph mode. This code will probably be affected as cgi is re-organized
482
- # to support multiple backends.
483
- def nph?
484
- @cgd.nph?
485
- end
486
-
487
- # ENV variables, scoped to the cgi (for in-process servers)
488
- def env
489
- @cgd.env
490
- end
491
-
492
- ENV_KEYS = [ :path_info, :document_root, :script_name ]
493
-
494
- ENV_KEYS.each{ |symbol|
495
- define_method( symbol ) {
496
- env[symbol.to_s]
497
- }
498
- }
499
-
500
- #------------------------------
501
- # implementation details, aka
502
- # refactoring targets below
503
- #------------------------------
504
-
505
- end
506
-
507
- # == Purpose
508
- # this is the implementation of the cgi interface.
509
- # As dbi to dbd, cgi to cgd
510
- class CGD
511
-
512
- attr_accessor :options, :env, :input, :output, :cookies, :multiple_params
513
-
514
- include Parser
515
-
516
- def CGD::create(options={})
517
- case CGI::server_sniff
518
- when :fcgi
519
- require 'web/sapi/fastcgi'
520
- Web::CGD::Fastcgi.new( options )
521
- when :mod_ruby
522
- require 'web/sapi/mod_ruby'
523
- Web::CGD::ModRuby.new( options )
524
- else
525
- CGD.new(options)
526
- end
527
- end
528
-
529
- def initialize(options={})
530
- @options = options
531
-
532
- @input = options[:in] || $stdin
533
- @output = options[:out] || $stdout
534
- @env = downcase_env( options[:env] || ENV )
535
-
536
- @env['document_root'] = options[:document_root] || Web.get_docroot || @env['document_root']
537
-
538
- parse_request
539
- end
540
-
541
- def close
542
-
543
- end
544
-
545
- # should this be server specific?
546
- def nph?
547
- @options[:nph] || /IIS/.match(env["server_software"])
548
- end
549
-
550
- def send_header( header )
551
- send_nph_header( header ) if (nph?)
552
-
553
- header.sort.each { |name, value|
554
- value.each { |v|
555
- output << "#{ name }: #{ v }\r\n"
556
- }
557
- }
558
-
559
- output << "\r\n"
560
- end
561
-
562
- def send_nph_header( header ) #:nodoc:
563
- output << "#{ env['server_protocol'] || 'HTTP/1.0' }: "
564
- output << "#{ header['Status'] }\r\n"
565
- output << "Date: #{ Web::rfc1123_date(Time.now) }\r\n"
566
-
567
- header.delete("Status")
568
-
569
- unless header.has_key? "Server"
570
- header["Server"] = [ env["server_software"] || "" ]
571
- end
572
- end
573
-
574
- end
575
-
576
- class CGI
577
- def report_error( err )
578
- self.puts "<h3>ruby error:</h3>"
579
- self.puts Dir.pwd
580
- self.puts err.to_s.gsub(/\n/,"<br><br>")
581
- self.puts "<blockquote>"
582
- self.puts( if (err.backtrace.size > 3)
583
- err.backtrace[0...-2]
584
- else
585
- err.backtrace
586
- end).collect{ |string| string + "<br>" }
587
- self.puts "</blockquote>"
588
- end
589
-
590
- # returns one of these values:
591
- # :cgi, :fastcgi, :mod_ruby, :webrick
592
- def CGI::server_sniff
593
- if( Object.const_defined?( "Apache" ) \
594
- && Apache.const_defined?( "Request" ) \
595
- && $stdin.kind_of?( Apache::Request ) )
596
- :mod_ruby
597
- elsif ( Object.const_defined?( "FCGI" ) \
598
- && ! FCGI.is_cgi? )
599
- :fcgi
600
- else
601
- :cgi
602
- end
603
- end
604
-
605
- @@in_process = false
606
- def CGI::basic_process( options={}) #:nodoc:
607
- unless @@in_process
608
- @@in_process = true
609
- Web.set_cgi( CGI.new( options ) )
610
- yield Web.get_cgi
611
- Web.get_cgi.close
612
- @@in_process = false
613
- Web.get_cgi
614
- else
615
- yield Web.get_cgi
616
- Web.get_cgi
617
- end
618
- end
619
-
620
-
621
- # try to include fastcgi
622
- begin
623
- require 'fcgi'
624
- rescue LoadError
625
-
626
- end
627
-
628
- def CGI::process( options={}, &block )
629
- if CGI::server_sniff == :fcgi
630
- FCGI::each_request{ |fcgi|
631
- options[:fcgi] = fcgi
632
- CGI::basic_process( options, &block )
633
- }
634
- else
635
- CGI::basic_process(options, &block )
636
- end
637
- end
638
-
639
- end
640
- end