narf 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +22 -0
- data/lib/web/htmltools/xmltree.rb +2 -2
- data/lib/web/htmltools/xpath.rb +1 -1
- data/narf.gemspec +1 -1
- metadata +2 -460
- data/InstalledFiles +0 -2227
- data/config.save +0 -12
- data/doc/apache_cgi.txt~ +0 -17
- data/doc/fastcgi.txt~ +0 -19
- data/doc/rdoc/classes/Web.html +0 -369
- data/doc/rdoc/classes/Web.src/M000002.html +0 -15
- data/doc/rdoc/classes/Web.src/M000003.html +0 -15
- data/doc/rdoc/classes/Web.src/M000004.html +0 -15
- data/doc/rdoc/classes/Web.src/M000005.html +0 -15
- data/doc/rdoc/classes/Web.src/M000006.html +0 -20
- data/doc/rdoc/classes/Web.src/M000007.html +0 -18
- data/doc/rdoc/classes/Web.src/M000008.html +0 -18
- data/doc/rdoc/classes/Web.src/M000009.html +0 -18
- data/doc/rdoc/classes/Web.src/M000010.html +0 -15
- data/doc/rdoc/classes/Web.src/M000011.html +0 -15
- data/doc/rdoc/classes/Web.src/M000012.html +0 -15
- data/doc/rdoc/classes/Web/CGD.html +0 -173
- data/doc/rdoc/classes/Web/CGD.src/M000037.html +0 -24
- data/doc/rdoc/classes/Web/CGD.src/M000038.html +0 -24
- data/doc/rdoc/classes/Web/CGD.src/M000039.html +0 -15
- data/doc/rdoc/classes/Web/CGD.src/M000040.html +0 -15
- data/doc/rdoc/classes/Web/CGD.src/M000041.html +0 -23
- data/doc/rdoc/classes/Web/CGI.html +0 -946
- data/doc/rdoc/classes/Web/CGI.src/M000051.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000052.html +0 -24
- data/doc/rdoc/classes/Web/CGI.src/M000053.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000054.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000055.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000056.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000057.html +0 -17
- data/doc/rdoc/classes/Web/CGI.src/M000058.html +0 -34
- data/doc/rdoc/classes/Web/CGI.src/M000059.html +0 -22
- data/doc/rdoc/classes/Web/CGI.src/M000060.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000061.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000062.html +0 -19
- data/doc/rdoc/classes/Web/CGI.src/M000063.html +0 -18
- data/doc/rdoc/classes/Web/CGI.src/M000064.html +0 -19
- data/doc/rdoc/classes/Web/CGI.src/M000065.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000066.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000067.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000068.html +0 -13
- data/doc/rdoc/classes/Web/CGI.src/M000069.html +0 -13
- data/doc/rdoc/classes/Web/CGI.src/M000070.html +0 -13
- data/doc/rdoc/classes/Web/CGI.src/M000071.html +0 -13
- data/doc/rdoc/classes/Web/CGI.src/M000072.html +0 -19
- data/doc/rdoc/classes/Web/CGI.src/M000073.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000074.html +0 -19
- data/doc/rdoc/classes/Web/CGI.src/M000075.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000076.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000077.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000078.html +0 -20
- data/doc/rdoc/classes/Web/CGI.src/M000079.html +0 -36
- data/doc/rdoc/classes/Web/CGI.src/M000080.html +0 -19
- data/doc/rdoc/classes/Web/CGI.src/M000081.html +0 -18
- data/doc/rdoc/classes/Web/CGI.src/M000082.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000083.html +0 -17
- data/doc/rdoc/classes/Web/CGI.src/M000084.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000085.html +0 -16
- data/doc/rdoc/classes/Web/CGI.src/M000086.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000087.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000088.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000089.html +0 -16
- data/doc/rdoc/classes/Web/CGI.src/M000090.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000091.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000092.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000093.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000094.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000095.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000096.html +0 -19
- data/doc/rdoc/classes/Web/CGI.src/M000097.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000098.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000099.html +0 -43
- data/doc/rdoc/classes/Web/CGI.src/M000100.html +0 -18
- data/doc/rdoc/classes/Web/CGI.src/M000101.html +0 -20
- data/doc/rdoc/classes/Web/CGI.src/M000102.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000103.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000104.html +0 -15
- data/doc/rdoc/classes/Web/CGI.src/M000105.html +0 -24
- data/doc/rdoc/classes/Web/CGI.src/M000106.html +0 -24
- data/doc/rdoc/classes/Web/CGI.src/M000107.html +0 -22
- data/doc/rdoc/classes/Web/CaseInsensitiveHash.html +0 -104
- data/doc/rdoc/classes/Web/CaseInsensitiveHash.src/M000118.html +0 -15
- data/doc/rdoc/classes/Web/CaseInsensitiveHash.src/M000119.html +0 -15
- data/doc/rdoc/classes/Web/CaseInsensitiveHash.src/M000120.html +0 -15
- data/doc/rdoc/classes/Web/Mime.html +0 -122
- data/doc/rdoc/classes/Web/Mime.src/M000118.html +0 -15
- data/doc/rdoc/classes/Web/Mime.src/M000119.html +0 -15
- data/doc/rdoc/classes/Web/Mime.src/M000120.html +0 -23
- data/doc/rdoc/classes/Web/Mime.src/M000121.html +0 -15
- data/doc/rdoc/classes/Web/Mime.src/M000122.html +0 -15
- data/doc/rdoc/classes/Web/Mime.src/M000123.html +0 -23
- data/doc/rdoc/classes/Web/Mime.src/M000124.html +0 -15
- data/doc/rdoc/classes/Web/Narflates.html +0 -134
- data/doc/rdoc/classes/Web/Parser.html +0 -219
- data/doc/rdoc/classes/Web/Parser.src/M000013.html +0 -21
- data/doc/rdoc/classes/Web/Parser.src/M000014.html +0 -19
- data/doc/rdoc/classes/Web/Parser.src/M000015.html +0 -21
- data/doc/rdoc/classes/Web/Parser.src/M000016.html +0 -15
- data/doc/rdoc/classes/Web/Parser.src/M000017.html +0 -30
- data/doc/rdoc/classes/Web/Parser.src/M000018.html +0 -15
- data/doc/rdoc/classes/Web/Parser.src/M000019.html +0 -19
- data/doc/rdoc/classes/Web/Parser.src/M000020.html +0 -27
- data/doc/rdoc/classes/Web/Parser.src/M000021.html +0 -15
- data/doc/rdoc/classes/Web/Parser.src/M000022.html +0 -16
- data/doc/rdoc/classes/Web/Parser.src/M000023.html +0 -18
- data/doc/rdoc/classes/Web/Session.html +0 -178
- data/doc/rdoc/classes/Web/Session.src/M000042.html +0 -20
- data/doc/rdoc/classes/Web/Session.src/M000043.html +0 -19
- data/doc/rdoc/classes/Web/Session.src/M000044.html +0 -21
- data/doc/rdoc/classes/Web/Session.src/M000045.html +0 -21
- data/doc/rdoc/classes/Web/Session.src/M000046.html +0 -15
- data/doc/rdoc/classes/Web/Session.src/M000047.html +0 -17
- data/doc/rdoc/classes/Web/Session.src/M000048.html +0 -15
- data/doc/rdoc/classes/Web/Session.src/M000049.html +0 -15
- data/doc/rdoc/classes/Web/Session.src/M000050.html +0 -16
- data/doc/rdoc/classes/Web/Testing.html +0 -474
- data/doc/rdoc/classes/Web/Testing.src/M000024.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000025.html +0 -25
- data/doc/rdoc/classes/Web/Testing.src/M000026.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000027.html +0 -25
- data/doc/rdoc/classes/Web/Testing.src/M000028.html +0 -57
- data/doc/rdoc/classes/Web/Testing.src/M000029.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000030.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000031.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000032.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000033.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000034.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000035.html +0 -15
- data/doc/rdoc/classes/Web/Testing.src/M000036.html +0 -18
- data/doc/rdoc/classes/Web/Upload.html +0 -160
- data/doc/rdoc/classes/Web/Upload.src/M000108.html +0 -25
- data/doc/rdoc/classes/Web/Upload.src/M000109.html +0 -18
- data/doc/rdoc/classes/Web/Upload.src/M000110.html +0 -16
- data/doc/rdoc/classes/Web/Upload.src/M000111.html +0 -16
- data/doc/rdoc/classes/Web/Wiki.html +0 -249
- data/doc/rdoc/classes/Web/Wiki.src/M000112.html +0 -25
- data/doc/rdoc/classes/Web/Wiki.src/M000113.html +0 -15
- data/doc/rdoc/classes/Web/Wiki.src/M000114.html +0 -26
- data/doc/rdoc/classes/Web/Wiki.src/M000115.html +0 -21
- data/doc/rdoc/classes/Web/Wiki.src/M000116.html +0 -18
- data/doc/rdoc/classes/Web/Wiki.src/M000117.html +0 -19
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/README.html +0 -230
- data/doc/rdoc/files/doc/apache_cgi_txt.html +0 -76
- data/doc/rdoc/files/doc/fastcgi_txt.html +0 -82
- data/doc/rdoc/files/doc/mod_ruby_txt.html +0 -62
- data/doc/rdoc/files/doc/webrick_txt.html +0 -79
- data/doc/rdoc/files/examples/examples_rdoc.html +0 -73
- data/doc/rdoc/files/lib/web/cgi_rb.html +0 -75
- data/doc/rdoc/files/lib/web/mime_rb.html +0 -67
- data/doc/rdoc/files/lib/web/parser_rb.html +0 -73
- data/doc/rdoc/files/lib/web/session_rb.html +0 -73
- data/doc/rdoc/files/lib/web/template_rb.html +0 -73
- data/doc/rdoc/files/lib/web/testing_rb.html +0 -67
- data/doc/rdoc/files/lib/web/upload_rb.html +0 -73
- data/doc/rdoc/files/lib/web/wiki_rb.html +0 -79
- data/doc/rdoc/files/lib/web_rb.html +0 -116
- data/doc/rdoc/files/lib/web_rb.src/M000001.html +0 -15
- data/doc/rdoc/fr_class_index.html +0 -47
- data/doc/rdoc/fr_file_index.html +0 -52
- data/doc/rdoc/fr_method_index.html +0 -158
- data/doc/rdoc/index.html +0 -22
- data/doc/rdoc/rdoc-style.css +0 -99
- data/examples/admin.rb~ +0 -5
- data/examples/cookbook.rdoc~ +0 -238
- data/examples/examples.rdoc~ +0 -17
- data/examples/hello.world.rb~ +0 -3
- data/examples/session.rb~ +0 -31
- data/examples/test/test.hello.world.rb~ +0 -9
- data/examples/test/test.session.rb~ +0 -37
- data/examples/wiki.rb~ +0 -5
- data/lib/web.rb~ +0 -290
- data/lib/web/#assertinclude.rb# +0 -110
- data/lib/web/assertinclude.rb~ +0 -110
- data/lib/web/cgi.rb~ +0 -640
- data/lib/web/htmlparser/html-parser.rb~ +0 -429
- data/lib/web/htmlparser/sgml-parser.rb~ +0 -332
- data/lib/web/htmltools/element.rb~ +0 -296
- data/lib/web/htmltools/stparser.rb~ +0 -276
- data/lib/web/htmltools/tags.rb~ +0 -286
- data/lib/web/htmltools/tree.rb~ +0 -139
- data/lib/web/htmltools/xmltree.rb~ +0 -160
- data/lib/web/htmltools/xpath.rb~ +0 -71
- data/lib/web/parser.rb~ +0 -288
- data/lib/web/request.rb~ +0 -238
- data/lib/web/runner.rb~ +0 -26
- data/lib/web/sapi/fastcgi.rb~ +0 -25
- data/lib/web/sapi/mod_ruby.rb~ +0 -46
- data/lib/web/sapi/webrick.rb~ +0 -89
- data/lib/web/session.rb~ +0 -75
- data/lib/web/tagparser.rb~ +0 -96
- data/lib/web/template.rb~ +0 -613
- data/lib/web/testing.rb~ +0 -546
- data/lib/web/unit/response.rb~ +0 -461
- data/lib/web/unit/ui/cui/testrunner.rb~ +0 -50
- data/lib/web/upload.rb~ +0 -262
- data/lib/web/wiki.rb~ +0 -517
- data/lib/web/wiki/linker.rb~ +0 -72
- data/lib/web/wiki/mime.rb~ +0 -68
- data/lib/web/wiki/page.rb~ +0 -192
- data/lib/web/wiki/resources/#edit.html# +0 -65
- data/lib/web/wiki/resources/admin.html~ +0 -13
- data/lib/web/wiki/resources/default-content_editor.html~ +0 -1
- data/lib/web/wiki/resources/edit.html~ +0 -2
- data/lib/web/wiki/resources/home.html~ +0 -10
- data/lib/web/wiki/resources/htmlarea/ChangeLog +0 -1185
- data/lib/web/wiki/resources/htmlarea/dialog.js +0 -72
- data/lib/web/wiki/resources/htmlarea/examples/2-areas.cgi +0 -16
- data/lib/web/wiki/resources/htmlarea/examples/2-areas.html +0 -158
- data/lib/web/wiki/resources/htmlarea/examples/context-menu.html +0 -95
- data/lib/web/wiki/resources/htmlarea/examples/core.html +0 -184
- data/lib/web/wiki/resources/htmlarea/examples/css.html +0 -88
- data/lib/web/wiki/resources/htmlarea/examples/custom.css +0 -29
- data/lib/web/wiki/resources/htmlarea/examples/full-page.html +0 -75
- data/lib/web/wiki/resources/htmlarea/examples/fully-loaded.html +0 -248
- data/lib/web/wiki/resources/htmlarea/examples/index.html +0 -40
- data/lib/web/wiki/resources/htmlarea/examples/spell-checker.html +0 -132
- data/lib/web/wiki/resources/htmlarea/examples/table-operations.html +0 -116
- data/lib/web/wiki/resources/htmlarea/examples/test.cgi +0 -21
- data/lib/web/wiki/resources/htmlarea/htmlarea.css +0 -180
- data/lib/web/wiki/resources/htmlarea/htmlarea.js +0 -2175
- data/lib/web/wiki/resources/htmlarea/images/ed_about.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_align_center.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_align_justify.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_align_left.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_align_right.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_blank.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_charmap.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_color_bg.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_color_fg.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_copy.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_custom.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_cut.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_delete.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_format_bold.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_format_italic.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_format_strike.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_format_sub.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_format_sup.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_format_underline.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_help.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_hr.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_html.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_image.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_indent_less.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_indent_more.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_left_to_right.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_link.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_list_bullet.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_list_num.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_paste.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_redo.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_right_to_left.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_save.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_show_border.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_splitcel.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/ed_undo.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/fullscreen_maximize.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/fullscreen_minimize.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/images/insert_table.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/index.html +0 -199
- data/lib/web/wiki/resources/htmlarea/lang/b5.js +0 -36
- data/lib/web/wiki/resources/htmlarea/lang/cz.js +0 -63
- data/lib/web/wiki/resources/htmlarea/lang/da.js +0 -38
- data/lib/web/wiki/resources/htmlarea/lang/de.js +0 -54
- data/lib/web/wiki/resources/htmlarea/lang/ee.js +0 -63
- data/lib/web/wiki/resources/htmlarea/lang/el.js +0 -75
- data/lib/web/wiki/resources/htmlarea/lang/en.js +0 -88
- data/lib/web/wiki/resources/htmlarea/lang/es.js +0 -51
- data/lib/web/wiki/resources/htmlarea/lang/fi.js +0 -46
- data/lib/web/wiki/resources/htmlarea/lang/fr.js +0 -61
- data/lib/web/wiki/resources/htmlarea/lang/gb.js +0 -36
- data/lib/web/wiki/resources/htmlarea/lang/he.js +0 -63
- data/lib/web/wiki/resources/htmlarea/lang/hu.js +0 -63
- data/lib/web/wiki/resources/htmlarea/lang/it.js +0 -54
- data/lib/web/wiki/resources/htmlarea/lang/ja-euc.js +0 -37
- data/lib/web/wiki/resources/htmlarea/lang/ja-jis.js +0 -37
- data/lib/web/wiki/resources/htmlarea/lang/ja-sjis.js +0 -37
- data/lib/web/wiki/resources/htmlarea/lang/ja-utf8.js +0 -37
- data/lib/web/wiki/resources/htmlarea/lang/lt.js +0 -55
- data/lib/web/wiki/resources/htmlarea/lang/lv.js +0 -55
- data/lib/web/wiki/resources/htmlarea/lang/nb.js +0 -36
- data/lib/web/wiki/resources/htmlarea/lang/nl.js +0 -90
- data/lib/web/wiki/resources/htmlarea/lang/no.js +0 -79
- data/lib/web/wiki/resources/htmlarea/lang/pl.js +0 -36
- data/lib/web/wiki/resources/htmlarea/lang/pt_br.js +0 -37
- data/lib/web/wiki/resources/htmlarea/lang/ro.js +0 -80
- data/lib/web/wiki/resources/htmlarea/lang/ru.js +0 -63
- data/lib/web/wiki/resources/htmlarea/lang/se.js +0 -38
- data/lib/web/wiki/resources/htmlarea/lang/si.js +0 -63
- data/lib/web/wiki/resources/htmlarea/lang/vn.js +0 -51
- data/lib/web/wiki/resources/htmlarea/license.txt +0 -30
- data/lib/web/wiki/resources/htmlarea/plugins/CSS/css.js +0 -116
- data/lib/web/wiki/resources/htmlarea/plugins/CSS/lang/en.js +0 -2
- data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/context-menu.js +0 -416
- data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/de.js +0 -59
- data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/el.js +0 -57
- data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/en.js +0 -66
- data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/lang/nl.js +0 -66
- data/lib/web/wiki/resources/htmlarea/plugins/ContextMenu/menu.css +0 -64
- data/lib/web/wiki/resources/htmlarea/plugins/FullPage/full-page.js +0 -143
- data/lib/web/wiki/resources/htmlarea/plugins/FullPage/img/docprop.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/FullPage/lang/en.js +0 -25
- data/lib/web/wiki/resources/htmlarea/plugins/FullPage/lang/ro.js +0 -25
- data/lib/web/wiki/resources/htmlarea/plugins/FullPage/popups/docprop.html +0 -131
- data/lib/web/wiki/resources/htmlarea/plugins/FullPage/test.html +0 -89
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/img/spell-check.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/cz.js +0 -37
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/da.js +0 -37
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/de.js +0 -28
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/en.js +0 -38
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/hu.js +0 -37
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/it.js +0 -28
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/lang/ro.js +0 -37
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/readme-tech.html +0 -114
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-logic.cgi +0 -210
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-style.css +0 -10
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-ui.html +0 -122
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-check-ui.js +0 -397
- data/lib/web/wiki/resources/htmlarea/plugins/SpellChecker/spell-checker.js +0 -79
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-delete.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-insert-after.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-insert-before.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-merge.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-prop.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/cell-split.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-delete.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-insert-after.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-insert-before.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/col-split.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-delete.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-insert-above.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-insert-under.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-prop.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/row-split.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/img/table-prop.gif +0 -0
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/cz.js +0 -90
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/da.js +0 -90
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/de.js +0 -81
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/el.js +0 -81
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/en.js +0 -90
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/fi.js +0 -66
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/hu.js +0 -63
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/it.js +0 -81
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/nl.js +0 -90
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/no.js +0 -91
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/lang/ro.js +0 -90
- data/lib/web/wiki/resources/htmlarea/plugins/TableOperations/table-operations.js +0 -1160
- data/lib/web/wiki/resources/htmlarea/popupdiv.js +0 -369
- data/lib/web/wiki/resources/htmlarea/popups/about.html +0 -378
- data/lib/web/wiki/resources/htmlarea/popups/blank.html +0 -2
- data/lib/web/wiki/resources/htmlarea/popups/custom2.html +0 -35
- data/lib/web/wiki/resources/htmlarea/popups/editor_help.html +0 -16
- data/lib/web/wiki/resources/htmlarea/popups/fullscreen.html +0 -133
- data/lib/web/wiki/resources/htmlarea/popups/insert_image.html +0 -191
- data/lib/web/wiki/resources/htmlarea/popups/insert_table.html +0 -174
- data/lib/web/wiki/resources/htmlarea/popups/link.html +0 -142
- data/lib/web/wiki/resources/htmlarea/popups/old-fullscreen.html +0 -131
- data/lib/web/wiki/resources/htmlarea/popups/old_insert_image.html +0 -206
- data/lib/web/wiki/resources/htmlarea/popups/popup.js +0 -109
- data/lib/web/wiki/resources/htmlarea/popups/select_color.html +0 -347
- data/lib/web/wiki/resources/htmlarea/popupwin.js +0 -139
- data/lib/web/wiki/resources/htmlarea/reference.html +0 -523
- data/lib/web/wiki/resources/htmlarea/release-notes.html +0 -165
- data/lib/web/wiki/resources/illustration.html~ +0 -1
- data/lib/web/wiki/resources/index.html~ +0 -4
- data/lib/web/wiki/resources/more_news.html~ +0 -5
- data/lib/web/wiki/resources/more_news_rss_0.91.html +0 -23
- data/lib/web/wiki/resources/page_history.html~ +0 -19
- data/lib/web/wiki/resources/template.html~ +0 -13
- data/narf.gemspec~ +0 -40
- data/sapi/apache_cgi/INSTALL.txt~ +0 -9
- data/sapi/apache_cgi/README~ +0 -0
- data/sapi/fastcgi/INSTALL.txt~ +0 -17
- data/sapi/mod_ruby/INSTALL.txt~ +0 -5
- data/sapi/webrick/INSTALL.txt~ +0 -21
- data/sapi/webrick/run_webrick.rb~ +0 -16
- data/scripts/makedist.rb~ +0 -49
- data/test/mod_ruby_stub.rb~ +0 -38
- data/test/test.action.rb~ +0 -142
- data/test/test.assertinclude.rb~ +0 -109
- data/test/test.narf.cgi.rb~ +0 -105
- data/test/test.request.rb~ +0 -328
- data/test/test.response.rb~ +0 -556
- data/test/test.template.rb~ +0 -832
- data/test/test.web.test.rb~ +0 -461
- data/test/webunit/test_cookie.rb~ +0 -128
- data/test/webunit/test_form.rb~ +0 -43
- data/test/webunit/test_multipart.rb~ +0 -53
- data/test/webunit/test_params.rb~ +0 -211
- data/test/webunit/test_response.rb~ +0 -145
- data/test/webunit/test_site/assert.html~ +0 -1
- data/test/webunit/test_site/auth/index.html~ +0 -1
- data/test/webunit/test_site/badtags.html~ +0 -1
- data/test/webunit/test_site/cookie.cgi~ +0 -35
- data/test/webunit/test_site/document.xml~ +0 -1
- data/test/webunit/test_site/form.html~ +0 -1
- data/test/webunit/test_site/frame-0.html~ +0 -1
- data/test/webunit/test_site/frame-1.html~ +0 -1
- data/test/webunit/test_site/frame.html~ +0 -1
- data/test/webunit/test_site/image.html~ +0 -1
- data/test/webunit/test_site/include.cgi~ +0 -10
- data/test/webunit/test_site/jscript-0.html~ +0 -1
- data/test/webunit/test_site/jscript-1.html~ +0 -1
- data/test/webunit/test_site/jscript.html~ +0 -1
- data/test/webunit/test_site/link.html~ +0 -1
- data/test/webunit/test_site/multipart.cgi~ +0 -25
- data/test/webunit/test_site/multipart.html~ +0 -1
- data/test/webunit/test_site/params.html~ +0 -1
- data/test/webunit/test_site/redirect.cgi~ +0 -14
- data/test/webunit/test_site/response.html~ +0 -1
- data/test/webunit/test_site/simple.cgi~ +0 -17
- data/test/webunit/test_site/stock.cgi~ +0 -34
- data/test/webunit/test_site/table.html~ +0 -1
- data/test/webunit/test_site/test.cgi~ +0 -25
- data/test/wiki/test.history.rb~ +0 -254
- data/test/wiki/test.illustration_page.rb~ +0 -287
- data/test/wiki/test.tarpit.rb~ +0 -40
- data/test/wiki/test.wiki.rb~ +0 -295
data/test/test.action.rb~
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
module Web
|
2
|
-
class Action
|
3
|
-
def Action.clear_actions
|
4
|
-
@@all_actions = []
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
class TestAction < Test::Unit::TestCase
|
10
|
-
def set_up
|
11
|
-
end
|
12
|
-
|
13
|
-
def teardown
|
14
|
-
@output = @cgi = @action = @stored_pattern = nil
|
15
|
-
Web::Action.clear_actions
|
16
|
-
end
|
17
|
-
|
18
|
-
def output
|
19
|
-
@output ||= ""
|
20
|
-
end
|
21
|
-
|
22
|
-
def cgi params={}
|
23
|
-
Web::CGI.new( :out => output, :params => params )
|
24
|
-
end
|
25
|
-
|
26
|
-
def stored_pattern pattern={}
|
27
|
-
@stored_pattern ||= pattern
|
28
|
-
end
|
29
|
-
|
30
|
-
def action( pattern=stored_pattern, &function )
|
31
|
-
@action ||= Web::Action.new( pattern, &function )
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_failed_match_on_blank_cgi
|
35
|
-
action( "name" => // )
|
36
|
-
assert_equal( false, action.applies?(cgi) )
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_fails_with_different_params
|
40
|
-
action "name" => //
|
41
|
-
assert_equal( false, action.applies?(cgi( {"not" => "me"} )) )
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_matchs_by_param_present
|
45
|
-
action "name" => //
|
46
|
-
assert action.applies?(cgi( {"name" => "something"}) )
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_matches_exact_param
|
50
|
-
action "name" => "patrick"
|
51
|
-
assert action.applies?(cgi( {"name" => "patrick" } ))
|
52
|
-
assert_equal( false, action.applies?(cgi( {"name" => "patrick.may"} ) ))
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_matches_pattern
|
56
|
-
action "name" => /patrick|tom/
|
57
|
-
assert action.applies?(cgi( {"name" => "patrick the great" } ))
|
58
|
-
assert action.applies?(cgi( {"name" => "tom the silly" } ))
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_match_is_not_anal
|
62
|
-
action "name" => //
|
63
|
-
assert action.applies?(cgi( {"name" => "something", "ignore" => "me"} ))
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_runs_block
|
67
|
-
action_ran_flag = false
|
68
|
-
action( "name" => // ) {
|
69
|
-
action_ran_flag = true
|
70
|
-
}
|
71
|
-
|
72
|
-
action.run
|
73
|
-
|
74
|
-
assert action_ran_flag
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_guards_block
|
78
|
-
Web::Action.new.run
|
79
|
-
end
|
80
|
-
|
81
|
-
def test_passes_cgi_in_with_run
|
82
|
-
action_ran_flag = false
|
83
|
-
action( "name" => // ){ |cgi|
|
84
|
-
action_ran_flag = cgi.has_key? "flag"
|
85
|
-
}
|
86
|
-
|
87
|
-
action.run cgi( "flag" => "it ran" )
|
88
|
-
|
89
|
-
assert action_ran_flag
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_pick_action_picks_the_most_specific_action
|
93
|
-
one = Web::Action.new( "name" => // )
|
94
|
-
second = Web::Action.new( "name" => "patrick" )
|
95
|
-
third = Web::Action.new( "name" => /patrick|tom/ )
|
96
|
-
|
97
|
-
assert_equal( second, Web::Action.pick( cgi({ "name" => "patrick"}) ) )
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_set_default_action
|
101
|
-
default = Web::Action.new
|
102
|
-
another = Web::Action.new( "this" => "that", "here" => "there" )
|
103
|
-
assert_equal( default, Web::Action.pick( cgi ) )
|
104
|
-
end
|
105
|
-
|
106
|
-
# this test causes no initial default action
|
107
|
-
# def test_raises_exception_if_no_action_is_found
|
108
|
-
# assert_raises(Web::Exception){
|
109
|
-
# Web::Action.pick cgi
|
110
|
-
# }
|
111
|
-
# end
|
112
|
-
|
113
|
-
def test_doesnt_raise_exception_if_no_exception_is_found
|
114
|
-
Web::Action.pick(cgi).run
|
115
|
-
end
|
116
|
-
|
117
|
-
def test_blank_action_doesnt_mask_default
|
118
|
-
Web::Action.pick(cgi).run
|
119
|
-
|
120
|
-
default = Web::Action.new
|
121
|
-
|
122
|
-
assert_equal( default, Web::Action.pick(cgi) )
|
123
|
-
end
|
124
|
-
|
125
|
-
def test_run
|
126
|
-
cgi_params = { "name" => "patrick" }
|
127
|
-
test_params = {}
|
128
|
-
|
129
|
-
Web::Action.new { |cgi|
|
130
|
-
test_params = cgi.multiple_params
|
131
|
-
}
|
132
|
-
|
133
|
-
Web::Action.run :params => cgi_params, :out => ""
|
134
|
-
|
135
|
-
assert_equal( cgi_params, test_params )
|
136
|
-
end
|
137
|
-
|
138
|
-
def todo_test_subclassing_action
|
139
|
-
|
140
|
-
end
|
141
|
-
|
142
|
-
end
|
data/test/test.assertinclude.rb~
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
class TestHashCompare < Test::Unit::TestCase
|
2
|
-
def test_includes_same
|
3
|
-
assert_includes( {"a" => "aa"} , {"a" => "aa"} )
|
4
|
-
end
|
5
|
-
|
6
|
-
def test_includes_missing
|
7
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
8
|
-
assert_includes( { "a" => "aa", "b" => "bb" } , {"a" => "aa"} )
|
9
|
-
}
|
10
|
-
assert_equal "Missing from actual: b => \"bb\".", e.to_s
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_includes_different
|
14
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
15
|
-
assert_includes( {"a" => "aa"} , { "a" => "bb" } )
|
16
|
-
}
|
17
|
-
assert_equal "Difference: required <a => \"aa\"> was <a => \"bb\">.", e.to_s
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_includes_multi_level
|
21
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
22
|
-
assert_includes( {"a" => { "a" => "aa", "b" => "bb" }} , { "a" => { "a" => "aa", "b" => "cc"}} )
|
23
|
-
}
|
24
|
-
assert_equal "Difference: required <a.b => \"bb\"> was <a.b => \"cc\">.", e.to_s
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_includes_array_with_difference
|
28
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
29
|
-
assert_includes( {"a" => [{ "a" => "aa" }, {"b" => "bb" }]},{ "a" => [ {"a" => "aa"}, {"b" => "cc"}]})
|
30
|
-
}
|
31
|
-
assert_equal "Difference: required <a[1].b => \"bb\"> was <a[1].b => \"cc\">.", e.to_s
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_includes_array_with_items_missing
|
35
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
36
|
-
assert_includes( { "a" => [ {"a" => "aa"}, {"b" => "cc"}]} , {"a" => [{ "a" => "aa" }]} )
|
37
|
-
}
|
38
|
-
assert_equal "Missing from actual: a[1] => {\"b\"=>\"cc\"}.", e.to_s
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_includes_hash_when_should_not
|
42
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
43
|
-
assert_includes( {"a" => "b"} , { "a" => { "a" => "aa", "b" => "cc"}} )
|
44
|
-
}
|
45
|
-
assert_equal "Difference: required <a => \"b\"> was <a => {\"a\"=>\"aa\", \"b\"=>\"cc\"}>.", e.to_s
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_does_not_include_hash_when_it_should
|
49
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
50
|
-
assert_includes( { "a" => { "a" => "aa" , "b" => "cc"}}, {"a" => "b"} )
|
51
|
-
}
|
52
|
-
assert_equal "Difference: required <a => {\"a\"=>\"aa\", \"b\"=>\"cc\"}> was <a => \"b\">.", e.to_s
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_includes_array_when_should_not
|
56
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
57
|
-
assert_includes( {"a" => "a"}, { "a" => [ {"a" => "aa"}, {"b" => "cc"}]} )
|
58
|
-
}
|
59
|
-
assert_equal "Difference: required <a => \"a\"> was <a => [{\"a\"=>\"aa\"}, {\"b\"=>\"cc\"}]>.", e.to_s
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_does_not_include_array_when_it_should
|
63
|
-
e = assert_raises( Test::Unit::AssertionFailedError ) {
|
64
|
-
assert_includes( {"a" => "b"} , { "a" => { "a" => "aa" , "b" => "cc"}} )
|
65
|
-
}
|
66
|
-
assert_equal "Difference: required <a => \"b\"> was <a => {\"a\"=>\"aa\", \"b\"=>\"cc\"}>.", e.to_s
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_assert_includes
|
70
|
-
assert_includes( {"a" => { "a" => "aa" }}, { "a" => { "a" => "aa" , "b" => "aa"}} )
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_assert_includes2
|
74
|
-
assert_raises (Test::Unit::AssertionFailedError) {
|
75
|
-
assert_includes( { "a" => { "a" => "aa" , "b" => "cc"}}, {"a" => { "c" => "bb" },"b" => { "c" => "bb" }})
|
76
|
-
}
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_assert_includes_array
|
80
|
-
assert_includes( ["a"],[ "a","b"] )
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_demonstrate_failure
|
84
|
-
assert_raises (Test::Unit::AssertionFailedError) {
|
85
|
-
assert_includes(["a","b"],[ "a"])
|
86
|
-
}
|
87
|
-
end
|
88
|
-
|
89
|
-
class Trivial
|
90
|
-
attr_accessor :name
|
91
|
-
def initialize( name )
|
92
|
-
@name = name
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def test_compare_object_tree_to_hash
|
97
|
-
assert_includes({"name" => "patrick"}, Trivial.new("patrick"))
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_compare_object_tree_to_hash
|
101
|
-
assert_includes({"name" => { "name" => "patrick" }}, Trivial.new(Trivial.new("patrick")))
|
102
|
-
end
|
103
|
-
|
104
|
-
|
105
|
-
# TODO:
|
106
|
-
# reports an error if either item is not a hash
|
107
|
-
# improve error reporting when comparing a hash to an array and vice versa
|
108
|
-
# add an enhanced version of assert equals
|
109
|
-
end
|
data/test/test.narf.cgi.rb~
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
class TestWebCgi < Test::Unit::TestCase
|
2
|
-
def set_up
|
3
|
-
#@old_stderr = $stderr
|
4
|
-
end
|
5
|
-
|
6
|
-
def teardown
|
7
|
-
$stderr = $deferr #@old_stderr
|
8
|
-
@mockio = @params = @cookies = nil
|
9
|
-
end
|
10
|
-
|
11
|
-
def output
|
12
|
-
@mockio || (@mockio = ""; @mockio)
|
13
|
-
end
|
14
|
-
|
15
|
-
def params
|
16
|
-
@params || (@params = { "field" => "value" }; @params)
|
17
|
-
end
|
18
|
-
|
19
|
-
def cookies
|
20
|
-
@cookies || (@cookies = { "cookie" => "monster" }; @cookies)
|
21
|
-
end
|
22
|
-
|
23
|
-
def options
|
24
|
-
@options || (@options =
|
25
|
-
{ :out => output, :params => params, :cookies => cookies };
|
26
|
-
@options)
|
27
|
-
end
|
28
|
-
|
29
|
-
def cgi
|
30
|
-
@cgi || (@cgi = Web::CGI.new options; @cgi)
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_initialize
|
34
|
-
def cgi.outputer
|
35
|
-
@outputer
|
36
|
-
end
|
37
|
-
|
38
|
-
assert_equal( output, cgi.cgd.outputer )
|
39
|
-
assert_equal( params, cgi.multiple_params )
|
40
|
-
assert_equal( Web::Request.normalize(cookies), cgi.cookies )
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_output
|
44
|
-
cgi << "<h1>Hello</h1>"
|
45
|
-
cgi.flush
|
46
|
-
assert_match( /Content-Type: text\/html\r\n/, output )
|
47
|
-
assert_match( /\r\n<h1>Hello<\/h1>/, output )
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_get_content
|
51
|
-
# test blank result
|
52
|
-
assert_equal( "", cgi.get_content )
|
53
|
-
|
54
|
-
# test content
|
55
|
-
cgi << "<h1>hola mundo!</h1>"
|
56
|
-
assert_equal( "<h1>hola mundo!</h1>", cgi.get_content )
|
57
|
-
|
58
|
-
# test return value, not reference
|
59
|
-
content = cgi.get_content
|
60
|
-
content += " some trailing garbage"
|
61
|
-
assert_equal( "<h1>hola mundo!</h1>", cgi.get_content )
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_assert_content
|
65
|
-
assert_raises(Test::Unit::AssertionFailedError){
|
66
|
-
cgi.assert_content "No content here"
|
67
|
-
}
|
68
|
-
cgi.write "Here is some content"
|
69
|
-
cgi.assert_content "Here is some content"
|
70
|
-
end
|
71
|
-
|
72
|
-
# this is a bit incomplete -- only encodes ampersands
|
73
|
-
def test_html_encode
|
74
|
-
assert_equal( '&', Web::html_encode( '&' ) )
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_escape
|
78
|
-
assert_equal( '%21%40%24%25%5E%26%2A%28%29', Web::escape('!@$%^&*()') )
|
79
|
-
end
|
80
|
-
|
81
|
-
def test_unescape
|
82
|
-
assert_equal( '!@$%^&*()', Web::unescape('%21%40%24%25%5E%26%2A%28%29') )
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_rfc1123_date
|
86
|
-
assert_match( /[A-Z][a-z]{2}, \d{1,2} [A-Z][a-z]{2} \d{4} \d\d:\d\d:\d\d GMT/,
|
87
|
-
Web::rfc1123_date(Time.now) )
|
88
|
-
end
|
89
|
-
|
90
|
-
def test_web_process_returns_the_cgi
|
91
|
-
cgi = Web.process( :out => "" ){ |cgi|
|
92
|
-
cgi.write "Hello World"
|
93
|
-
}
|
94
|
-
|
95
|
-
assert_equal( "Hello World", cgi.get_content )
|
96
|
-
end
|
97
|
-
|
98
|
-
def test_get_instance_of_cgi_per_output_stream
|
99
|
-
out = ""
|
100
|
-
assert_equal Web::CGI.create( :out => out ), Web::CGI.create( :out => out )
|
101
|
-
assert_not_equal Web::CGI.create( :out => "" ), Web::CGI.create( :out => "" )
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
|
data/test/test.request.rb~
DELETED
@@ -1,328 +0,0 @@
|
|
1
|
-
require 'test/mod_ruby_stub'
|
2
|
-
|
3
|
-
class TestRequest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
include Web::Parser
|
6
|
-
|
7
|
-
def env
|
8
|
-
ENV
|
9
|
-
end
|
10
|
-
|
11
|
-
def input
|
12
|
-
$stdin
|
13
|
-
end
|
14
|
-
|
15
|
-
def assert_keys( expected, found )
|
16
|
-
passes = true
|
17
|
-
expected.each { |k, v|
|
18
|
-
passes = false unless found[k] == v
|
19
|
-
}
|
20
|
-
passes
|
21
|
-
end
|
22
|
-
|
23
|
-
def setup
|
24
|
-
@stdin_back = $stdin
|
25
|
-
end
|
26
|
-
|
27
|
-
def teardown
|
28
|
-
ENV["QUERY_STRING" ] = nil
|
29
|
-
ENV["REQUEST_METHOD"] = nil
|
30
|
-
ENV["CONTENT_TYPE" ] = nil
|
31
|
-
ENV["CONTENT_LENGTH"] = nil
|
32
|
-
ENV["HTTP_COOKIE" ] = nil
|
33
|
-
ENV["COOKIE" ] = nil
|
34
|
-
$stdin = @stdin_back
|
35
|
-
|
36
|
-
if defined? MOD_RUBY
|
37
|
-
Object.module_eval{ remove_const :MOD_RUBY }
|
38
|
-
end
|
39
|
-
@cgi = nil
|
40
|
-
end
|
41
|
-
|
42
|
-
def params
|
43
|
-
{ "string" => "aString",
|
44
|
-
"array[]" => ["one", "two", "three"],
|
45
|
-
"file" => Web::Upload.new( File.new( "test/testfiles/text" ),
|
46
|
-
"content-type",
|
47
|
-
"original-filename" ) }
|
48
|
-
end
|
49
|
-
|
50
|
-
def cookies
|
51
|
-
{ "aCookie" => "Peanut Butter" }
|
52
|
-
end
|
53
|
-
|
54
|
-
def cgi
|
55
|
-
@cgi ||= Web::CGI.new( :params => params,
|
56
|
-
:cookies => cookies )
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_mock_cookies
|
60
|
-
assert_equal( Web::Parser.normalize(cookies), cgi.cookies )
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_convenience_defaults_to_param
|
64
|
-
assert_equal( "aString", cgi["string"] )
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_convenience_returns_array
|
68
|
-
assert_equal( ["one", "two", "three"], cgi["array[]"] )
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_setting_params
|
72
|
-
assert_equal( "aString", cgi["string"] )
|
73
|
-
assert_equal( ["one", "two", "three"], cgi["array[]"] )
|
74
|
-
|
75
|
-
cgi["array[]"] = ["four", "five", "six"]
|
76
|
-
cgi["string"] = "another_string"
|
77
|
-
|
78
|
-
assert_equal( "another_string", cgi["string"] )
|
79
|
-
assert_equal( ["four", "five", "six"], cgi["array[]"] )
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_single_param
|
84
|
-
assert_equal( "aString", cgi.single_param("string") )
|
85
|
-
assert_equal( "one,two,three", cgi.single_param("array[]") )
|
86
|
-
assert_equal( "original-filename", cgi.single_param("file").original_filename )
|
87
|
-
|
88
|
-
assert_equal( "", cgi.single_param("non-existent") )
|
89
|
-
end
|
90
|
-
|
91
|
-
def test_multiple_params
|
92
|
-
assert_equal( ["aString"], cgi.multiple_params["string"] )
|
93
|
-
assert_equal( ["one", "two", "three"], cgi.multiple_params["array[]"] )
|
94
|
-
assert_equal( "original-filename", cgi.multiple_params["file"][0].original_filename )
|
95
|
-
assert_equal( 1, cgi.multiple_params["file"].length)
|
96
|
-
|
97
|
-
assert_equal( [], cgi.multiple_params["non-existent"] )
|
98
|
-
|
99
|
-
Web.get_cgi.multiple_params = cgi.multiple_params
|
100
|
-
|
101
|
-
assert_equal( ["aString"], Web::multiple_params["string"] )
|
102
|
-
assert_equal( ["one", "two", "three"], Web::multiple_params["array[]"] )
|
103
|
-
assert_equal( "original-filename", Web::multiple_params["file"][0].original_filename )
|
104
|
-
assert_equal( 1, Web::multiple_params["file"].length)
|
105
|
-
|
106
|
-
assert_equal( [], Web::multiple_params["non-existent"] )
|
107
|
-
end
|
108
|
-
|
109
|
-
def test_keys
|
110
|
-
assert_equal( ["string", "array[]", "file"].sort, cgi.keys.sort )
|
111
|
-
end
|
112
|
-
|
113
|
-
def test_has_key?
|
114
|
-
assert cgi.key?( "string" )
|
115
|
-
assert cgi.key?( "array[]" )
|
116
|
-
assert cgi.key?( "file" )
|
117
|
-
|
118
|
-
assert ((cgi.key? "missing key") == false)
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_parse_query_string
|
122
|
-
assert_equal({}, {})
|
123
|
-
assert_keys( {"query1"=>["~value1"], "query2"=>["value1", "value2"] },
|
124
|
-
Web::Parser.parse_query_string('query1=%7Evalue1&query2=value1&query2=value2') )
|
125
|
-
end
|
126
|
-
|
127
|
-
def test_parse_nil_cookie
|
128
|
-
assert_keys( {}, Web::Parser.parse_cookie(nil) )
|
129
|
-
assert_equal( [], Web::Parser.parse_cookie(nil).default )
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_parse_cookie
|
133
|
-
assert_equal( {"cookie1"=>["~value1"], "cookie2"=>["value1", "value2"]}.inspect,
|
134
|
-
Web::Parser.parse_cookie("cookie1=%7Evalue1; cookie2=value1; cookie2=value2").inspect )
|
135
|
-
end
|
136
|
-
|
137
|
-
def test_parse_multiple_cookies
|
138
|
-
assert_equal( {"cookie"=>["~value1", "value 2"]}.inspect,
|
139
|
-
Web::Parser.parse_cookie("cookie=%7Evalue1&value%202").inspect )
|
140
|
-
end
|
141
|
-
|
142
|
-
def test_parse_blank_cookie
|
143
|
-
assert_keys( {"cookie"=>[]},
|
144
|
-
Web::Parser.parse_cookie("cookie=") )
|
145
|
-
end
|
146
|
-
|
147
|
-
def test_cgi_parses_by_default
|
148
|
-
ENV["REQUEST_METHOD"] = "GET"
|
149
|
-
ENV["QUERY_STRING"] = "key=a%20value&anotherKey=another%20value"
|
150
|
-
assert_keys( {"key" => ["a value"], "anotherKey" => ["another value"] },
|
151
|
-
Web::CGI.new.multiple_params )
|
152
|
-
end
|
153
|
-
|
154
|
-
def test_cgi_parses_http_cookie
|
155
|
-
ENV['HTTP_COOKIE'] = "cookie1=%7Evalue1; cookie2=value1; cookie2=value2"
|
156
|
-
assert_keys( {"cookie1"=>["~value1"], "cookie2"=>["value1", "value2"]},
|
157
|
-
Web::CGI.new.cookies )
|
158
|
-
end
|
159
|
-
|
160
|
-
def test_cgi_parses_cookie
|
161
|
-
ENV['COOKIE'] = "cookie1=%7Evalue1; cookie2=value1; cookie2=value2"
|
162
|
-
|
163
|
-
assert_keys( {"cookie1"=>["~value1"], "cookie2"=>["value1", "value2"]},
|
164
|
-
Web::CGI.new.cookies )
|
165
|
-
end
|
166
|
-
|
167
|
-
def test_cgi_only_parses_cookies_once
|
168
|
-
ENV['HTTP_COOKIE'] = "cookie1=%7Evalue1; cookie2=value1; cookie2=value2"
|
169
|
-
ENV['COOKIE'] = "cookie1=%7Evalue1; cookie2=value1; cookie2=value2"
|
170
|
-
assert_keys( {"cookie1"=>["~value1"], "cookie2"=>["value1", "value2"]},
|
171
|
-
Web::CGI.new.cookies )
|
172
|
-
end
|
173
|
-
|
174
|
-
def test_parse_empty_query_string
|
175
|
-
ENV["REQUEST_METHOD"] = "GET"
|
176
|
-
assert_keys( {}, parse_params )
|
177
|
-
end
|
178
|
-
|
179
|
-
def test_parse_get_query_string
|
180
|
-
ENV["REQUEST_METHOD"] = "GET"
|
181
|
-
ENV["QUERY_STRING"] = "key=a%20value&anotherKey=another%20value"
|
182
|
-
assert_keys( {"key" => ["a value"], "anotherKey" => ["another value"]},
|
183
|
-
parse_params )
|
184
|
-
end
|
185
|
-
|
186
|
-
def test_parse_get_multiples
|
187
|
-
ENV["REQUEST_METHOD"] = "GET"
|
188
|
-
ENV["QUERY_STRING"] = "key=a%20value&key=another%20value"
|
189
|
-
assert_keys( {"key" => ["a value", "another value"]}, parse_params )
|
190
|
-
end
|
191
|
-
|
192
|
-
def test_parse_head_like_get
|
193
|
-
ENV["REQUEST_METHOD"] = "HEAD"
|
194
|
-
assert_keys( {}, parse_params )
|
195
|
-
|
196
|
-
teardown
|
197
|
-
|
198
|
-
ENV["REQUEST_METHOD"] = "HEAD"
|
199
|
-
ENV["QUERY_STRING"] = "key=a%20value&anotherKey=another%20value"
|
200
|
-
assert_keys( {"key" => ["a value"], "anotherKey" => ["another value"]},
|
201
|
-
parse_params )
|
202
|
-
end
|
203
|
-
|
204
|
-
def test_parse_post
|
205
|
-
ENV["REQUEST_METHOD"] = "POST"
|
206
|
-
ENV["CONTENT_LENGTH"] = "40"
|
207
|
-
File.open( "test/testfiles/post.data" ){ |post_data|
|
208
|
-
$stdin = post_data
|
209
|
-
assert_keys( {"key" => ["a value"], "anotherKey" => ["another value"]},
|
210
|
-
parse_params )
|
211
|
-
}
|
212
|
-
end
|
213
|
-
|
214
|
-
# def test_parse_multiparts
|
215
|
-
# multipart_test( 19441, "---------------------------1934113851018", "mozilla" )
|
216
|
-
# multipart_test( 19483, "---------------------------22501762916738", "netscape4" )
|
217
|
-
# multipart_test( 19480, "---------------------------7d21f962d00c4", "explorer5" )
|
218
|
-
# end
|
219
|
-
|
220
|
-
def multipart_test( content_length, boundary, browser )
|
221
|
-
ENV["REQUEST_METHOD"] = "POST"
|
222
|
-
ENV["CONTENT_LENGTH"] = content_length.to_s
|
223
|
-
ENV["CONTENT_TYPE" ] = "multipart/form-data, boundary=#{ boundary }"
|
224
|
-
File.open( "test/testfiles/#{ browser }.multipart.data" ) { |post_data|
|
225
|
-
$stdin = post_data
|
226
|
-
multipart_asserts
|
227
|
-
}
|
228
|
-
end
|
229
|
-
|
230
|
-
def multipart_asserts
|
231
|
-
params = Web::Request.parse
|
232
|
-
assert_equal( ["key", "file"], params.keys )
|
233
|
-
assert_equal( ["value"], params["key"] )
|
234
|
-
assert_equal( 1, params["file"].length )
|
235
|
-
assert_match( /pic hydra.png/, params["file"][0].original_filename )
|
236
|
-
assert_match( /image/, params["file"][0].content_type )
|
237
|
-
assert_match( /png/, params["file"][0].content_type )
|
238
|
-
File.open( "test/testfiles/pic hydra.png" ) { |test_image|
|
239
|
-
test_image.binmode
|
240
|
-
params["file"][0].binmode
|
241
|
-
assert_equal( test_image.read, params["file"][0].read )
|
242
|
-
}
|
243
|
-
end
|
244
|
-
|
245
|
-
def test_parse_two_uploaded_files
|
246
|
-
|
247
|
-
end
|
248
|
-
|
249
|
-
def test_downcase_env
|
250
|
-
ENV["KEY"] = "value"
|
251
|
-
env = downcase_env( ENV )
|
252
|
-
["key", "kEy", "kEY", "KEY", "KEy", "Key", "keY"].each{ |k|
|
253
|
-
assert( env.has_key?(k) )
|
254
|
-
assert_equal( "value", env[k] )
|
255
|
-
}
|
256
|
-
|
257
|
-
end
|
258
|
-
|
259
|
-
#-------------------------------------------------------
|
260
|
-
# I've been unable to get this test to work right.
|
261
|
-
# For some reason, the code inside Request.parse
|
262
|
-
# can't see the MOD_RUBY constant I'm trying to set.
|
263
|
-
#
|
264
|
-
# Tracing statements have shown that the
|
265
|
-
# if(defined?MOD_RUBY) in Request.parse returns false
|
266
|
-
# but if(defined?MOD_RUBY) returns true within the
|
267
|
-
# test's scope.
|
268
|
-
#-------------------------------------------------------
|
269
|
-
# def test_parse_get_with_mod_ruby
|
270
|
-
# Object.const_set( :MOD_RUBY, true )
|
271
|
-
# assert_equal( {"key" => ["some value"], "anotherKey" => ["someother value"]},
|
272
|
-
# Web::Request.parse )
|
273
|
-
# end
|
274
|
-
|
275
|
-
# this test added so I can test the effect of above apart from the cause
|
276
|
-
#def test_mod_ruby_query_string
|
277
|
-
# assert_equal( "key=some%20value&anotherKey=someother%20value",
|
278
|
-
# Web::CGD.mod_ruby_query_string )
|
279
|
-
# end
|
280
|
-
|
281
|
-
end
|
282
|
-
|
283
|
-
class TestUpload < Test::Unit::TestCase
|
284
|
-
attr_reader :original_filename, :content_type, :test_file, :move_to
|
285
|
-
def setup
|
286
|
-
@test_file = "test/testfiles/pic hydra.png"
|
287
|
-
@original_filename = "c:\\workspace\\hydra.png"
|
288
|
-
@content_type = "image/png"
|
289
|
-
@move_to = "test/testfiles/moved_hydra.png"
|
290
|
-
end
|
291
|
-
|
292
|
-
def test_initialize
|
293
|
-
File.open( test_file ) { |file|
|
294
|
-
upload = Web::Upload.new( file, content_type, original_filename )
|
295
|
-
|
296
|
-
assert_equal( content_type, upload.content_type )
|
297
|
-
assert_equal( original_filename, upload.original_filename )
|
298
|
-
}
|
299
|
-
end
|
300
|
-
|
301
|
-
def test_initialize_with_filename
|
302
|
-
upload = Web::Upload.new( test_file, content_type, original_filename )
|
303
|
-
|
304
|
-
assert_equal( File.open( test_file, "r" ) { |f| f.read }, upload.read )
|
305
|
-
end
|
306
|
-
|
307
|
-
def test_read_open_and_write_file
|
308
|
-
expected_contents = File.open( test_file, "r" ) { |f| f.read }
|
309
|
-
|
310
|
-
upload = Web::Upload.new( test_file, content_type, original_filename )
|
311
|
-
|
312
|
-
assert_equal( expected_contents, upload.read )
|
313
|
-
|
314
|
-
upload.open{ |io|
|
315
|
-
assert_equal( expected_contents, io.read )
|
316
|
-
}
|
317
|
-
|
318
|
-
begin
|
319
|
-
upload.write_to_file( move_to )
|
320
|
-
File.open( move_to, "r" ) { |io|
|
321
|
-
assert_equal( expected_contents, io.read )
|
322
|
-
}
|
323
|
-
ensure
|
324
|
-
File.delete( move_to )
|
325
|
-
end
|
326
|
-
|
327
|
-
end
|
328
|
-
end
|