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,65 @@
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 QuickML
8
+ class MockLogger
9
+ def initialize
10
+ clear
11
+ end
12
+
13
+ def clear
14
+ @log = []
15
+ @vlog = []
16
+ end
17
+
18
+ def log(str)
19
+ @vlog << str
20
+ @log << str
21
+ end
22
+
23
+ def vlog(str)
24
+ @vlog << str
25
+ end
26
+
27
+ def get_log
28
+ lo = @log
29
+ clear
30
+ return lo
31
+ end
32
+
33
+ def get_vlog
34
+ lo = @vlog
35
+ clear
36
+ return lo
37
+ end
38
+ end
39
+ end
40
+
41
+ if $0 == __FILE__
42
+ require 'qwik/testunit'
43
+ $test = true
44
+ end
45
+
46
+ if defined?($test) && $test
47
+ class TestMockLogger < Test::Unit::TestCase
48
+ def test_all
49
+ # test_initialize
50
+ s = QuickML::MockLogger.new
51
+
52
+ # test_log
53
+ s.log('t')
54
+
55
+ # test_get_log
56
+ ok_eq(['t'], s.get_log)
57
+
58
+ # test_vlog
59
+ s.vlog('v')
60
+
61
+ # test_get_vlog
62
+ ok_eq(['v'], s.get_vlog)
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,78 @@
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
+ class MockSmtpServer
8
+ def self.open(smtp_host, smtp_port)
9
+ return self.new(smtp_host, smtp_port)
10
+ end
11
+
12
+ def initialize(smtp_host, smtp_port)
13
+ @smtp_host, @smtp_port = smtp_host, smtp_port
14
+ @buffer = []
15
+ @in_data = false
16
+ end
17
+ attr_reader :buffer # for test.
18
+
19
+ def gets
20
+ if @buffer.empty?
21
+ return '220 qwik.jp ESMTP MockSmtpServer'
22
+ end
23
+
24
+ if @in_data
25
+ if /\.\z/ =~ @buffer.last
26
+ @in_data = false
27
+ return '250 Ok: queued as 381E41683E' # The message is fake.
28
+ end
29
+ end
30
+
31
+ cmd = @buffer.last[0..3].downcase
32
+ case cmd
33
+ when 'ehlo'
34
+ return '250 example.com'
35
+ when 'mail'
36
+ return '250 ok'
37
+ when 'rcpt'
38
+ return '250 ok'
39
+ when 'data'
40
+ @in_data = true
41
+ return '354 End data with <CR><LF>.<CR><LF>'
42
+ when 'quit'
43
+ return '221 Bye'
44
+ end
45
+
46
+ return ''
47
+ end
48
+
49
+ def print(str)
50
+ str.sub!(/\r\n\z/, '')
51
+ @buffer << str
52
+ end
53
+
54
+ def close
55
+ # Do nothing.
56
+ end
57
+ end
58
+
59
+ if $0 == __FILE__
60
+ require 'qwik/testunit'
61
+ $test = true
62
+ end
63
+
64
+ if defined?($test) && $test
65
+ class TestMockSmtpServer < Test::Unit::TestCase
66
+ def test_all
67
+ # test_initialize
68
+ s = MockSmtpServer.new('localhost', '9195')
69
+
70
+ # test_gets
71
+ is '220 qwik.jp ESMTP MockSmtpServer', s.gets
72
+
73
+ # test_print
74
+ s.print('t')
75
+ is ['t'], s.buffer
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,82 @@
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/util-safe'
7
+
8
+ module QuickML
9
+ class MockSocket
10
+ include SafeGetsModule
11
+
12
+ def initialize(str = '')
13
+ require 'stringio'
14
+ @inputs = StringIO.new(str)
15
+ @buffer = []
16
+ end
17
+ attr_reader :buffer
18
+
19
+ def result
20
+ ar = []
21
+ @buffer.each {|res|
22
+ ar << res.sub(/\r\n\z/, "")
23
+ }
24
+ return ar
25
+ end
26
+
27
+ def hostname
28
+ return 'localhost'
29
+ end
30
+
31
+ def address
32
+ return '127.0.0.1'
33
+ end
34
+
35
+ def eof?
36
+ return @inputs.eof?
37
+ end
38
+
39
+ def closed?
40
+ return @inputs.eof?
41
+ end
42
+
43
+ def close
44
+ # Do nothing.
45
+ end
46
+
47
+ def print(*args)
48
+ str = args.join
49
+ @buffer << str
50
+ end
51
+
52
+ def read(len)
53
+ @inputs.read(len)
54
+ end
55
+
56
+ alias org_safe_gets safe_gets
57
+ def safe_gets
58
+ line = org_safe_gets
59
+ return nil if line.nil?
60
+ line = line.xchomp+"\r\n"
61
+ return line
62
+ end
63
+ end
64
+ end
65
+
66
+ if $0 == __FILE__
67
+ require 'qwik/testunit'
68
+ $test = true
69
+ end
70
+
71
+ if defined?($test) && $test
72
+ class TestMockSocket < Test::Unit::TestCase
73
+ def test_all
74
+ # test_initialize
75
+ s = QuickML::MockSocket.new('')
76
+
77
+ # test_print
78
+ s.print('t')
79
+ is ['t'], s.buffer
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,406 @@
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
+ # special mode for modulobe.com
6
+
7
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
8
+ require 'qwik/util-time'
9
+ require 'qwik/htree-to-wabisabi'
10
+ require 'qwik/mdlb-sample'
11
+ require 'qwik/mdlb-model'
12
+
13
+ module Qwik
14
+ class Action
15
+ def modulobe_model_link(file)
16
+ base = file.basename.to_s
17
+ return file, @req.base+'.files/'+base
18
+ end
19
+
20
+ def modulobe_image_link(file)
21
+ image_file = file.to_s.sub(/\.mdlb\z/, '.gif').path
22
+ base = file.basename('.mdlb').to_s+'.gif'
23
+ return image_file, @req.base+'.files/'+base
24
+ end
25
+
26
+ def modulobe_thumb_link(file)
27
+ base = file.basename('.mdlb').to_s+'.gif'
28
+ thumb_file = file.dirname+'.thumb'+base
29
+ return thumb_file, @req.base+'.files/.thumb/'+base
30
+ end
31
+ end
32
+ end
33
+
34
+ module Modulobe
35
+ class ModelList
36
+ def initialize(files)
37
+ @files = files
38
+ @models = {}
39
+ @days = nil
40
+ @timeline = nil
41
+ @last_time = nil
42
+ end
43
+
44
+ def empty?
45
+ get_all_models
46
+ return @models.empty?
47
+ end
48
+
49
+ def get_all_models
50
+ @files.each {|basename|
51
+ next unless /\.mdlb\z/ =~ basename
52
+ if @models[basename].nil?
53
+ file = @files.path(basename)
54
+ model = ModelFile.new(file)
55
+ model.get_internal_info
56
+ @models[basename] = model
57
+ end
58
+ }
59
+ end
60
+ #private :get_all_models
61
+
62
+ def prepare_timeline
63
+ @timeline = @models.values.sort_by {|model|
64
+ model.mtime
65
+ }
66
+ return if @timeline.last.nil?
67
+ @last_time = @timeline.last.mtime
68
+
69
+ @days = Hash.new {|h, k| h[k] = []}
70
+ @timeline.reverse.each {|model|
71
+ if model
72
+ @days[model.mtime.ymd] << model
73
+ end
74
+ }
75
+ end
76
+
77
+ def get_table(action, path)
78
+ get_all_models # @models are cached.
79
+ prepare_timeline if @timeline.nil?
80
+
81
+ trs = []
82
+ @days.to_a.sort_by {|ymd, models|
83
+ ymd
84
+ }.reverse.each {|ymd, models|
85
+ trs << [:tr, {:class=>'day'}, [:th, {:colspan=>'3'}, ymd]]
86
+ models.each {|model|
87
+ trs << model.create_entry(action, path)
88
+ }
89
+ }
90
+ table = [:table, {:class=>'model'}, *trs]
91
+ div = [:div, {:class=>'model'}, table]
92
+ return div
93
+ end
94
+
95
+ def get_style
96
+ return [:style, '
97
+ /* ==================== model */
98
+ div.model {
99
+ margin: 1em 0;
100
+ padding: 10px;
101
+ border: 0;
102
+ background-color: #fff;
103
+ }
104
+
105
+ table.model {
106
+ margin: 0;
107
+ width: 100%;
108
+ border: 0;
109
+ }
110
+
111
+ tr.day th {
112
+ padding: 15px 0 0 0;
113
+ border-top: 0;
114
+ border-right: 0;
115
+ border-bottom: 0;
116
+ border-left: 0;
117
+ color: #0c0;
118
+ background-color: transparent;
119
+ }
120
+
121
+ tr.model td {
122
+ margin: 0;
123
+ padding: 0;
124
+ border: 1px solid #f30;
125
+ border: 0;
126
+ line-height: 1.0;
127
+ }
128
+
129
+ tr.model td img {
130
+ margin: 10px 10px 0 10px;
131
+ border: 0;
132
+ border-bottom: 0;
133
+ }
134
+
135
+ tr.model td a {
136
+ border: 0;
137
+ }
138
+
139
+ tr.model td div {
140
+ margin: 0;
141
+ padding: 0;
142
+ }
143
+
144
+ tr.model td div.author {
145
+ font-size: small;
146
+ }
147
+
148
+ tr.model td div.name {
149
+ margin: 0 0 0 0;
150
+ font-size: medium;
151
+ font-weight: bold;
152
+ }
153
+
154
+ tr.model td div.name a {
155
+ text-decoration: underline;
156
+ }
157
+
158
+ tr.model td pre {
159
+ margin: 0;
160
+ padding: 0;
161
+ border: 0;
162
+ line-height: 1.0;
163
+ background-color: transparent;
164
+ }
165
+ ']
166
+ end
167
+
168
+ def get_rss(action, base)
169
+ get_all_models # @models are cached.
170
+ prepare_timeline if @timeline.nil?
171
+
172
+ xml = []
173
+ xml << [:'?xml', '1.0', 'utf-8']
174
+
175
+ rss = [:rss, {:version=>'2.0', :'xmlns:creativeCommons'=>
176
+ 'http://backend.userland.com/creativeCommonsRssModule'}]
177
+ xml << rss
178
+
179
+ channel = [:channel,
180
+ [:title, 'Modulobe model gallery'],
181
+ [:link, 'http://wiki.modulobe.com/'],
182
+ [:description, 'The model list of Modulobe Wiki site.'],
183
+ [:language, 'ja'],
184
+ [:managingEditor, 'modulobe@qwik.jp'],
185
+ [:webMaster, 'modulobe@qwik.jp']]
186
+ rss << channel
187
+ channel << [:lastBuildDate, @last_time.rfc1123_date]
188
+ channel << [:ttl, '60']
189
+
190
+ @timeline.each {|model|
191
+ item = model.create_rss_item(action, base)
192
+ channel << item
193
+ }
194
+
195
+ return xml
196
+ end
197
+ end
198
+
199
+ class ModelFile
200
+ def initialize(file)
201
+ @file = file
202
+ @mtime = @file.mtime
203
+ @length = @file.size
204
+ @image_file = @file.to_s.sub(/\.mdlb\z/, '.gif').path
205
+ @name = @author = @comment = nil
206
+ end
207
+ attr_reader :file, :mtime
208
+ attr_reader :length # for debug
209
+ attr_reader :image_file # for debug
210
+ attr_reader :name, :author, :comment
211
+
212
+ def get_internal_info
213
+ if @name.nil?
214
+ content = @file.read
215
+ @name, @author, @comment = extract_info(content)
216
+ end
217
+ return @name, @author, @comment
218
+ end
219
+
220
+ def extract_info(str)
221
+ htree = HTree(str)
222
+ wabisabi = htree.to_wabisabi
223
+ info = wabisabi.get_path('//model/info')
224
+ return [nil, nil, nil] unless info
225
+ name = info.get_path('/name').text.set_xml_charset.to_page_charset
226
+ author = info.get_path('/author').text.set_xml_charset.to_page_charset
227
+ comment = info.get_path('/comment').text.set_xml_charset.to_page_charset
228
+ return [name, author, comment]
229
+ end
230
+
231
+ def prepare_metadata
232
+ name = @name || @file.basename('.mdlb').to_s
233
+ author = @author || 'anonymous'
234
+ comment = @comment || ''
235
+ return [name, author, comment]
236
+ end
237
+
238
+ # wget http://wiki.modulobe.com/model.mdlbrss
239
+ # http://colinux:9190/modulobewiki/model.html
240
+ # wget http://colinux:9190/modulobewiki/model.mdlbrss
241
+ def prepare_link(action, path)
242
+ # base = @file.basename('.mdlb').to_s
243
+ # href = path+'/'+base+'.mdlb'
244
+
245
+ model_file, model_relative = action.modulobe_model_link(@file)
246
+ model_absolute = action.c_relative_to_root(model_relative)
247
+ model_full = action.c_relative_to_absolute(model_relative)
248
+
249
+ image_file, image_relative = action.modulobe_image_link(@file)
250
+
251
+ if image_file.exist?
252
+ thumb_file, thumb_relative = action.modulobe_thumb_link(@file)
253
+ if ! thumb_file.exist?
254
+ action.thumb_generate(image_file.basename.to_s)
255
+ end
256
+ img = [:img, {:src=>thumb_relative}]
257
+ else
258
+ img = [:img, {:width=>'100', :height=>'75', :src=>'model.files/x.gif'}]
259
+ end
260
+ img = [:a, {:href=>model_relative}, img]
261
+
262
+ return [model_relative, model_full, img]
263
+ end
264
+
265
+ def create_entry(action, path)
266
+ href, url, img = prepare_link(action, path)
267
+ name, author, comment = prepare_metadata
268
+ tr = [:tr, {:class=>'model'},
269
+ [:td, img],
270
+ [:td, [:div, {:class=>'author'}, author],
271
+ [:div, {:class=>'name'}, [:a, {:href=>href}, name]],
272
+ [:pre, {:class=>'comment'}, comment]]]
273
+ return tr
274
+ end
275
+
276
+ def create_model_entry(action, path)
277
+ href, url, img = prepare_link(action, path)
278
+ name, author, comment = prepare_metadata
279
+ return img
280
+ end
281
+
282
+ # http://colinux:9190/modulobewiki/model.mdlbrss
283
+ # http://wiki.modulobe.com/model.mdlbrss
284
+ def create_rss_item(action, path)
285
+ href, url, img = prepare_link(action, path)
286
+ name, author, comment = prepare_metadata
287
+ item = [:item]
288
+ item << [:title, name]
289
+ item << [:link, url]
290
+
291
+ src = img[2][1][:src]
292
+ imgsrc = action.c_relative_to_absolute(src)
293
+ html = "<p><img src=\"#{imgsrc}\" alt=\"#{name}\" width=\"100\" height=\"75\"/><br/>#{comment}</p>"
294
+ item << [:description, html]
295
+
296
+ item << [:author, author]
297
+ item << [:pubDate, @mtime.rfc1123_date]
298
+ item << [:enclosure,
299
+ {:url=>url, :length=>@length, :type=>'application/xml'}]
300
+ item << [:'creativeCommons:license',
301
+ 'http://creativecommons.org/licenses/by-sa/2.5/deed.ja']
302
+ return item
303
+ end
304
+ end
305
+ end
306
+
307
+ if $0 == __FILE__
308
+ require 'qwik/test-common'
309
+ $test = true
310
+ end
311
+
312
+ if defined?($test) && $test
313
+ class TestModulobeModel < Test::Unit::TestCase
314
+ include TestSession
315
+ include Modulobe::Sample
316
+
317
+ def test_all
318
+ t_add_user
319
+
320
+ page = @site['_SiteConfig']
321
+ page.store(':siteurl:http://wiki.example.com/')
322
+
323
+ page = @site.create('c')
324
+ page.store('')
325
+ files = @site.files('c')
326
+
327
+ files.put('test1.mdlb', MODULOBE_TEST_MODEL1, nil, 0)
328
+ files.put('test1.gif', TEST_PNG_DATA, nil, 1)
329
+ file = files.path('test1.mdlb')
330
+
331
+ # test_create_model
332
+ model = Modulobe::ModelFile.new(file)
333
+ ok_eq('.test/data/test/c.files/test1.mdlb', model.file.to_s)
334
+ ok_eq(Time.at(0), model.mtime)
335
+ ok_eq(563, model.length)
336
+ ok_eq('.test/data/test/c.files/test1.gif', model.image_file.to_s)
337
+
338
+ # test_internal_info
339
+ ok_eq(nil, model.name)
340
+
341
+ # test_prepare_metadata
342
+ name, author, comment = model.prepare_metadata
343
+ ok_eq('test1', name)
344
+ ok_eq('anonymous', author)
345
+ ok_eq('', comment)
346
+
347
+ # test_get_internal_info
348
+ name, author, comment = model.get_internal_info
349
+ ok_eq('t1 model', name)
350
+ ok_eq('Alice', author)
351
+ ok_eq('This is a comment.
352
+ ', comment)
353
+
354
+ session('/test/c.html') # for create @action
355
+
356
+ # test_modulobe_model_link
357
+ file, relative = @action.modulobe_model_link(model.file)
358
+ ok_eq('c.files/test1.mdlb', relative)
359
+ ok_eq('/c.files/test1.mdlb',
360
+ @action.c_relative_to_root(relative))
361
+ ok_eq('http://wiki.example.com/c.files/test1.mdlb',
362
+ @action.c_relative_to_absolute(relative))
363
+
364
+ # test_modulobe_image_link
365
+ file, relative = @action.modulobe_image_link(model.file)
366
+ ok_eq('.test/data/test/c.files/test1.gif', file.to_s)
367
+ ok_eq('c.files/test1.gif', relative)
368
+
369
+ # test_modulobe_thumb_link
370
+ file, relative = @action.modulobe_thumb_link(model.file)
371
+ ok_eq('.test/data/test/c.files/.thumb/test1.gif', file.to_s)
372
+ ok_eq('c.files/.thumb/test1.gif', relative)
373
+
374
+ path = 'c.files'
375
+ ok_eq([:tr, {:class=>'model'},
376
+ [:td,
377
+ [:a, {:href=>'c.files/test1.mdlb'},
378
+ [:img, {:src=>'c.files/.thumb/test1.gif'}]]],
379
+ [:td,
380
+ [:div, {:class=>'author'}, 'Alice'],
381
+ [:div, {:class=>'name'},
382
+ [:a, {:href=>'c.files/test1.mdlb'}, 't1 model']],
383
+ [:pre, {:class=>'comment'}, 'This is a comment.
384
+ ']]],
385
+ model.create_entry(@action, path))
386
+
387
+ ok_eq([:a, {:href=>'c.files/test1.mdlb'},
388
+ [:img, {:src=>'c.files/.thumb/test1.gif'}]],
389
+ model.create_model_entry(@action, path))
390
+
391
+ ok_eq([:item,
392
+ [:title, 't1 model'],
393
+ [:link, 'http://wiki.example.com/c.files/test1.mdlb'],
394
+ [:description,
395
+ "<p><img src=\"http://wiki.example.com/c.files/.thumb/test1.gif\" alt=\"t1 model\" width=\"100\" height=\"75\"/><br/>This is a comment.\n</p>"],
396
+ [:author, 'Alice'],
397
+ [:pubDate, 'Thu, 01 Jan 1970 09:00:00 GMT'],
398
+ [:enclosure,
399
+ {:length=>563, :type=>'application/xml',
400
+ :url=>'http://wiki.example.com/c.files/test1.mdlb'}],
401
+ [:'creativeCommons:license',
402
+ 'http://creativecommons.org/licenses/by-sa/2.5/deed.ja']],
403
+ model.create_rss_item(@action, path))
404
+ end
405
+ end
406
+ end
@@ -0,0 +1,72 @@
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
+ # Under construction.
6
+
7
+ require 'mongrel'
8
+
9
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
10
+ require 'qwik/config'
11
+ require 'qwik/server'
12
+
13
+ module Qwik
14
+ class MongrelServer < Server
15
+ def initialize(qconfig)
16
+ @qconfig = qconfig
17
+ @memory = ServerMemory.new(@qconfig)
18
+
19
+ # init_trap
20
+ trap(:TERM) { shutdown; }
21
+ trap(:INT) { shutdown; }
22
+ if Signal.list.key?("HUP")
23
+ trap(:HUP) { reopen; }
24
+ end
25
+
26
+ init_directory(@qconfig)
27
+ end
28
+
29
+ def start
30
+ bind_address = config.bind_address
31
+ port = config.web_port
32
+
33
+ h = Mongrel::HttpServer.new(bind_address, port)
34
+ h.register('/', MongrelHandler.new)
35
+ start_server
36
+ h.run.join
37
+ end
38
+ end
39
+
40
+ class MongrelHandler < Mongrel::HttpHandler
41
+ def process(request, response)
42
+ response.socket.write("HTTP/1.1 200 OK\r
43
+ Content-Type: text/plain\r
44
+ \r
45
+ hello!
46
+ ")
47
+
48
+ config = @server[:QwikConfig]
49
+ memory = @server[:QwikMemory]
50
+
51
+ req = Request.new(config)
52
+ req.parse_webrick(request)
53
+
54
+ res = Response.new(config)
55
+ res.set_webrick(response)
56
+
57
+ action = Action.new
58
+ action.init(config, memory, req, res)
59
+ action.run
60
+
61
+ res.setback(response)
62
+
63
+ qlog = memory[:qwik_access_log]
64
+ qlog.log(request, response, req, res) if qlog # Take a log.
65
+
66
+ if res.basicauth
67
+ proc = res.basicauth
68
+ WEBrick::HTTPAuth::basic_auth(request, response, 'qwik', &proc)
69
+ end
70
+ end
71
+ end
72
+ end