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,112 @@
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/test-module-server'
7
+
8
+ if $0 == __FILE__
9
+ $test = true
10
+ end
11
+
12
+ module TestMonitorModule
13
+ include TestServerSetupModule
14
+ include TestServerModule
15
+
16
+ def setup_monitor
17
+ Thread.abort_on_exception = true
18
+
19
+ server, config, memory, wreq, wres = setup_server
20
+ server_thread = Thread.new { server.start }
21
+
22
+ write_page('_SiteMember', ",user@e.com\n")
23
+ write_page('1', "*t\np")
24
+
25
+ return server
26
+ end
27
+ end
28
+
29
+ if defined?($test) && $test
30
+ class CheckActMonitor < Test::Unit::TestCase
31
+ include TestMonitorModule
32
+
33
+ # http://colinux:9190/HelloQwik/ActMonitor.html
34
+ def test_act_monitor
35
+ return if $0 != __FILE__ # Only for unit test.
36
+
37
+ server = setup_monitor
38
+
39
+ str = get_path('1.html')
40
+ ok_in(['t'], '//title', str)
41
+ ok_in([:p, 'p'], "//div[@class='section']", str)
42
+
43
+ t = Thread.new {
44
+ sleep 0.1
45
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
46
+ ok_in(['Page is saved.'], '//title', str)
47
+ ok_eq("*t2\np2", read_page('1'))
48
+ }
49
+
50
+ str = get_path('1.monitor') # Wait for update.
51
+ ok_in([:p, 'p2'], "//div[@class='section']", str)
52
+
53
+ t.join # Wait for the thread.
54
+
55
+ teardown_server(server)
56
+ end
57
+
58
+ def test_monitor_in_thread
59
+ return if $0 != __FILE__ # Only for unit test.
60
+
61
+ server = setup_monitor
62
+
63
+ str = get_path('1.html')
64
+ ok_in(['t'], '//title', str)
65
+ ok_in([:p, 'p'], "//div[@class='section']", str)
66
+
67
+ t = Thread.new {
68
+ str = get_path('1.monitor') # Wait for update.
69
+ ok_in([:p, 'p2'], "//div[@class='section']", str)
70
+ }
71
+
72
+ sleep 0.1
73
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
74
+ ok_in(['Page is saved.'], '//title', str)
75
+ ok_eq("*t2\np2", read_page('1'))
76
+
77
+ t.join # Wait for the thread.
78
+
79
+ teardown_server(server)
80
+ end
81
+
82
+ def test_several_monitors
83
+ return if $0 != __FILE__ # Only for unit test.
84
+
85
+ server = setup_monitor
86
+
87
+ str = get_path('1.html')
88
+ ok_in(['t'], '//title', str)
89
+ ok_in([:p, 'p'], "//div[@class='section']", str)
90
+
91
+ t1 = Thread.new {
92
+ str1 = get_path('1.monitor') # Wait for update.
93
+ ok_in([:p, 'p2'], "//div[@class='section']", str1)
94
+ }
95
+
96
+ t2 = Thread.new {
97
+ str2 = get_path('1.monitor') # Wait for update.
98
+ ok_in([:p, 'p2'], "//div[@class='section']", str2)
99
+ }
100
+
101
+ sleep 0.1
102
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
103
+ ok_in(['Page is saved.'], '//title', str)
104
+ ok_eq("*t2\np2", read_page('1'))
105
+
106
+ t1.join # Wait for the thread.
107
+ t2.join # Wait for the thread.
108
+
109
+ teardown_server(server)
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,46 @@
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/check-act-monitor'
7
+
8
+ if $0 == __FILE__
9
+ require 'qwik/server'
10
+ $test = true
11
+ end
12
+
13
+ if defined?($test) && $test
14
+ class CheckActMonitor2 < Test::Unit::TestCase
15
+ include TestMonitorModule
16
+
17
+ def test_many_monitors
18
+ return if $0 != __FILE__ # Only for unit test.
19
+
20
+ server = setup_monitor
21
+
22
+ ts = []
23
+ res = []
24
+ max = 15 # OK.
25
+ #max = 10 # Not OK.
26
+ (0..max).each {|i|
27
+ ts[i] = Thread.new {
28
+ res[i] = get_path('1.monitor') # Wait for update.
29
+ p res[i]
30
+ #ok_in([:p, 'p2'], "//div[@class='section']", res[i])
31
+ }
32
+ }
33
+
34
+ sleep 0.1
35
+ str = get_path('1.save?contents=*t2%0Ap2') # Save to the page.
36
+ ok_in(['Page is saved.'], '//title', str)
37
+ ok_eq("*t2\np2", read_page('1'))
38
+
39
+ (0..max).each {|i|
40
+ ts[i].join # Wait for the thread.
41
+ }
42
+
43
+ teardown_server(server)
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,27 @@
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/test-common'
7
+ require 'qwik/act-theme'
8
+
9
+ class CheckExternalCss < Test::Unit::TestCase
10
+ include TestSession
11
+
12
+ def test_all
13
+ return if $0 != __FILE__ # Only for separated test.
14
+
15
+ # test_extcss_nosuch
16
+ res = session '/.css/http://nosuchhostname/q.css'
17
+ ok_title 'Access Failed'
18
+
19
+ # test_extcss_hatena
20
+ res = session '/.css/http://d.hatena.ne.jp/theme/clover/clover.css'
21
+ if @res.body.is_a?(Array)
22
+ ok_title 'Access Failed'
23
+ else
24
+ #eq true, 1000 < @res.body.length
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,112 @@
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/test-module-server'
7
+
8
+ if $0 == __FILE__
9
+ $test = true
10
+ end
11
+
12
+ module CheckEventModule
13
+ include TestServerSetupModule
14
+ include TestServerModule
15
+
16
+ def setup_event
17
+ Thread.abort_on_exception = true
18
+
19
+ server, config, memory, wreq, wres = setup_server
20
+ server_thread = Thread.new { server.start }
21
+
22
+ write_page('_SiteMember', ",user@e.com\n")
23
+ write_page('1', "*t\np")
24
+
25
+ return server
26
+ end
27
+ end
28
+
29
+ if defined?($test) && $test
30
+ class CheckEvent < Test::Unit::TestCase
31
+ include CheckEventModule
32
+
33
+ # http://colinux:9190/HelloQwik/ActMonitor.html
34
+ def test_1
35
+ return if $0 != __FILE__ # Only for unit test.
36
+
37
+ server = setup_event
38
+
39
+ str = get_path('1.html')
40
+ ok_in(['t'], '//title', str)
41
+ ok_in([:p, 'p'], "//div[@class='section']", str)
42
+
43
+ t = Thread.new {
44
+ sleep 0.1
45
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
46
+ ok_in(['Page is saved.'], '//title', str)
47
+ ok_eq("*t2\np2", read_page('1'))
48
+ }
49
+
50
+ str = get_path('1.event') # Wait for update.
51
+ #ok_eq(",0,user@e.com,1,save,save\n", str)
52
+ #ok_in([:p, 'p2'], "//div[@class='section']", str)
53
+
54
+ t.join # Wait for the thread.
55
+
56
+ teardown_server(server)
57
+ end
58
+
59
+ def test_2
60
+ return if $0 != __FILE__ # Only for unit test.
61
+
62
+ server = setup_event
63
+
64
+ str = get_path('1.html')
65
+ ok_in(['t'], '//title', str)
66
+ ok_in([:p, 'p'], "//div[@class='section']", str)
67
+
68
+ t = Thread.new {
69
+ str = get_path('1.event') # Wait for update.
70
+ ok_eq(",0,user@e.com,1,save,save\n", str)
71
+ }
72
+
73
+ sleep 0.1
74
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
75
+ ok_in(['Page is saved.'], '//title', str)
76
+ ok_eq("*t2\np2", read_page('1'))
77
+
78
+ t.join # Wait for the thread.
79
+
80
+ teardown_server(server)
81
+ end
82
+
83
+ def test_3
84
+ return if $0 != __FILE__ # Only for unit test.
85
+
86
+ server = setup_event
87
+
88
+ str = get_path('1.html')
89
+ ok_in(['t'], '//title', str)
90
+ ok_in([:p, 'p'], "//div[@class='section']", str)
91
+
92
+ t1 = Thread.new {
93
+ str1 = get_path('1.event') # Wait for update.
94
+ ok_eq(",0,user@e.com,1,save,save\n", str1)
95
+ }
96
+ t2 = Thread.new {
97
+ str2 = get_path('1.event') # Wait for update.
98
+ ok_eq(",0,user@e.com,1,save,save\n", str2)
99
+ }
100
+
101
+ sleep 0.1
102
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
103
+ ok_in(['Page is saved.'], '//title', str)
104
+ ok_eq("*t2\np2", read_page('1'))
105
+
106
+ t1.join # Wait for the thread.
107
+ t2.join # Wait for the thread.
108
+
109
+ teardown_server(server)
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,55 @@
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/check-event'
7
+
8
+ if $0 == __FILE__
9
+ $test = true
10
+ end
11
+
12
+ if defined?($test) && $test
13
+ class CheckEvent2 < Test::Unit::TestCase
14
+ include CheckEventModule
15
+
16
+ def test_many
17
+ return if $0 != __FILE__ # Only for unit test.
18
+
19
+ server = setup_event
20
+
21
+ ts = []
22
+ res = []
23
+ max = 15 # OK.
24
+ #max = 10 # Not OK.
25
+ (0..max).each {|i|
26
+ ts[i] = Thread.new {
27
+ res[i] = get_path('1.event') # Wait for update.
28
+ #ok_in([:p, 'p2'], "//div[@class='section']", res[i])
29
+ }
30
+ }
31
+
32
+ loop {
33
+ str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
34
+ ok_in(['Page is saved.'], '//title', str)
35
+ ok_eq("*t2\np2", read_page('1'))
36
+
37
+ sleep 0.1
38
+
39
+ endok = true
40
+ (0..max).each {|i|
41
+ if ts[i].status != false
42
+ endok = false
43
+ end
44
+ }
45
+ break if endok
46
+ }
47
+
48
+ (0..max).each {|i|
49
+ ts[i].join # Wait for the thread.
50
+ }
51
+
52
+ teardown_server(server)
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,77 @@
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 'htree'
7
+
8
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
9
+ require 'qwik/testunit'
10
+
11
+ class CheckHTree < Test::Unit::TestCase
12
+ def test_htree_to_rexml
13
+ str = '<p>あ</p>'
14
+ ok_eq("\202\240", 'あ') # Kanji code is SJIS.
15
+ h = HTree(str)
16
+
17
+ x = ''
18
+ h.display_xml(x)
19
+ ok_eq("<p\n>\202\240</p\n>", x)
20
+
21
+ r = h.to_rexml
22
+ ok_eq("<p>\202\240</p>", r.to_s)
23
+ #ok_eq(" <p>\202\240</p>", r.to_s(1))
24
+
25
+ html = <<'EOT'
26
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head id='header'><title>新規作成</title><link href="/.theme/base.css" rel='stylesheet' media="screen,tv" type="text/css"/><link href="/.theme/qwiksystem/qwiksystem.css" rel='stylesheet' media="screen,tv" type="text/css"/><meta name='ROBOTS' content="NOINDEX,NOFOLLOW"/><meta content="0; url=FirstPage.edit" http-equiv='Refresh'/></head><body><div class='container'><div class='header'><div><div><h1 id="view_title">新規作成</h1></div></div></div><div class="update day"><div class='form'><div class='msg' id='msg'><h2>新規作成</h2><p>新規ページを作成しました</p><p><a href="FirstPage.edit">新規ページを編集</a>してください。</p><p><a href="FirstPage.edit">FirstPage.edit</a></p></div></div></div><div class="update day"><div class='comment'></div></div></div></body></html>
27
+ EOT
28
+ h = HTree(html)
29
+ r = h.to_rexml
30
+ e = <<'EOT'
31
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html xmlns='http://www.w3.org/1999/xhtml'><head id='header'><title>新規作成</title><link href='/.theme/base.css' rel='stylesheet' type='text/css' media='screen,tv'/><link href='/.theme/qwiksystem/qwiksystem.css' rel='stylesheet' type='text/css' media='screen,tv'/><meta name='ROBOTS' content='NOINDEX,NOFOLLOW'/><meta content='0; url=FirstPage.edit' http-equiv='Refresh'/></head><body><div class='container'><div class='header'><div><div><h1 id='view_title'>新規作成</h1></div></div></div><div class='update day'><div class='form'><div class='msg' id='msg'><h2>新規作成</h2><p>新規ページを作成しました</p><p><a href='FirstPage.edit'>新規ページを編集</a>してください。</p><p><a href='FirstPage.edit'>FirstPage.edit</a></p></div></div></div><div class='update day'><div class='comment'/></div></div></body></html>
32
+ EOT
33
+ ok_eq(e, r.to_s)
34
+
35
+ e = <<'EOT'
36
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
37
+ <html xmlns='http://www.w3.org/1999/xhtml'>
38
+ <head id='header'>
39
+ <title>新規作成</title>
40
+ <link href='/.theme/base.css' rel='stylesheet' type='text/css' media='screen,tv'/>
41
+ <link href='/.theme/qwiksystem/qwiksystem.css' rel='stylesheet' type='text/css' media='screen,tv'/>
42
+ <meta name='ROBOTS' content='NOINDEX,NOFOLLOW'/>
43
+ <meta content='0; url=FirstPage.edit' http-equiv='Refresh'/>
44
+ </head>
45
+ <body>
46
+ <div class='container'>
47
+ <div class='header'>
48
+ <div>
49
+ <div>
50
+ <h1 id='view_title'>新規作成</h1>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <div class='update day'>
55
+ <div class='form'>
56
+ <div class='msg' id='msg'>
57
+ <h2>新規作成</h2>
58
+ <p>新規ページを作成しました</p>
59
+ <p>
60
+ <a href='FirstPage.edit'>新規ページを編集</a>してください。</p>
61
+ <p>
62
+ <a href='FirstPage.edit'>FirstPage.edit</a>
63
+ </p>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ <div class='update day'>
68
+ <div class='comment'/>
69
+ </div>
70
+ </div>
71
+ </body>
72
+ </html>
73
+
74
+ EOT
75
+ #ok_eq(e, r.to_s(0))
76
+ end
77
+ end
@@ -0,0 +1,51 @@
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 'htree'
7
+
8
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
9
+ require 'qwik/testunit'
10
+
11
+ class CheckHTree < Test::Unit::TestCase
12
+ def assert_xhtml(expected, template, message=nil) # from htree/test
13
+ prefix = "<html\n>"
14
+ suffix = "</html\n>"
15
+ result = HTree.expand_template(''){"<html>#{template}</html>"}
16
+ assert_match(/\A#{Regexp.quote prefix}/, result)
17
+ assert_match(/#{Regexp.quote suffix}\z/, result)
18
+ result = result[prefix.length..(-suffix.length-1)]
19
+ ok_eq(expected, result, message)
20
+ end
21
+
22
+ def test_htree
23
+ return # do not test.
24
+
25
+ assert_xhtml("<b\n>t</b\n>", '<b>t</b>')
26
+ assert_xhtml("<e\n>1</e\n>", '<e _text=1>d</e>')
27
+ str = '<html><e _text=1>d</e></html>'
28
+
29
+ doc = HTree(str) # doc is a template
30
+ assert_instance_of(HTree::Doc, doc)
31
+ assert_instance_of(HTree::Elem, doc.root)
32
+ ok_eq('{http://www.w3.org/1999/xhtml}html', doc.root.name)
33
+ assert_instance_of(HTree::Elem, doc.root.children[0])
34
+ assert_instance_of(HTree::Elem, doc.root.children[0])
35
+ assert_instance_of(HTree::Text, doc.root.children[0].children[0])
36
+ assert_instance_of(String, doc.root.children[0].children[0].rcdata)
37
+ ok_eq('d', doc.root.children[0].children[0].rcdata)
38
+
39
+ doc = HTree{str} # doc is a document. the template is evaluated.
40
+ assert_instance_of(HTree::Doc, doc)
41
+ assert_instance_of(HTree::Elem, doc.root)
42
+ assert_instance_of(HTree::Elem, doc.root.children[0])
43
+ assert_instance_of(HTree::Text, doc.root.children[0].children[0])
44
+ ok_eq('1', doc.root.children[0].children[0].rcdata)
45
+
46
+ str = "<html>\n <body _text=\"body\"></body>\n</html>"
47
+ body = 'b'
48
+ result = HTree.expand_template(''){str}
49
+ ok_eq("<html\n><body\n>b</body\n></html\n>", result)
50
+ end
51
+ end
@@ -0,0 +1,135 @@
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/test-common'
7
+
8
+ begin
9
+ require 'xml/libxml'
10
+ $have_libxml_so = true
11
+ rescue LoadError
12
+ $have_libxml_so = false
13
+ end
14
+
15
+ if $0 == __FILE__
16
+ $test = true
17
+ end
18
+
19
+ class TestLibXml < Test::Unit::TestCase
20
+ def test_parser
21
+ str = <<'EOT'
22
+ <html><head id='header'><title>FrontPage - example.com/test</title><link href="/.theme/qwikgreen/qwikgreen.css" rel='stylesheet' media="screen,tv,print" type="text/css"/><link href="/.theme/base.css" rel='stylesheet' media="screen,tv,print" type="text/css"/></head><body><div class='container'><div class='main'><div class='adminmenu' id='adminmenu'><p><span class='loginstatus'>user | <em>user@e.com</em> (<a href=".logout">.logout</a>)</span></p>
23
+ <ul><li><a href=".new">新規作成</a></li>
24
+ <li><a href="FrontPage.edit">編集</a></li>
25
+ </ul>
26
+ </div><h1 id="view_title">FrontPage</h1><div id='body'><div class='day'><h2>FrontPage</h2><div class='body'><div class='section'>
27
+ <p>これは新規qwikWebサイトの入口となるページです。</p>
28
+ <h3>使い方</h3>
29
+ <p>ページの上の方にある「編集」というリンクをたどると、このページの編集モードになります。</p>
30
+ <p>表示されたテキストの内容を変更し、「Save」ボタンをクリックすると、このページの内容が変更されます。</p>
31
+ <h3>記述方法</h3>
32
+ <p>ページの内容はテキストで書かれており、いくつかの記号によって見出しなどの指定をします。詳しい情報は、<a href="/test/TextFormat.html">TextFormat</a>をご覧下さい。</p>
33
+ <h3>qwikWeb</h3>
34
+ <p>詳しくは、<a href="http://example.com/" class='external'>qwikWeb</a>ホームページをご覧ください。</p>
35
+ <h3>QuickML</h3>
36
+ <p>メーリングリスト機能の使い方は、<a href="http://www.quickml.com/" class='external'>QuickML</a>ホームページをご覧ください。</p>
37
+ </div></div></div></div><div id="body_leave"><div class='day'><div class='comment'><div class='caption'><div class="page_attribute"><p><div class='qrcode'><a href="http://example.com/test/" class='external'><img src=".attach/qrcode-test.png" alt="http://example.com/test/"/><br/>http://example.com/test/</a></div><div>last modified: 2004-05-20</div></p>
38
+ </div></div></div><div class="body_leave"></div></div></div></div><div class='sidebar' id='sidemenu'><h2>menu</h2>
39
+ <ul><li><a href="/test/FrontPage.html">FrontPage</a></li>
40
+ <li><a href="/test/TitleList.html">TitleList</a></li>
41
+ <li><a href="/test/RecentList.html">RecentList</a></li>
42
+ <li><a href="/test/TextFormat.html">TextFormat</a></li>
43
+ <li><a href="/test/_SiteMenu.html">_SiteMenu</a></li>
44
+ </ul>
45
+ <h2>recent change</h2>
46
+ <p><h3>2004-09-09</h3>
47
+ <ul><li><a href="/test/_SiteMember.html">_SiteMember</a></li>
48
+ </ul>
49
+ </p>
50
+ </div><div class='footer' id='footer'><p>powered by <a href="http://example.com/" class='external'>qwikWeb</a></p>
51
+ </div></div></body></html>
52
+ EOT
53
+
54
+ if $have_libxml_so
55
+ ok_eq('2.6.11', XML::Parser::LIBXML_VERSION)
56
+ ok_eq(28, XML::Parser::VERNUM)
57
+ xp = XML::Parser.new
58
+ xp.string = str.page_to_xml
59
+ doc = xp.parse
60
+ assert_instance_of(XML::Document, doc)
61
+ e = nil
62
+ doc.find('//a'){|ee|
63
+ e = ee
64
+ }
65
+ end
66
+ end
67
+
68
+ def test_text
69
+ if $have_libxml_so
70
+ xp = XML::Parser.new
71
+ xp.string = '<html><p><b>a</b></p></html>'
72
+ doc = xp.parse
73
+ assert_instance_of(XML::Document, doc)
74
+ e = nil
75
+ doc.find('//title'){|e|
76
+ e = ee
77
+ }
78
+ end
79
+ end
80
+ end
81
+
82
+ class TestAssertXPath < Test::Unit::TestCase
83
+ include TestSession
84
+
85
+ def test_ok_xp
86
+ t_add_user
87
+ session('/test/')
88
+ ok_in(['FrontPage'], '//h1')
89
+ ok_xp([:a, {:href=>'.logout'}, 'Logout'], '//a')
90
+ ok_in(['Logout'], '//a')
91
+ end
92
+ end
93
+
94
+ class CheckLibXml_OriginalTest < Test::Unit::TestCase
95
+ def make_sample_xml
96
+ str = "<nodes>\n"
97
+ 10000.times {|i|
98
+ str << '<node sum="1" avg="'+i.to_s+'">Node sample text</node>'+"\n"
99
+ }
100
+ str << "</nodes>\n"
101
+ str
102
+ end
103
+
104
+ def nutest_rexml #9.851 seconds.
105
+ require 'rexml/document'
106
+ xmlStr = make_sample_xml
107
+ doc = REXML::Document.new xmlStr
108
+ sum = avgSum = count = 0
109
+ doc.elements.each('/nodes/node') { |e|
110
+ count += 1
111
+ sum += e.attributes['sum'].to_i
112
+ avgSum += e.attributes['avg'].to_i
113
+ }
114
+ puts "count(node): #{count}, sum(sum): #{sum}, avg(avg): #{avgSum/count}"
115
+ end
116
+
117
+ def nutest_libxml #4.685 seconds
118
+ require 'xml/libxml'
119
+ xmlStr = make_sample_xml
120
+ xp = XML::Parser.new
121
+ xp.string = xmlStr
122
+ doc = xp.parse
123
+ sum = avgSum = count = 0
124
+ doc.find('/nodes/node').each { |e|
125
+ count += 1
126
+ sum += e['sum'].to_i
127
+ avgSum += e['avg'].to_i
128
+ }
129
+ puts "count(node): #{count}, sum(sum): #{sum}, avg(avg): #{avgSum/count}"
130
+ end
131
+
132
+ def test_dummy #0.117 seconds.
133
+ xmlStr = make_sample_xml
134
+ end
135
+ end
@@ -0,0 +1,47 @@
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
+ if $0 == __FILE__
8
+ require 'qwik/test-common'
9
+ $test = true
10
+ end
11
+
12
+ if defined?($test) && $test
13
+ class CheckManyPages < Test::Unit::TestCase
14
+ include TestSession
15
+
16
+ def test_all
17
+ t_add_user
18
+
19
+ # page = @site.create_new
20
+ # page.store("* t")
21
+ # res = session('/test/1.html')
22
+ # ok_title('t')
23
+ # page = @site['1']
24
+
25
+ # num = 200
26
+ num = 10
27
+ (1..num).each {|n|
28
+ page = @site.create_new
29
+ page.store("* t#{n}")
30
+ }
31
+ (1..num).each {|n|
32
+ res = session("/test/#{n}.html")
33
+ ok_title("t#{n}")
34
+ }
35
+
36
+ #100 Finished in 28.170425 seconds.
37
+
38
+ #100 Finished in 9.680146 seconds.
39
+ #200 Finished in 28.170425 seconds.
40
+ #1000 Finished in 603.93911 seconds.
41
+
42
+ #100 Finished in 4.67007 seconds.
43
+ #200 Finished in 9.030136 seconds.
44
+ #1000 Finished in 47.230712 seconds.
45
+ end
46
+ end
47
+ end