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,299 @@
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
+ require 'optparse'
6
+
7
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
8
+ require 'qwik/version'
9
+
10
+ module Qwik
11
+ class Config
12
+ LIBDIR = File.dirname(__FILE__)
13
+ DEBUG_BASEDIR = File.expand_path(LIBDIR+'/../../')
14
+
15
+ QuickMLInternal = {
16
+ # QuickML Internal use.
17
+ :logger => nil,
18
+ :ml_mutexes => nil,
19
+ :catalog => nil,
20
+ :message_catalog => nil,
21
+ :content_type => 'text/plain',
22
+ }
23
+
24
+ DefaultConfig = {
25
+ # For test and debug.
26
+ :debug => false,
27
+ :test => false,
28
+ :verbose_mode => false,
29
+
30
+ # Server setting.
31
+ :server_type => 'webrick',
32
+ #:server_type => 'mongrel',
33
+ :user => 'daemon',
34
+ :group => 'daemon',
35
+ :bind_address => '0.0.0.0',
36
+ :web_port => 9190,
37
+ :ml_port => 9195,
38
+
39
+ # Public Web address.
40
+ :public_url => 'http://example.com/',
41
+ :default_sitename => 'www',
42
+
43
+ # Mailing list setting.
44
+ :ml_domain => 'example.com',
45
+ :ml_postmaster => 'postmaster@example.com',
46
+
47
+ # Send mail setting.
48
+ :smtp_host => '127.0.0.1',
49
+ :smtp_port => 25,
50
+
51
+ # Experimental.
52
+ :db => 'fsdb',
53
+ :ssl => false,
54
+ :enable_ruby => false,
55
+
56
+ # For Graphviz plugin.
57
+ :graphviz_dot_path => '/usr/bin/dot',
58
+ :graphviz_font_size => '10',
59
+ :graphviz_font_name => 'Sazanami Gothic',
60
+
61
+ # Mailing list server setting.
62
+ :sweep_interval => 3600,
63
+ :allowable_error_interval => 8600,
64
+ :max_threads => 10, # Number of working threads.
65
+ :timeout => 120,
66
+ :use_qmail_verp => false,
67
+ :confirm_ml_creation => false,
68
+
69
+ # Config for each group.
70
+ :auto_unsubscribe_count => 5,
71
+ :max_mail_length => 100 * 1024, # 100KB
72
+ :max_ml_mail_length => 100 * 1024, # 100KB
73
+ :max_members => 100,
74
+ :ml_alert_time => 86400 * 24,
75
+ :ml_life_time => 86400 * 31,
76
+
77
+ # Setting for production mode.
78
+ :sites_dir => '/var/lib/qwik/data',
79
+ :grave_dir => '/var/lib/qwik/grave',
80
+ :cache_dir => '/var/cache/qwik',
81
+ :super_dir => '/usr/share/qwik/super',
82
+ :theme_dir => '/usr/share/qwik/theme',
83
+ :template_dir => '/usr/share/qwik/template',
84
+ :qrcode_dir => '/usr/share/qwik/qrcode',
85
+ :etc_dir => '/etc/qwik',
86
+ :config_file => '/etc/qwik/config.txt',
87
+ :log_dir => '/var/log/qwik',
88
+ :web_pid_file => '/var/run/qwikweb.pid',
89
+ :ml_pid_file => '/var/run/quickml.pid',
90
+ # total size of attachments for each site
91
+ :max_total_file_size => 1 * 1024 * 1024 * 1024, # 1GB
92
+ :max_total_warn_size => 10 * 1024 * 1024, # 10MB
93
+
94
+ # search word cloud
95
+ :search_word_display_num => 100, #number of search words to display
96
+ :search_word_max_num => 10000, #number of search wrods to save
97
+ }
98
+
99
+ DebugConfig = {
100
+ # Setting for debug mode.
101
+ :super_dir => DEBUG_BASEDIR+'/share/super',
102
+ :theme_dir => DEBUG_BASEDIR+'/share/theme',
103
+ :template_dir => DEBUG_BASEDIR+'/share/template',
104
+ :qrcode_dir => DEBUG_BASEDIR+'/share/qrcode',
105
+ }
106
+
107
+ TestConfig = {
108
+ # Setting for test mode.
109
+ :debug => true,
110
+ :test => true, # Do not send mail.
111
+ # :public_url => 'http://example.com/q/',
112
+ # :default_sitename => 'top',
113
+ :ml_domain => 'q.example.com',
114
+ :ml_postmaster => 'postmaster@q.example.com',
115
+ =begin
116
+ :sites_dir => '.',
117
+ :grave_dir => '.',
118
+ :cache_dir => '.',
119
+ :etc_dir => '.',
120
+ :log_dir => '.',
121
+ =end
122
+ :sites_dir => '.test/data',
123
+ :grave_dir => '.test/grave',
124
+ :cache_dir => '.test/cache',
125
+ :etc_dir => '.test/etc',
126
+ :log_dir => '.test/log',
127
+ :web_pid_file => 'qwikweb.pid',
128
+ :ml_pid_file => 'quickml.pid',
129
+ }
130
+
131
+ def initialize
132
+ @config = {}
133
+ @config.update(QuickMLInternal)
134
+ @config.update(DefaultConfig)
135
+ Config.make_accessor(Config, @config, @config[:debug])
136
+ end
137
+
138
+ def [](k)
139
+ return @config[k]
140
+ end
141
+
142
+ def []=(k, v)
143
+ @config[k] = v
144
+ end
145
+
146
+ def update(hash)
147
+ @config.update(hash)
148
+ end
149
+
150
+ # class method
151
+
152
+ def self.load_args_and_config(config, progname, args)
153
+ args_conf = Config.parse_args(progname, args)
154
+ config.update(args_conf) # config file is specified by args
155
+ file_conf = Config.load_config_file(config[:config_file])
156
+ config.update(file_conf)
157
+ config.update(args_conf) # Set args again to override.
158
+ end
159
+
160
+ def self.load_config_file(file)
161
+ raise "can not open #{file}" if ! FileTest.exist?(file)
162
+ content = open(file) {|fh| fh.read }
163
+ return parse_config(content)
164
+ end
165
+
166
+ def self.parse_config(str)
167
+ config = {}
168
+ str.each_line {|line|
169
+ next unless /\A\:/ =~ line
170
+ ar = line.chomp.split(':', 3)
171
+ next if ar[1].empty?
172
+ config[ar[1].intern] = parse_value(ar[2])
173
+ }
174
+ return config
175
+ end
176
+
177
+ def self.parse_value(v)
178
+ v = $1 if /\A(.+?)\#.*\z/ =~ v # remove comment
179
+ v = v.strip
180
+ case v
181
+ when 'true'; return true
182
+ when 'false'; return false
183
+ when 'nil'; return nil
184
+ when /\A\d+\z/; return v.to_i
185
+ # Only numbers, * and spaces are allowable.
186
+ # It is allowable to use eval in this context.
187
+ when /\A[\d\ \*]+\z/; return eval(v)
188
+ when /\A(\d+)m\z/; return $1.to_i * 60
189
+ when /\A(\d+)h\z/; return $1.to_i * 60 * 60
190
+ when /\A(\d+)d\z/; return $1.to_i * 60 * 60 * 24
191
+ when /\A(\d+)w\z/; return $1.to_i * 60 * 60 * 24 * 7
192
+ when /\A(\d+)KB\z/; return $1.to_i * 1024
193
+ when /\A(\d+)MB\z/; return $1.to_i * 1024 * 1024
194
+ when /\A(\d+)GB\z/; return $1.to_i * 1024 * 1024 * 1024
195
+ end
196
+ v.gsub!('$BASEDIR') { DEBUG_BASEDIR }
197
+ return v
198
+ end
199
+
200
+ def self.make_accessor(klass, config, debug=false)
201
+ config.each_key {|k|
202
+ if ! klass.method_defined?(k)
203
+ klass.class_eval "
204
+ def #{k}
205
+ return @config[:#{k}]
206
+ end
207
+ "
208
+ end
209
+ }
210
+ end
211
+
212
+ def self.parse_args(myprog, args)
213
+ config = {}
214
+ optionparser = OptionParser.new {|opts|
215
+ opts.banner = "Usage: #{myprog} [options]"
216
+ opts.separator ''
217
+ opts.separator 'Specific options:'
218
+ opts.on('-c', '--config file', 'Specify config file.') {|a|
219
+ config[:config_file] = a
220
+ }
221
+ opts.on('-d', '--[no-]debug', 'Run in debug mode') {|a|
222
+ config[:debug] = a
223
+ }
224
+ opts.separator ''
225
+ opts.separator 'Common options:'
226
+ opts.on_tail('-h', '--help', 'Show this message') {
227
+ puts opts
228
+ exit
229
+ }
230
+ opts.on_tail('-v', '--version', 'Show version') {
231
+ puts VERSION
232
+ exit
233
+ }
234
+ }
235
+ optionparser.parse!(args)
236
+ return config
237
+ end
238
+ end
239
+ end
240
+
241
+ if $0 == __FILE__
242
+ require 'test/unit'
243
+ $test = true
244
+ end
245
+
246
+ if defined?($test) && $test
247
+ class TestConfig < Test::Unit::TestCase
248
+ def test_class_method
249
+ c = Qwik::Config
250
+
251
+ # test_parse_config
252
+ assert_equal({}, c.parse_config('::'))
253
+ assert_equal({}, c.parse_config('::v'))
254
+ assert_equal({:k=>''}, c.parse_config(':k:'))
255
+ assert_equal({:k=>''}, c.parse_config(':k: '))
256
+
257
+ assert_equal({:k=>'v'}, c.parse_config(':k:v'))
258
+ assert_equal({:k=>'v:v'}, c.parse_config(':k:v:v'))
259
+ assert_equal({:k=>'v'}, c.parse_config("\#c\n:k:v"))
260
+ assert_equal({:k=>'v'}, c.parse_config(':k:v#comment'))
261
+ assert_equal({:k=>'v'}, c.parse_config(':k:v #comment'))
262
+
263
+ assert_equal({:k=>4}, c.parse_config(':k: 2 * 2'))
264
+ assert_equal({:k=>'1.1'}, c.parse_config(':k:1.1'))
265
+
266
+ assert_equal({:k=>Qwik::Config::DEBUG_BASEDIR},
267
+ c.parse_config(':k:$BASEDIR'))
268
+
269
+ # test_parse_value
270
+ assert_equal true, c.parse_value('true')
271
+ assert_equal false, c.parse_value('false')
272
+ assert_equal nil, c.parse_value('nil')
273
+
274
+ assert_equal 1, c.parse_value('1')
275
+ assert_equal 4, c.parse_value('2*2')
276
+ assert_equal 4, c.parse_value('2 * 2')
277
+
278
+ assert_equal 60, c.parse_value('1m')
279
+ assert_equal 3600, c.parse_value('1h')
280
+ assert_equal 86400, c.parse_value('1d')
281
+ assert_equal 604800, c.parse_value('1w')
282
+ assert_equal 1024, c.parse_value('1KB')
283
+ assert_equal 1048576, c.parse_value('1MB')
284
+ assert_equal 1073741824, c.parse_value('1GB')
285
+
286
+ # test_parse_args
287
+ assert_equal({:debug=>true}, c.parse_args('myprog', ['-d']))
288
+ end
289
+
290
+ def test_all
291
+ # test_new
292
+ config = Qwik::Config.new
293
+ assert_equal false, config.debug
294
+ assert_equal false, config.test
295
+ config[:debug] = true
296
+ assert_equal true, config.debug
297
+ end
298
+ end
299
+ 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
+ require 'pathname'
7
+ require 'qwik/db-berkeley'
8
+
9
+ module Qwik
10
+ class BackupBDB
11
+ def initialize(path)
12
+ @backup_path = path+'.backup'
13
+ @db = open_db(path+'backup.db')
14
+ end
15
+
16
+ def open_db(path)
17
+ options = 0
18
+ unless path.exist? # don't over write
19
+ options = BDB::CREATE | BDB::EXCL
20
+ end
21
+ db = BDB::Hash.open(path.to_s, nil, options)
22
+ return db
23
+ end
24
+
25
+ def close
26
+ @db.close
27
+ end
28
+
29
+ def path(k, time) # k is String, t is Time
30
+ t = time.to_i.to_s
31
+ @backup_path+(t+'_'+k)
32
+ end
33
+ private :path
34
+
35
+ def exist?(k, time)
36
+ v = db_get(k, time)
37
+ return true if v
38
+ path(k, time).exist?
39
+ end
40
+
41
+ def get(k, time)
42
+ v = db_get(k, time)
43
+ return v if v
44
+ if path(k, time).exist?
45
+ str = path(k, time).open {|f| f.read }
46
+ put(k, time, v)
47
+ return str
48
+ end
49
+ ''
50
+ end
51
+
52
+ def db_get(k, time)
53
+ @db.get(make_key(k, time))
54
+ end
55
+
56
+ def make_key(k, time)
57
+ k+','+time.to_i.to_s
58
+ end
59
+ private :db_get, :make_key
60
+
61
+ def put(k, time, v)
62
+ @db.put(make_key(k, time), v)
63
+ end
64
+ alias set put
65
+
66
+ def each_by_key(key)
67
+ ar = []
68
+ # FIXME: use each_by_prefix(key+',') instead
69
+ @db.each {|k, v|
70
+ next if v.nil?
71
+ if /\A#{key},([0-9]+)\z/ =~ k # begin with key?
72
+ time = Time.at($1.to_i)
73
+ ar << [v, time]
74
+ end
75
+ }
76
+
77
+ if @backup_path.exist?
78
+ @backup_path.each_entry {|file|
79
+ f = @backup_path+file
80
+ next unless f.file?
81
+ base = file.to_s
82
+ if /\A([0-9]+)_#{key}\z/ =~ base # end with key ?
83
+ time = Time.at($1.to_i)
84
+ v = get(key, time)
85
+ ar << [v, time]
86
+ end
87
+ }
88
+ end
89
+
90
+ ar.sort_by {|v, time|
91
+ time
92
+ }.each {|v, time|
93
+ yield(v, time)
94
+ }
95
+ end
96
+ end
97
+ end
98
+
99
+ if $0 == __FILE__
100
+ require 'qwik/testunit'
101
+ require 'qwik/config'
102
+ require 'qwik/test-module-path'
103
+ $test = true
104
+ end
105
+
106
+ if defined?($test) && $test
107
+ class TestBackupBDB < Test::Unit::TestCase
108
+ def setup
109
+ @config = Qwik::Config.new
110
+ @config[:db] = 'bdb'
111
+ @dir = 'test/'.path
112
+ @dir.setup
113
+ path = @dir
114
+ spath = @config.super_dir.path
115
+ @pagedb = Qwik::BerkeleyDB.new(path, spath)
116
+ end
117
+
118
+ def teardown
119
+ @pagedb.close if @pagedb
120
+ @dir.teardown
121
+ end
122
+
123
+ def test_backupdb
124
+ @pagedb.create('1')
125
+ @pagedb.put('1', 't', Time.at(1))
126
+
127
+ budb = @pagedb.backupdb
128
+ assert_instance_of(Qwik::BackupBDB, budb)
129
+
130
+ budb.each_by_key('1') {|v, time|
131
+ assert_instance_of(String, v)
132
+ assert_instance_of(Time, time)
133
+ s = budb.get('1', time)
134
+ assert_instance_of(String, s)
135
+ eq v, s
136
+ }
137
+
138
+ #put
139
+ #exist?
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,184 @@
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-pathname'
7
+
8
+ module Qwik
9
+ class BackupDB
10
+ include Enumerable
11
+
12
+ def initialize(path)
13
+ @backup_path = path+'.backup'
14
+ end
15
+
16
+ def close
17
+ # do nothing
18
+ end
19
+
20
+ def path(k, time) # k: String, t: Time
21
+ t = time.to_i.to_s
22
+ return @backup_path+"#{t}_#{k}"
23
+ end
24
+ private :path
25
+
26
+ def exist?(k, time)
27
+ return path(k, time).exist?
28
+ end
29
+
30
+ def get(k, time)
31
+ return path(k, time).read
32
+ end
33
+
34
+ def check(k, v)
35
+ end
36
+
37
+ IGNORE_PAGES = [
38
+ /\A_SiteLog\Z/,
39
+ /\A_SiteChanged\Z/,
40
+ /\A_GroupCharset\Z/,
41
+ /\A_GroupCount\Z/,
42
+ /\A_counter_[_A-Za-z0-9]+\Z/
43
+ ]
44
+
45
+ def put(k, v, time)
46
+ @backup_path.check_directory
47
+ return if IGNORE_PAGES.any? {|re| re =~ k }
48
+ path(k, time).put(v)
49
+ end
50
+ alias set put
51
+
52
+ def each_by_key(key)
53
+ each {|k, v, time|
54
+ yield(v, time) if k == key
55
+ }
56
+ end
57
+
58
+ def each
59
+ @backup_path.check_directory
60
+ ar = []
61
+ @backup_path.each_entry {|file|
62
+ f = @backup_path+file
63
+ next unless f.file?
64
+ base = file.to_s
65
+ if /\A([0-9]+)_([_A-Za-z0-9]+)\z/ =~ base
66
+ time = Time.at($1.to_i)
67
+ key = $2
68
+ ar << [key, time]
69
+ end
70
+ }
71
+
72
+ ar.sort_by {|key, time|
73
+ time
74
+ }.each {|key, time|
75
+ # v = get(key, time)
76
+ v = "" # FIXME: This is dummy. 2009/9/1
77
+ yield(key, v, time)
78
+ }
79
+ end
80
+ end
81
+ end
82
+
83
+ if $0 == __FILE__
84
+ require 'qwik/testunit'
85
+ require 'qwik/config'
86
+ require 'qwik/test-module-path'
87
+ require 'qwik/db-filesystem'
88
+ $test = true
89
+ end
90
+
91
+ if defined?($test) && $test
92
+ class TestBackupDB < Test::Unit::TestCase
93
+ def setup
94
+ config = Qwik::Config.new
95
+ config.update Qwik::Config::DebugConfig
96
+ config.update Qwik::Config::TestConfig
97
+ @path = '.test/'.path
98
+ @path.setup
99
+
100
+ spath = config.super_dir.path
101
+ @pagedb = Qwik::FileSystemDB.new(@path, spath)
102
+
103
+ # test_initialize
104
+ backupdb = Qwik::BackupDB.new(@path)
105
+ @pagedb.register_observer(backupdb)
106
+ end
107
+
108
+ def test_backupdb
109
+ # test_put
110
+ @pagedb.create('1')
111
+ @pagedb.put('1', 't', 1)
112
+
113
+ budb = @pagedb.backupdb
114
+ assert_instance_of(Qwik::BackupDB, budb)
115
+
116
+ # test_each_by_key
117
+ budb.each_by_key('1') {|v, time|
118
+ assert_instance_of(String, v)
119
+ assert_instance_of(Time, time)
120
+ s = budb.get('1', time)
121
+ assert_instance_of(String, s)
122
+ # eq v, s
123
+ }
124
+
125
+ # FIXME: test_put, test_exist should be exist.
126
+ end
127
+
128
+ def test_ignore_pages
129
+ key = '_SiteLog'
130
+ @pagedb.create(key)
131
+ @pagedb.put(key, 't', 1)
132
+
133
+ # test_each_by_key
134
+ found = false
135
+ @pagedb.backupdb.each_by_key(key) {|v, time|
136
+ found = true
137
+ }
138
+ assert_equal false, found
139
+ end
140
+
141
+ def test_ignore_pages2
142
+ key = '_counter_1'
143
+ @pagedb.create(key)
144
+ @pagedb.put(key, 't', 1)
145
+
146
+ # test_each_by_key
147
+ found = false
148
+ @pagedb.backupdb.each_by_key(key) {|v, time|
149
+ found = true
150
+ }
151
+ assert_equal false, found
152
+ end
153
+
154
+ def test_ignore_pages3
155
+ key = '_counter_'
156
+ @pagedb.create(key)
157
+ @pagedb.put(key, 't', 1)
158
+
159
+ # test_each_by_key
160
+ found = false
161
+ @pagedb.backupdb.each_by_key(key) {|v, time|
162
+ found = true
163
+ }
164
+ assert_equal true, found
165
+ end
166
+
167
+ def test_ignore_pages4
168
+ key = '_SiteLogHoge'
169
+ @pagedb.create(key)
170
+ @pagedb.put(key, 't', 1)
171
+
172
+ # test_each_by_key
173
+ found = false
174
+ @pagedb.backupdb.each_by_key(key) {|v, time|
175
+ found = true
176
+ }
177
+ assert_equal true, found
178
+ end
179
+
180
+ def teardown
181
+ @path.teardown
182
+ end
183
+ end
184
+ end