qwik2md 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (335) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +4 -0
  4. data/Gemfile +4 -0
  5. data/README.md +36 -0
  6. data/Rakefile +10 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/exe/qwik2md +17 -0
  10. data/lib/qwik2md/version.rb +3 -0
  11. data/lib/qwik2md.rb +39 -0
  12. data/qwik2md.gemspec +30 -0
  13. data/vendor/qwik/AUTHORS +10 -0
  14. data/vendor/qwik/COPYING +340 -0
  15. data/vendor/qwik/COPYRIGHT +346 -0
  16. data/vendor/qwik/lib/qwik/Makefile +63 -0
  17. data/vendor/qwik/lib/qwik/Rakefile +17 -0
  18. data/vendor/qwik/lib/qwik/act-aa.rb +83 -0
  19. data/vendor/qwik/lib/qwik/act-archive.rb +386 -0
  20. data/vendor/qwik/lib/qwik/act-attach.rb +304 -0
  21. data/vendor/qwik/lib/qwik/act-backup.rb +236 -0
  22. data/vendor/qwik/lib/qwik/act-basic.rb +325 -0
  23. data/vendor/qwik/lib/qwik/act-book.rb +161 -0
  24. data/vendor/qwik/lib/qwik/act-calc.rb +371 -0
  25. data/vendor/qwik/lib/qwik/act-charset.rb +251 -0
  26. data/vendor/qwik/lib/qwik/act-christel.rb +112 -0
  27. data/vendor/qwik/lib/qwik/act-chronology.rb +149 -0
  28. data/vendor/qwik/lib/qwik/act-code.rb +155 -0
  29. data/vendor/qwik/lib/qwik/act-comment.rb +554 -0
  30. data/vendor/qwik/lib/qwik/act-config.rb +49 -0
  31. data/vendor/qwik/lib/qwik/act-counter.rb +125 -0
  32. data/vendor/qwik/lib/qwik/act-day.rb +96 -0
  33. data/vendor/qwik/lib/qwik/act-describe.rb +135 -0
  34. data/vendor/qwik/lib/qwik/act-diary.rb +109 -0
  35. data/vendor/qwik/lib/qwik/act-edit.rb +317 -0
  36. data/vendor/qwik/lib/qwik/act-embed-html.rb +296 -0
  37. data/vendor/qwik/lib/qwik/act-emode.rb +150 -0
  38. data/vendor/qwik/lib/qwik/act-event.rb +187 -0
  39. data/vendor/qwik/lib/qwik/act-file.rb +303 -0
  40. data/vendor/qwik/lib/qwik/act-files.rb +771 -0
  41. data/vendor/qwik/lib/qwik/act-getpass.rb +295 -0
  42. data/vendor/qwik/lib/qwik/act-history.rb +136 -0
  43. data/vendor/qwik/lib/qwik/act-html.rb +204 -0
  44. data/vendor/qwik/lib/qwik/act-httpauth.rb +147 -0
  45. data/vendor/qwik/lib/qwik/act-include.rb +142 -0
  46. data/vendor/qwik/lib/qwik/act-interwiki.rb +189 -0
  47. data/vendor/qwik/lib/qwik/act-isearch.rb +109 -0
  48. data/vendor/qwik/lib/qwik/act-keywords.rb +137 -0
  49. data/vendor/qwik/lib/qwik/act-lang.rb +81 -0
  50. data/vendor/qwik/lib/qwik/act-license.rb +63 -0
  51. data/vendor/qwik/lib/qwik/act-list.rb +287 -0
  52. data/vendor/qwik/lib/qwik/act-login.rb +410 -0
  53. data/vendor/qwik/lib/qwik/act-logout.rb +60 -0
  54. data/vendor/qwik/lib/qwik/act-mail.rb +159 -0
  55. data/vendor/qwik/lib/qwik/act-map.rb +292 -0
  56. data/vendor/qwik/lib/qwik/act-md5.rb +42 -0
  57. data/vendor/qwik/lib/qwik/act-mdlb.rb +741 -0
  58. data/vendor/qwik/lib/qwik/act-media.rb +416 -0
  59. data/vendor/qwik/lib/qwik/act-member.rb +157 -0
  60. data/vendor/qwik/lib/qwik/act-menu.rb +142 -0
  61. data/vendor/qwik/lib/qwik/act-metadata.rb +323 -0
  62. data/vendor/qwik/lib/qwik/act-mlsubmitform.rb +49 -0
  63. data/vendor/qwik/lib/qwik/act-monitor.rb +167 -0
  64. data/vendor/qwik/lib/qwik/act-new.rb +418 -0
  65. data/vendor/qwik/lib/qwik/act-pagelist.rb +248 -0
  66. data/vendor/qwik/lib/qwik/act-password.rb +145 -0
  67. data/vendor/qwik/lib/qwik/act-plan.rb +210 -0
  68. data/vendor/qwik/lib/qwik/act-povray.rb +230 -0
  69. data/vendor/qwik/lib/qwik/act-presen.rb +380 -0
  70. data/vendor/qwik/lib/qwik/act-redirect.rb +133 -0
  71. data/vendor/qwik/lib/qwik/act-ring.rb +1071 -0
  72. data/vendor/qwik/lib/qwik/act-rrefs.rb +255 -0
  73. data/vendor/qwik/lib/qwik/act-ruby.rb +116 -0
  74. data/vendor/qwik/lib/qwik/act-sample.rb +170 -0
  75. data/vendor/qwik/lib/qwik/act-save.rb +295 -0
  76. data/vendor/qwik/lib/qwik/act-schedule.rb +374 -0
  77. data/vendor/qwik/lib/qwik/act-search.rb +180 -0
  78. data/vendor/qwik/lib/qwik/act-searchwords.rb +51 -0
  79. data/vendor/qwik/lib/qwik/act-sendpass.rb +83 -0
  80. data/vendor/qwik/lib/qwik/act-site.rb +89 -0
  81. data/vendor/qwik/lib/qwik/act-sitebackup.rb +419 -0
  82. data/vendor/qwik/lib/qwik/act-sitelog.rb +118 -0
  83. data/vendor/qwik/lib/qwik/act-smil.rb +299 -0
  84. data/vendor/qwik/lib/qwik/act-status.rb +220 -0
  85. data/vendor/qwik/lib/qwik/act-style.rb +608 -0
  86. data/vendor/qwik/lib/qwik/act-table.rb +263 -0
  87. data/vendor/qwik/lib/qwik/act-tableform.rb +241 -0
  88. data/vendor/qwik/lib/qwik/act-tag.rb +103 -0
  89. data/vendor/qwik/lib/qwik/act-text.rb +70 -0
  90. data/vendor/qwik/lib/qwik/act-textarea.rb +164 -0
  91. data/vendor/qwik/lib/qwik/act-theme.rb +346 -0
  92. data/vendor/qwik/lib/qwik/act-toc.rb +112 -0
  93. data/vendor/qwik/lib/qwik/act-typekey.rb +198 -0
  94. data/vendor/qwik/lib/qwik/act-under-const.rb +94 -0
  95. data/vendor/qwik/lib/qwik/act-webservice.rb +321 -0
  96. data/vendor/qwik/lib/qwik/act-wema.rb +558 -0
  97. data/vendor/qwik/lib/qwik/act-wysiwyg.rb +238 -0
  98. data/vendor/qwik/lib/qwik/action.rb +325 -0
  99. data/vendor/qwik/lib/qwik/autoreload.rb +98 -0
  100. data/vendor/qwik/lib/qwik/bench-bench.rb +28 -0
  101. data/vendor/qwik/lib/qwik/bench-emode.rb +47 -0
  102. data/vendor/qwik/lib/qwik/bench-format-xml.rb +70 -0
  103. data/vendor/qwik/lib/qwik/bench-large-table.rb +62 -0
  104. data/vendor/qwik/lib/qwik/bench-md5.rb +14 -0
  105. data/vendor/qwik/lib/qwik/bench-module-session.rb +19 -0
  106. data/vendor/qwik/lib/qwik/bench-page.rb +50 -0
  107. data/vendor/qwik/lib/qwik/bench-s-md5.rb +28 -0
  108. data/vendor/qwik/lib/qwik/bench-session.rb +25 -0
  109. data/vendor/qwik/lib/qwik/bench-textformat.rb +31 -0
  110. data/vendor/qwik/lib/qwik/catalog-factory.rb +91 -0
  111. data/vendor/qwik/lib/qwik/catalog-ja.rb +479 -0
  112. data/vendor/qwik/lib/qwik/catalog-ml-ja.rb +145 -0
  113. data/vendor/qwik/lib/qwik/check-act-monitor.rb +112 -0
  114. data/vendor/qwik/lib/qwik/check-act-monitor2.rb +46 -0
  115. data/vendor/qwik/lib/qwik/check-act-theme.rb +27 -0
  116. data/vendor/qwik/lib/qwik/check-event.rb +112 -0
  117. data/vendor/qwik/lib/qwik/check-event2.rb +55 -0
  118. data/vendor/qwik/lib/qwik/check-htree-rexml.rb +77 -0
  119. data/vendor/qwik/lib/qwik/check-htree.rb +51 -0
  120. data/vendor/qwik/lib/qwik/check-libxml.rb +135 -0
  121. data/vendor/qwik/lib/qwik/check-many-pages.rb +47 -0
  122. data/vendor/qwik/lib/qwik/check-monitor.rb +33 -0
  123. data/vendor/qwik/lib/qwik/check-observer.rb +67 -0
  124. data/vendor/qwik/lib/qwik/check-server.rb +61 -0
  125. data/vendor/qwik/lib/qwik/check-uuencode.rb +33 -0
  126. data/vendor/qwik/lib/qwik/check-webdav.rb +65 -0
  127. data/vendor/qwik/lib/qwik/check-xml-xpath.rb +27 -0
  128. data/vendor/qwik/lib/qwik/common-backtrace.rb +94 -0
  129. data/vendor/qwik/lib/qwik/common-basic.rb +111 -0
  130. data/vendor/qwik/lib/qwik/common-condition.rb +142 -0
  131. data/vendor/qwik/lib/qwik/common-error.rb +48 -0
  132. data/vendor/qwik/lib/qwik/common-gettext.rb +50 -0
  133. data/vendor/qwik/lib/qwik/common-javascript.rb +45 -0
  134. data/vendor/qwik/lib/qwik/common-notice.rb +132 -0
  135. data/vendor/qwik/lib/qwik/common-plain.rb +105 -0
  136. data/vendor/qwik/lib/qwik/common-plugin.rb +111 -0
  137. data/vendor/qwik/lib/qwik/common-res.rb +76 -0
  138. data/vendor/qwik/lib/qwik/common-resolve.rb +92 -0
  139. data/vendor/qwik/lib/qwik/common-send.rb +171 -0
  140. data/vendor/qwik/lib/qwik/common-session.rb +139 -0
  141. data/vendor/qwik/lib/qwik/common-surface.rb +261 -0
  142. data/vendor/qwik/lib/qwik/common-url.rb +90 -0
  143. data/vendor/qwik/lib/qwik/compat/Makefile +12 -0
  144. data/vendor/qwik/lib/qwik/compat/add_load_path.rb +1 -0
  145. data/vendor/qwik/lib/qwik/config.rb +299 -0
  146. data/vendor/qwik/lib/qwik/db-b-backup.rb +142 -0
  147. data/vendor/qwik/lib/qwik/db-backup.rb +184 -0
  148. data/vendor/qwik/lib/qwik/db-berkeley.rb +306 -0
  149. data/vendor/qwik/lib/qwik/db-filesystem.rb +305 -0
  150. data/vendor/qwik/lib/qwik/db-indexer.rb +154 -0
  151. data/vendor/qwik/lib/qwik/db-searchwords.rb +238 -0
  152. data/vendor/qwik/lib/qwik/description-ja.rb +267 -0
  153. data/vendor/qwik/lib/qwik/description.rb +256 -0
  154. data/vendor/qwik/lib/qwik/dev-add-copyright.rb +23 -0
  155. data/vendor/qwik/lib/qwik/dev-backup.rb +24 -0
  156. data/vendor/qwik/lib/qwik/dev-bench.rb +175 -0
  157. data/vendor/qwik/lib/qwik/dev-calctime.rb +52 -0
  158. data/vendor/qwik/lib/qwik/dev-css-compressor.rb +60 -0
  159. data/vendor/qwik/lib/qwik/dev-extract-catalog.rb +102 -0
  160. data/vendor/qwik/lib/qwik/dev-js-compressor.rb +73 -0
  161. data/vendor/qwik/lib/qwik/dev-release.rb +235 -0
  162. data/vendor/qwik/lib/qwik/dev-replace.rb +353 -0
  163. data/vendor/qwik/lib/qwik/dev-sendmail.rb +25 -0
  164. data/vendor/qwik/lib/qwik/farm.rb +283 -0
  165. data/vendor/qwik/lib/qwik/gettext.rb +56 -0
  166. data/vendor/qwik/lib/qwik/group-cond.rb +157 -0
  167. data/vendor/qwik/lib/qwik/group-config.rb +247 -0
  168. data/vendor/qwik/lib/qwik/group-confirm.rb +147 -0
  169. data/vendor/qwik/lib/qwik/group-db.rb +326 -0
  170. data/vendor/qwik/lib/qwik/group-mail.rb +195 -0
  171. data/vendor/qwik/lib/qwik/group-member.rb +307 -0
  172. data/vendor/qwik/lib/qwik/group-sendmail.rb +231 -0
  173. data/vendor/qwik/lib/qwik/group-site.rb +374 -0
  174. data/vendor/qwik/lib/qwik/group-sweep.rb +63 -0
  175. data/vendor/qwik/lib/qwik/group.rb +157 -0
  176. data/vendor/qwik/lib/qwik/helper.rb +6 -0
  177. data/vendor/qwik/lib/qwik/html-generator.rb +104 -0
  178. data/vendor/qwik/lib/qwik/html-to-wabisabi.rb +148 -0
  179. data/vendor/qwik/lib/qwik/htree-diff.rb +87 -0
  180. data/vendor/qwik/lib/qwik/htree-format-xml.rb +57 -0
  181. data/vendor/qwik/lib/qwik/htree-generator.rb +144 -0
  182. data/vendor/qwik/lib/qwik/htree-get.rb +251 -0
  183. data/vendor/qwik/lib/qwik/htree-html-generator.rb +179 -0
  184. data/vendor/qwik/lib/qwik/htree-template.rb +263 -0
  185. data/vendor/qwik/lib/qwik/htree-to-wabisabi.rb +171 -0
  186. data/vendor/qwik/lib/qwik/loadlib.rb +79 -0
  187. data/vendor/qwik/lib/qwik/logger.rb +115 -0
  188. data/vendor/qwik/lib/qwik/mail-body.rb +171 -0
  189. data/vendor/qwik/lib/qwik/mail-header.rb +474 -0
  190. data/vendor/qwik/lib/qwik/mail-multipart.rb +193 -0
  191. data/vendor/qwik/lib/qwik/mail-parse.rb +147 -0
  192. data/vendor/qwik/lib/qwik/mail.rb +341 -0
  193. data/vendor/qwik/lib/qwik/mailaddress.rb +83 -0
  194. data/vendor/qwik/lib/qwik/mdlb-model.rb +81 -0
  195. data/vendor/qwik/lib/qwik/mdlb-sample.rb +324 -0
  196. data/vendor/qwik/lib/qwik/ml-catalog-factory.rb +27 -0
  197. data/vendor/qwik/lib/qwik/ml-exception.rb +15 -0
  198. data/vendor/qwik/lib/qwik/ml-generator.rb +28 -0
  199. data/vendor/qwik/lib/qwik/ml-gettext.rb +137 -0
  200. data/vendor/qwik/lib/qwik/ml-logger.rb +82 -0
  201. data/vendor/qwik/lib/qwik/ml-memory.rb +65 -0
  202. data/vendor/qwik/lib/qwik/ml-msg-validator.rb +86 -0
  203. data/vendor/qwik/lib/qwik/ml-processor.rb +609 -0
  204. data/vendor/qwik/lib/qwik/ml-quickml-server.rb +122 -0
  205. data/vendor/qwik/lib/qwik/ml-sendmail.rb +0 -0
  206. data/vendor/qwik/lib/qwik/ml-server.rb +107 -0
  207. data/vendor/qwik/lib/qwik/ml-session.rb +348 -0
  208. data/vendor/qwik/lib/qwik/ml-sweeper.rb +101 -0
  209. data/vendor/qwik/lib/qwik/mock-logger.rb +65 -0
  210. data/vendor/qwik/lib/qwik/mock-sendmail.rb +78 -0
  211. data/vendor/qwik/lib/qwik/mock-socket.rb +82 -0
  212. data/vendor/qwik/lib/qwik/modulobe.rb +406 -0
  213. data/vendor/qwik/lib/qwik/mongrel-server.rb +72 -0
  214. data/vendor/qwik/lib/qwik/page-files.rb +249 -0
  215. data/vendor/qwik/lib/qwik/page-generate.rb +82 -0
  216. data/vendor/qwik/lib/qwik/page-get.rb +262 -0
  217. data/vendor/qwik/lib/qwik/page-images.rb +168 -0
  218. data/vendor/qwik/lib/qwik/page-put.rb +128 -0
  219. data/vendor/qwik/lib/qwik/page-rrefs.rb +154 -0
  220. data/vendor/qwik/lib/qwik/page-title.rb +0 -0
  221. data/vendor/qwik/lib/qwik/page-wikidb.rb +234 -0
  222. data/vendor/qwik/lib/qwik/page.rb +67 -0
  223. data/vendor/qwik/lib/qwik/pages.rb +444 -0
  224. data/vendor/qwik/lib/qwik/parse-plugin.rb +249 -0
  225. data/vendor/qwik/lib/qwik/parser-emode.rb +116 -0
  226. data/vendor/qwik/lib/qwik/parser-inline.rb +272 -0
  227. data/vendor/qwik/lib/qwik/parser.rb +349 -0
  228. data/vendor/qwik/lib/qwik/password.rb +183 -0
  229. data/vendor/qwik/lib/qwik/periodic.rb +79 -0
  230. data/vendor/qwik/lib/qwik/qp.rb +56 -0
  231. data/vendor/qwik/lib/qwik/qwik-service.rb +341 -0
  232. data/vendor/qwik/lib/qwik/qwik.rb +5 -0
  233. data/vendor/qwik/lib/qwik/qwikweb-adduser.rb +34 -0
  234. data/vendor/qwik/lib/qwik/qwikweb-catalog-validator.rb +110 -0
  235. data/vendor/qwik/lib/qwik/qwikweb-incgen.rb +28 -0
  236. data/vendor/qwik/lib/qwik/qwikweb-makesite.rb +41 -0
  237. data/vendor/qwik/lib/qwik/qwikweb-server.rb +44 -0
  238. data/vendor/qwik/lib/qwik/qwikweb-showpassword.rb +26 -0
  239. data/vendor/qwik/lib/qwik/qwikweb-watchlog.rb +67 -0
  240. data/vendor/qwik/lib/qwik/request-path.rb +304 -0
  241. data/vendor/qwik/lib/qwik/request-ua.rb +76 -0
  242. data/vendor/qwik/lib/qwik/request-webrick.rb +81 -0
  243. data/vendor/qwik/lib/qwik/request.rb +91 -0
  244. data/vendor/qwik/lib/qwik/resolve-tdiary.rb +292 -0
  245. data/vendor/qwik/lib/qwik/resolve.rb +121 -0
  246. data/vendor/qwik/lib/qwik/response.rb +228 -0
  247. data/vendor/qwik/lib/qwik/server-memory.rb +57 -0
  248. data/vendor/qwik/lib/qwik/server-webrick.rb +102 -0
  249. data/vendor/qwik/lib/qwik/server.rb +252 -0
  250. data/vendor/qwik/lib/qwik/site-config.rb +149 -0
  251. data/vendor/qwik/lib/qwik/site-db.rb +136 -0
  252. data/vendor/qwik/lib/qwik/site-event.rb +162 -0
  253. data/vendor/qwik/lib/qwik/site-files.rb +86 -0
  254. data/vendor/qwik/lib/qwik/site-group.rb +103 -0
  255. data/vendor/qwik/lib/qwik/site-index.rb +47 -0
  256. data/vendor/qwik/lib/qwik/site-log.rb +64 -0
  257. data/vendor/qwik/lib/qwik/site-member.rb +230 -0
  258. data/vendor/qwik/lib/qwik/site-monitor.rb +97 -0
  259. data/vendor/qwik/lib/qwik/site-pages.rb +62 -0
  260. data/vendor/qwik/lib/qwik/site-plan.rb +139 -0
  261. data/vendor/qwik/lib/qwik/site-report.rb +282 -0
  262. data/vendor/qwik/lib/qwik/site-resolve.rb +230 -0
  263. data/vendor/qwik/lib/qwik/site-rrefs.rb +18 -0
  264. data/vendor/qwik/lib/qwik/site-search.rb +180 -0
  265. data/vendor/qwik/lib/qwik/site-timeline.rb +153 -0
  266. data/vendor/qwik/lib/qwik/site-url.rb +189 -0
  267. data/vendor/qwik/lib/qwik/site.rb +76 -0
  268. data/vendor/qwik/lib/qwik/smil-time.rb +105 -0
  269. data/vendor/qwik/lib/qwik/smtp-session.rb +331 -0
  270. data/vendor/qwik/lib/qwik/template-generator.rb +149 -0
  271. data/vendor/qwik/lib/qwik/template.rb +85 -0
  272. data/vendor/qwik/lib/qwik/test-common.rb +10 -0
  273. data/vendor/qwik/lib/qwik/test-ml-info.rb +225 -0
  274. data/vendor/qwik/lib/qwik/test-module-ml.rb +142 -0
  275. data/vendor/qwik/lib/qwik/test-module-path.rb +110 -0
  276. data/vendor/qwik/lib/qwik/test-module-public.rb +70 -0
  277. data/vendor/qwik/lib/qwik/test-module-server.rb +98 -0
  278. data/vendor/qwik/lib/qwik/test-module-session.rb +264 -0
  279. data/vendor/qwik/lib/qwik/test-module-suite.rb +91 -0
  280. data/vendor/qwik/lib/qwik/test-ms-applemail.rb +59 -0
  281. data/vendor/qwik/lib/qwik/test-ms-attach.rb +174 -0
  282. data/vendor/qwik/lib/qwik/test-ms-basic.rb +40 -0
  283. data/vendor/qwik/lib/qwik/test-ms-close.rb +35 -0
  284. data/vendor/qwik/lib/qwik/test-ms-confirm.rb +75 -0
  285. data/vendor/qwik/lib/qwik/test-ms-ignore-spam.rb +57 -0
  286. data/vendor/qwik/lib/qwik/test-ms-japanese.rb +97 -0
  287. data/vendor/qwik/lib/qwik/test-ms-jfilename.rb +82 -0
  288. data/vendor/qwik/lib/qwik/test-ms-large.rb +58 -0
  289. data/vendor/qwik/lib/qwik/test-ms-member.rb +103 -0
  290. data/vendor/qwik/lib/qwik/test-ms-multipart.rb +84 -0
  291. data/vendor/qwik/lib/qwik/test-ms-org.rb +129 -0
  292. data/vendor/qwik/lib/qwik/test-ms-plan.rb +130 -0
  293. data/vendor/qwik/lib/qwik/test-ms-post.rb +53 -0
  294. data/vendor/qwik/lib/qwik/test-ms-quopri.rb +76 -0
  295. data/vendor/qwik/lib/qwik/test-sub-quopri.rb +45 -0
  296. data/vendor/qwik/lib/qwik/test-submit-base64.rb +59 -0
  297. data/vendor/qwik/lib/qwik/test-submit-forward.rb +61 -0
  298. data/vendor/qwik/lib/qwik/test-submit-html-mail.rb +52 -0
  299. data/vendor/qwik/lib/qwik/test-submit-japanese.rb +135 -0
  300. data/vendor/qwik/lib/qwik/test-submit-jfilename.rb +144 -0
  301. data/vendor/qwik/lib/qwik/test-submit-uuencode.rb +71 -0
  302. data/vendor/qwik/lib/qwik/test-suite-all.rb +8 -0
  303. data/vendor/qwik/lib/qwik/test-suite-basic.rb +9 -0
  304. data/vendor/qwik/lib/qwik/test-suite-ml.rb +9 -0
  305. data/vendor/qwik/lib/qwik/test-typekey.rb +64 -0
  306. data/vendor/qwik/lib/qwik/testunit.rb +45 -0
  307. data/vendor/qwik/lib/qwik/tokenizer-inline.rb +288 -0
  308. data/vendor/qwik/lib/qwik/tokenizer.rb +331 -0
  309. data/vendor/qwik/lib/qwik/typekey.rb +160 -0
  310. data/vendor/qwik/lib/qwik/util-basic.rb +135 -0
  311. data/vendor/qwik/lib/qwik/util-charset.rb +331 -0
  312. data/vendor/qwik/lib/qwik/util-css.rb +56 -0
  313. data/vendor/qwik/lib/qwik/util-csv-tokenizer.rb +113 -0
  314. data/vendor/qwik/lib/qwik/util-filename.rb +112 -0
  315. data/vendor/qwik/lib/qwik/util-pathname.rb +202 -0
  316. data/vendor/qwik/lib/qwik/util-pid.rb +58 -0
  317. data/vendor/qwik/lib/qwik/util-safe.rb +67 -0
  318. data/vendor/qwik/lib/qwik/util-sendmail.rb +273 -0
  319. data/vendor/qwik/lib/qwik/util-string.rb +202 -0
  320. data/vendor/qwik/lib/qwik/util-time.rb +125 -0
  321. data/vendor/qwik/lib/qwik/util-webrick.rb +176 -0
  322. data/vendor/qwik/lib/qwik/version.rb +11 -0
  323. data/vendor/qwik/lib/qwik/wabisabi-basic.rb +163 -0
  324. data/vendor/qwik/lib/qwik/wabisabi-diff.rb +130 -0
  325. data/vendor/qwik/lib/qwik/wabisabi-format-xml.rb +310 -0
  326. data/vendor/qwik/lib/qwik/wabisabi-generator.rb +262 -0
  327. data/vendor/qwik/lib/qwik/wabisabi-index.rb +174 -0
  328. data/vendor/qwik/lib/qwik/wabisabi-table.rb +212 -0
  329. data/vendor/qwik/lib/qwik/wabisabi-template.rb +295 -0
  330. data/vendor/qwik/lib/qwik/wabisabi-to-htree.rb +111 -0
  331. data/vendor/qwik/lib/qwik/wabisabi-to-wiki.rb +690 -0
  332. data/vendor/qwik/lib/qwik/wabisabi-traverse.rb +207 -0
  333. data/vendor/qwik/lib/qwik/wabisabi-validator.rb +116 -0
  334. data/vendor/qwik/lib/qwik/wabisabi.rb +5 -0
  335. metadata +492 -0
@@ -0,0 +1,147 @@
1
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
2
+ # This is free software with ABSOLUTELY NO WARRANTY.
3
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
4
+
5
+ $LOAD_PATH << 'compat' unless $LOAD_PATH.include? 'compat'
6
+ require 'base64'
7
+
8
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
9
+
10
+ module Qwik
11
+ class Action
12
+ # ref: webrick/httpauth.rb
13
+ def check_basicauth
14
+ auth = @req['Authorization']
15
+ return if auth.nil?
16
+ return unless /^Basic\s+(.*)/o =~ auth
17
+
18
+ user, pass = Base64.decode64($1).split(':', 2)
19
+ return if user.nil?
20
+
21
+ raise InvalidUserError if user.nil? || user.empty?
22
+ raise InvalidUserError unless MailAddress.valid?(user)
23
+ gen = @memory.passgen
24
+ raise InvalidUserError if !gen.match?(user, pass)
25
+ @req.user = user
26
+ @req.auth = 'basicauth'
27
+ return
28
+ end
29
+
30
+ # ref: webrick/httpauth.rb
31
+ def pre_act_basicauth
32
+ if ! @req.user # Try to Login by using Basic Auth.
33
+ realm = 'qwik'
34
+ @res['WWW-Authenticate'] = "Basic realm=\"#{realm}\""
35
+ # status code must be 401
36
+ return c_notice(_('Log in by Basic Authentication.'), nil, 401) {
37
+ [[:h2, _('Logging in by Basic Authentication.')],
38
+ [:p, _("Please input ID (E-mail) and password.")],
39
+ [:hr],
40
+ [:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]]
41
+ }
42
+ end
43
+
44
+ # Already logged in.
45
+ if @req.auth != 'basicauth' # But, the method is not Basic Auth.
46
+ return c_notice(_('Login by cookie')) {
47
+ [[:h2, _('You are already login by cookie.')],
48
+ [:hr],
49
+ [:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]]
50
+ }
51
+ end
52
+
53
+ return c_notice(_('Log in by Basic Authentication.')) {
54
+ [[:h2, _('Log in using Basic Authentication.')],
55
+ [:hr],
56
+ [:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]]
57
+ }
58
+ end
59
+
60
+ def basicauth_logout
61
+ return c_notice(_('Basic Authentication') + ' ' + _('Log out')) {
62
+ [[:h2, _('Can not log out.')],
63
+ [:p, _('You can not log out in Basic Authentication mode.'), [:br],
64
+ _('Please close browser and access again.')],
65
+ [:hr],
66
+ [:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]]
67
+ }
68
+ end
69
+ end
70
+ end
71
+
72
+ if $0 == __FILE__
73
+ require 'qwik/test-common'
74
+ $test = true
75
+ end
76
+
77
+ if defined?($test) && $test
78
+ class TestActHttpAuth < Test::Unit::TestCase
79
+ include TestSession
80
+
81
+ def test_all
82
+ t_add_user
83
+
84
+ # See the FrontPage.
85
+ res = session '/test/'
86
+ ok_title 'FrontPage'
87
+
88
+ # See the FrontPage before Login.
89
+ res = session('/test/') {|req|
90
+ req.cookies.clear
91
+ }
92
+ ok_title 'Login'
93
+ ok_xp [:meta, {:content=>"1; url=/test/.login", 'http-equiv'=>'Refresh'}],
94
+ "//meta[2]"
95
+
96
+ # See the Login page.
97
+ res = session('/test/.login') {|req|
98
+ req.cookies.clear
99
+ }
100
+ ok_title 'Login'
101
+ # ok_xp [:a, {:href=>'.getpass'}, [:em, 'Get Password']],
102
+ # "//div[@class='section']/a"
103
+ # ok_xp [:a, {:href=>'.basicauth'}, 'Log in by Basic Authentication.'],
104
+ # "//div[@class='section']/a[2]"
105
+
106
+ # See the Basic Auth Login page.
107
+ res = session('/test/.basicauth') {|req|
108
+ req.cookies.clear
109
+ }
110
+ ok_title('Log in by Basic Authentication.')
111
+ ok_eq(401, @res.status)
112
+ ok_eq("Basic realm=\"qwik\"", @res['WWW-Authenticate'])
113
+
114
+ # test base64
115
+ ok_eq("dXNlckBlLmNvbTo5NTk4ODU5Mw==\n",
116
+ Base64.encode64(DEFAULT_USER+':95988593'))
117
+
118
+ # Try to Login by Basic Authenticate.
119
+ res = session('/test/.basicauth') {|req|
120
+ req.cookies.clear
121
+ req.header['authorization'] =
122
+ ["Basic dGVzdEBleGFtcGxlLmNvbTo0NDQ4NDEyNQ=="]
123
+ }
124
+ ok_title('Log in by Basic Authentication.')
125
+ ok_eq(200, @res.status)
126
+ ok_eq(nil, @res['WWW-Authenticate'])
127
+ ok_xp([:a, {:href=>'FrontPage.html'}, 'Go back'], '//a')
128
+
129
+ # Try to see FrontPage
130
+ res = session('/test/') {|req|
131
+ req.cookies.clear
132
+ req.header['authorization'] =
133
+ ["Basic dXNlckBlLmNvbTo5NTk4ODU5Mw=="]
134
+ }
135
+ ok_title('FrontPage')
136
+
137
+ # test_logout
138
+ res = session('/test/.logout') {|req|
139
+ req.cookies.clear
140
+ req.header['authorization'] =
141
+ ["Basic dXNlckBlLmNvbTo5NTk4ODU5Mw=="]
142
+ }
143
+ ok_title('Basic Authentication Log out')
144
+ assert_text('Can not log out.', 'h2')
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,142 @@
1
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
2
+ # This is free software with ABSOLUTELY NO WARRANTY.
3
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
4
+
5
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
6
+
7
+ module Qwik
8
+ class Action
9
+ D_PluginInclude = {
10
+ :dt => 'Include plugin',
11
+ :dd => 'You can include other page.',
12
+ :dc => "* Example
13
+ You can see the FrontPage is included here.
14
+ {{include('FrontPage')}}
15
+ {{include('FrontPage')}}
16
+ "
17
+ }
18
+
19
+ D_PluginInclude_ja = {
20
+ :dt => '取り込みプラグイン',
21
+ :dd => '他のページの内容をとりこみます。',
22
+ :dc => "* 例
23
+ FrontPageの内容を埋め込んでみます。
24
+ {{include('FrontPage')}}
25
+ {{include('FrontPage')}}
26
+ "
27
+ }
28
+
29
+ def plg_include(pagename)
30
+ pagename = pagename.to_s
31
+ page = @site[pagename]
32
+ return nil if page.nil?
33
+
34
+ org_base = @req.base
35
+ @req.base = pagename
36
+
37
+ body = surface_get_body(page)
38
+
39
+ @req.base = org_base
40
+
41
+ return body
42
+ end
43
+ end
44
+ end
45
+
46
+ if $0 == __FILE__
47
+ require 'qwik/test-common'
48
+ $test = true
49
+ end
50
+
51
+ if defined?($test) && $test
52
+ class TestActInlcude < Test::Unit::TestCase
53
+ include TestSession
54
+
55
+ def ok(e, w, user=DEFAULT_USER) # assert_body_main
56
+ assert_path(e, w, user, "//div[@class='body_main']")
57
+ end
58
+
59
+ def ok_day(e, w, user=DEFAULT_USER)
60
+ assert_path(e, w, user, "//div[@class='day']")
61
+ end
62
+
63
+ def test_include
64
+ page = @site.create_new
65
+ page.store("* t
66
+ * t")
67
+ page2 = @site.create_new
68
+ page2.store("* t2
69
+ * t2")
70
+ key = page2.key
71
+ ok_day(['',
72
+ [:div,
73
+ {:class=>'body'},
74
+ [:div,
75
+ {:class=>'section'},
76
+ [[:div,
77
+ {:class=>'day'},
78
+ [:h2, {:id=>'t2'}, 't2'],
79
+ [:div, {:class=>'body'},
80
+ [:div, {:class=>'section'}, []]]]]]]],
81
+ "{{include(#{key})}}")
82
+
83
+ ok([:div,
84
+ {:class=>'day'},
85
+ '',
86
+ [:div,
87
+ {:class=>'body'},
88
+ [:div,
89
+ {:class=>'section'},
90
+ [[:div,
91
+ {:class=>'day'},
92
+ [:h2, {:id=>'t2'}, 't2'],
93
+ [:div, {:class=>'body'},
94
+ [:div, {:class=>'section'}, []]]]]]]],
95
+ "{{include(#{key})}}")
96
+
97
+ config = @site['_SiteConfig']
98
+ config.store(':titlelink:true')
99
+ ok([:div,
100
+ {:class=>'day'},
101
+ '',
102
+ [:div,
103
+ {:class=>'body'},
104
+ [:div,
105
+ {:class=>'section'},
106
+ [[:div,
107
+ {:class=>'day'},
108
+ [:h2,
109
+ [:a, {:href=>"2.html#t2", :name=>'t2', :class=>'label'},
110
+ "■"],
111
+ 't2'],
112
+ [:div, {:class=>'body'},
113
+ [:div, {:class=>'section'}, []]]]]]]],
114
+ "{{include(#{key})}}")
115
+
116
+ config.store('')
117
+ end
118
+
119
+ def test_include_with_titlelink
120
+ t_add_user
121
+
122
+ page = @site.create('t1')
123
+ page.store("* t1
124
+ {{include(t2)}}")
125
+ page2 = @site.create('t2')
126
+ page2.store("* t2!
127
+ * t2!")
128
+
129
+ res = session('/test/t1.html')
130
+ ok_in(['t1'], 'title')
131
+ ok_in(["t2!"], "//div[@class='day']/h2")
132
+
133
+ config = @site['_SiteConfig']
134
+ config.store(':titlelink:true')
135
+ res = session('/test/t1.html')
136
+ ok_in([[:a, {:href=>"t2.html#6b9e49fa28900683969f489ac35161e6",
137
+ :name=>'6b9e49fa28900683969f489ac35161e6',
138
+ :class=>'label'}, "■"], "t2!"],
139
+ "//div[@class='day']/h2")
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,189 @@
1
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
2
+ # This is free software with ABSOLUTELY NO WARRANTY.
3
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
4
+
5
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
6
+
7
+ module Qwik
8
+ class Action
9
+ D_PluginInterWiki = {
10
+ :dt => 'InterWiki plugin',
11
+ :dd => 'Make a link for another Wiki.',
12
+ :dc => "* Example
13
+ You can create a link to another Wiki easily.
14
+ [[qwikjp:InstallOnDebian]]
15
+ [[qwikjp:InstallOnDebian]]
16
+ You'll see the link to InstallOnDebian page on qwik.jp.
17
+
18
+ [[google:qwikWeb]]
19
+ [[google:qwikWeb]]
20
+ You can also create a link to search qwikWeb on Google.
21
+
22
+ You can edit the links on the Page [[_InterWikiName]].
23
+ "
24
+ }
25
+
26
+ D_PluginInterWiki_ja = {
27
+ :dt => 'InterWikiプラグイン',
28
+ :dd => 'Wiki間の相互接続をします。',
29
+ :dc => "* 例
30
+ Wiki間の相互接続を行うための仕組みです。
31
+ [[qwikjp:InstallOnDebian]]
32
+ [[qwikjp:InstallOnDebian]]
33
+ とすると、qwik.jp上のInstallOnDebianというページにリンクします。
34
+
35
+ [[google:qwikWeb]]
36
+ [[google:qwikWeb]]
37
+ 同様に、googleでqwikWebを検索するリンクを作れます。
38
+
39
+ リンク先は[[_InterWikiName]]を編集して変えられます。
40
+ "
41
+ }
42
+
43
+ def plg_interwiki(arg, *d)
44
+ wiki, pagename = arg.split(':')
45
+ return if pagename.nil?
46
+ text = "#{wiki}:#{pagename}"
47
+ text = yield if block_given?
48
+ iw = @site.interwiki
49
+ href = iw.href(wiki, pagename)
50
+
51
+ return [:span, {:class=>'interwiki'}, text] if href.nil?
52
+ [:a, {:href=>href, :class=>'interwiki'}, text]
53
+ end
54
+ end
55
+
56
+ class Site
57
+ def interwiki
58
+ @interwiki = InterWiki.new(@config, self) unless defined? @interwiki
59
+ @interwiki
60
+ end
61
+ end
62
+
63
+ class InterWiki
64
+ def initialize(config, site)
65
+ @site = site
66
+ @db = nil
67
+ end
68
+
69
+ def href(wiki, pagename)
70
+ iw = db[wiki]
71
+ return nil if iw.nil?
72
+ url, encoding = iw
73
+
74
+ pagename.set_page_charset
75
+
76
+ case encoding
77
+ when 'sjis' then pagename = pagename.to_sjis.escape
78
+ when 'euc' then pagename = pagename.to_euc.escape
79
+ when 'utf8' then pagename = pagename.to_utf8.escape
80
+ end
81
+ return url.sub(/\$1/, pagename) if url.index("$1")
82
+ url+pagename
83
+ end
84
+
85
+ private
86
+
87
+ def db
88
+ return @db if @db
89
+ page = get_page
90
+ @db = page.wikidb
91
+ @db
92
+ end
93
+
94
+ def get_page
95
+ k = 'InterWikiName'
96
+ return @site[k] if @site.exist?(k)
97
+ k = "_#{k}"
98
+ return @site[k] if @site.exist?(k)
99
+ return @site.create(k)
100
+ end
101
+ end
102
+ end
103
+
104
+ if $0 == __FILE__
105
+ require 'qwik/test-common'
106
+ $test = true
107
+ end
108
+
109
+ if defined?($test) && $test
110
+ class TestActInterWiki < Test::Unit::TestCase
111
+ include TestSession
112
+
113
+ def test_all
114
+ page = @site.create('_InterWikiName')
115
+
116
+ # test_interwiki
117
+ page.store(',Test,http://example.com/?q=,sjis')
118
+ ok_wi([:p, [:a, {:href=>'http://example.com/?q=t',
119
+ :class=>'interwiki'}, 'Test:t']], '[[Test:t]]')
120
+ ok_eq([:a, {:href=>'http://example.com/?q=t',
121
+ :class=>'interwiki'}, 'Test:t'],
122
+ @action.plg_interwiki('Test:t'))
123
+ ok_eq([:a, {:href=>'http://example.com/?q=t',
124
+ :class=>'interwiki'}, 'content\n'],
125
+ @action.plg_interwiki('Test:t') { 'content\n' })
126
+ ok_wi([:p, [:a, {:href=>'http://example.com/?q=t',
127
+ :class=>'interwiki'}, 'text']], '[[text|Test:t]]')
128
+ ok_wi([:p, [:span, {:class=>'interwiki'}, 'nosuchwiki:t']],
129
+ '[[nosuchwiki:t]]')
130
+
131
+ # test_interwiki_kanji
132
+ page.store(<<'EOM')
133
+ ,SJIS,http://example.com/?q=,sjis
134
+ ,EUC,http://example.com/?q=,euc
135
+ ,UTF8,http://example.com/?q=,utf8
136
+ EOM
137
+ ok_wi([:p, [:a, {:href=>'http://example.com/?q=%8E%9A',
138
+ :class=>'interwiki'}, 'SJIS:字']], '[[SJIS:字]]')
139
+ ok_wi([:p, [:a, {:href=>'http://example.com/?q=%BB%FA',
140
+ :class=>'interwiki'}, 'EUC:字']], '[[EUC:字]]')
141
+ ok_wi([:p, [:a, {:href=>'http://example.com/?q=%E5%AD%97',
142
+ :class=>'interwiki'}, 'UTF8:字']], '[[UTF8:字]]')
143
+
144
+ # test_interwiki_realuse
145
+ page.store(<<'EOM')
146
+ ,google,http://www.google.com/search?num=50&lr=lang_ja&q=,utf8
147
+ ,isbn,http://www.amazon.co.jp/exec/obidos/ASIN/$1/ref=nosim/q02-22,raw
148
+ ,amazon,http://www.amazon.co.jp/exec/obidos/external-search?tag=q02-22&keyword=$1&mode=blended,utf8
149
+ ,hiki,http://www.namaraii.com/hiki/hiki.cgi?,euc
150
+ ,yukiwiki,http://www.hyuki.com/yukiwiki/wiki.cgi?,euc
151
+ EOM
152
+ ok_wi([:p, [:a, {:href=>"http://www.google.com/search?num=50&lr=lang_ja&q=%E5%AD%97", :class=>'interwiki'}, "google:字"]], "[[google:字]]")
153
+ ok_wi([:p, [:a, {:href=>"http://www.google.com/search?num=50&lr=lang_ja&q=%3C", :class=>'interwiki'}, "google:<"]], "[[google:<]]")
154
+ ok_wi([:p, [:a, {:href=>"http://www.amazon.co.jp/exec/obidos/ASIN/4797318325/ref=nosim/q02-22", :class=>'interwiki'}, 'isbn:4797318325']], "[[isbn:4797318325]]")
155
+ ok_wi([:p, [:a, {:href=>"http://www.amazon.co.jp/exec/obidos/external-search?tag=q02-22&keyword=%E5%AD%97&mode=blended", :class=>'interwiki'}, "amazon:字"]], "[[amazon:字]]")
156
+ ok_wi([:p, [:a, {:href=>"http://www.namaraii.com/hiki/hiki.cgi?%BB%FA", :class=>'interwiki'}, "hiki:字"]], "[[hiki:字]]")
157
+ ok_wi([:p, [:a, {:href=>"http://www.hyuki.com/yukiwiki/wiki.cgi?%BB%FA", :class=>'interwiki'}, "yukiwiki:字"]], "[[yukiwiki:字]]")
158
+
159
+ # test_interwiki_error
160
+ ok_wi([:p, [:span, {:class=>'interwiki'}, 'a:b']], "[[a:b]]")
161
+ ok_wi([:p, [:span, {:class=>'new'}, "\"D_R\", \"/v/w\"",
162
+ [:a, {:href=>".new?t=%22D_R%22%2C+%22%2Fv%2Fw%22"},
163
+ [:img, {:src=>'.theme/i/new.png', :alt=>'create'}]]]],
164
+ "[[\"D_R\", \"/v/w\"]]")
165
+ ok_wi([:p], "[[\"H_R\", \"h://e.c/\"]]")
166
+ end
167
+
168
+ def ok(e, w)
169
+ ok_eq(e, Qwik::Resolver.resolve(@site, @action, w))
170
+ end
171
+
172
+ def test_res
173
+ res = session
174
+
175
+ ok([[:span, {:class=>'interwiki'}, 'Test:t']],
176
+ [[:plugin, {:method=>'interwiki', :param=>'Test:t'}]])
177
+ page = @site.create('_InterWikiName')
178
+ page.store(",Test,http://example.com/?q=,sjis")
179
+ ok([[:a, {:href=>"http://example.com/?q=t",
180
+ :class=>'interwiki'}, 'Test:t']],
181
+ [[:plugin, {:method=>'interwiki', :param=>'Test:t'}]])
182
+
183
+ # test_interwiki_error
184
+ ok([],
185
+ [[:plugin, {:method=>'interwiki', :param=>"\"H_R\", \"h://e.c/\""},
186
+ '']])
187
+ end
188
+ end
189
+ end
@@ -0,0 +1,109 @@
1
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
2
+ # This is free software with ABSOLUTELY NO WARRANTY.
3
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
4
+
5
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
6
+ require 'qwik/act-search'
7
+
8
+ module Qwik
9
+ class Action
10
+
11
+ #* Incremental search
12
+ # {{isearch}}
13
+ #{{isearch}}
14
+ #You can also make incremenatl search form.
15
+
16
+ #* インクリメンタル・サーチ
17
+ # {{isearch}}
18
+ #{{isearch}}
19
+ #同様に、インクリメンタル・サーチを行う検索窓です。
20
+
21
+ # ============================== isearch
22
+ def plg_isearch(focus=false)
23
+ form = search_form(focus)
24
+ form[1][:action] = '.isearch'
25
+ return form
26
+ end
27
+
28
+ def act_isearch
29
+ query = @req.query['q']
30
+ if query.nil? || query.empty?
31
+ search_form_page
32
+ isearch_patch(@res.body)
33
+ return
34
+ end
35
+
36
+ ar = @site.isearch(query)
37
+ if ar.nil? || ar.empty?
38
+ search_notfound_page(query)
39
+ isearch_patch(@res.body)
40
+ return
41
+ end
42
+
43
+ return isearch_result(@site, ar)
44
+ end
45
+
46
+ def isearch_patch(body) # Destructive for the body
47
+ form = body.get_path('//form')
48
+ form[1][:action] = '.isearch'
49
+ end
50
+
51
+ def isearch_result(site, ar)
52
+ ul = [:ul]
53
+ ar.each {|key|
54
+ page = site[key]
55
+ url = page.url
56
+ ul << [:li, [:a, {:href=>url}, key]]
57
+ }
58
+ div = [:div, {:class=>'day'},
59
+ [:div, {:class=>'section'},
60
+ [:div, {:class=>'search_result'}, ul]]]
61
+ title = _('Search result')
62
+ return c_plain(title) { div }
63
+ end
64
+ end
65
+ end
66
+
67
+ if $0 == __FILE__
68
+ require 'qwik/test-common'
69
+ $test = true
70
+ end
71
+
72
+ if defined?($test) && $test
73
+ class TestActIncrementalSearch < Test::Unit::TestCase
74
+ include TestSession
75
+
76
+ def test_plg_isearch
77
+ ok_wi([:form, {:action=>'.isearch'},
78
+ [:input, {:name=>'q'}],
79
+ [:input, {:value=>'Search', :type=>'submit'}]],
80
+ "{{isearch}}")
81
+ end
82
+
83
+ def test_act_isearch
84
+ t_add_user
85
+
86
+ res = session '/test/.isearch'
87
+ ok_xp [:form, {:action=>'.isearch'},
88
+ [:input, {:class=>'focus', :name=>'q'}],
89
+ [:input, {:value=>'Search', :type=>'submit'}]],
90
+ '//form'
91
+
92
+ res = session "/test/.isearch?q=nosuchkey"
93
+ assert_text 'Search result', 'h1'
94
+ ok_in ['No match.'], '//h2'
95
+
96
+ page = @site.create_new
97
+ page.store 'This is a keyword.'
98
+ res = session "/test/.isearch?q=keyword"
99
+ # ok_in [:ul, [:li, [:a, {:href=>'1.html'}, '1']]],
100
+ # "//div[@class='search_result']"
101
+
102
+ page = @site.create_new # 2.txt
103
+ page.store "漢字"
104
+ res = session "/test/.isearch?q=字"
105
+ # ok_in [:ul, [:li, [:a, {:href=>'2.html'}, '2']]],
106
+ # "//div[@class='search_result']"
107
+ end
108
+ end
109
+ end