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,558 @@
1
+ # -*- coding: shift_jis -*-
2
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
3
+ # This is free software with ABSOLUTELY NO WARRANTY.
4
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
5
+
6
+ # Thanks to Mr. Kan Fushihara
7
+
8
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
9
+ require 'qwik/act-monitor'
10
+
11
+ module Qwik
12
+ $wema_debug = false
13
+ $wema_redirect = true
14
+
15
+ class Action
16
+ D_PluginWema = {
17
+ :dt => 'Post-it plugin',
18
+ :dd => 'You can put post-it notes on the page.',
19
+ :dc => "* How to
20
+ {{wema}}
21
+ {{wema}}
22
+
23
+ Embed this wema plugin to your page.
24
+ Click 'New Post-it' link, then you see a small window.
25
+ Enter some text and save it.
26
+ You can move the small window and click set for setting the position.
27
+ * Thanks
28
+ I start development from [[wema|http://wema.sourceforge.jp/]]
29
+ by Mr. Kan Fushihara. Thank you very much.
30
+ "
31
+ }
32
+
33
+ D_PluginWema_ja = {
34
+ :dt => '附箋機能 ',
35
+ :dd => '附箋をはることができます。',
36
+ :dc => '* 使用法
37
+ {{wema}}
38
+ {{wema}}
39
+
40
+ ページ中に上記のようにwemaプラグインをうめこみます。
41
+ 「New Post-it」というリンクを押すと、小さなWindowが表示されます。
42
+ なにかテキストをいれ、セーブしてください。
43
+ Windowを動かして、「set」を押すと位置をセットします。
44
+ * 感謝
45
+ 伏原幹氏による「[[wema|http://wema.sourceforge.jp/]]」を元に開発いたし
46
+ ました。どうもありがとうございます。
47
+ '
48
+ }
49
+
50
+ # Show only if there is already wema.
51
+ def plg_wema_compat
52
+ return if @site[@req.base].nil?
53
+ return if defined?(@wema_generated)
54
+ wp = WemaPage.new(@site, @site[@req.base])
55
+ wemas = wp.get_wemas
56
+ if wemas.empty?
57
+ # create wema link.
58
+ return [:a, {:href=>'PluginWema.describe'}, _('Post-it')]
59
+ end
60
+ @wema_generated = true
61
+ return WemaHtmlGenerator.generate(wemas, @req.base)
62
+ end
63
+
64
+ def plg_wema
65
+ return if @site[@req.base].nil?
66
+ return if defined?(@wema_generated)
67
+ wp = WemaPage.new(@site, @site[@req.base])
68
+ wemas = wp.get_wemas
69
+ @wema_generated = true
70
+ return WemaHtmlGenerator.generate(wemas, @req.base)
71
+ end
72
+
73
+ def ext_wema
74
+ c_require_post
75
+ c_require_login
76
+
77
+ wp = WemaPage.new(@site, @site[@req.base])
78
+ redirect = "#{@req.base}.html"
79
+ redirect = nil if $wema_debug
80
+
81
+ mode = @req.query['mode']
82
+ wid = @req.query['id'] # wema id
83
+ connected = @req.query['ln']
84
+ left = @req.query['l']
85
+ top = @req.query['t']
86
+ fg = @req.query['tc']
87
+ bg = @req.query['bg']
88
+ text = @req.query['body']
89
+
90
+ mode = 'delete' if mode == 'edit' && text.empty?
91
+
92
+ case mode
93
+ when 'edit'
94
+ if wid.nil? || wid.empty? # create new
95
+ wema = wp.create_new
96
+ msg = _('New post-it is created.')
97
+ else
98
+ id = wid.sub(/\Aid/, '').to_i
99
+ wp.get_wemas
100
+ wema = wp[id]
101
+ msg = _('Edit done.')
102
+ end
103
+
104
+ if wema
105
+ wema.set(connected, left, top, fg, bg, text)
106
+ c_make_log('wemaedit') # WEMAEDIT
107
+ #c_monitor('wemaedit') # WEMAEDIT
108
+ end
109
+ return wema_jump(msg, redirect)
110
+
111
+ when 'delete'
112
+ if wid.nil? || wid.empty?
113
+ return wema_jump(_('No action.'), redirect)
114
+ end
115
+
116
+ id = wid.sub(/\Aid/, '').to_i
117
+ wp.get_wemas
118
+ wema = wp[id]
119
+ wp.delete(id)
120
+ c_make_log('wemadelete') # WEMADELETE
121
+ #c_monitor('wemadelete') # WEMADELETE
122
+ return wema_jump(_('Delete a Post-it.'), redirect)
123
+
124
+ when 'setpos'
125
+ wid = nil if wid.empty?
126
+ return c_nerror('wid is nil') if wid.nil?
127
+
128
+ id = wid.sub(/\Aid/, '').to_i
129
+ wp.get_wemas
130
+ wema = wp[id]
131
+ return c_nerror('can not get wema') if wid.nil?
132
+ wema.setpos(left, top)
133
+
134
+ #c_make_log('wemasetpos') # too many...
135
+ #c_monitor('wemasetpos')
136
+ return wema_jump(_('Set position.'), redirect)
137
+
138
+ else
139
+ return c_nerror("Unknown mode: [#{mode}]")
140
+
141
+ end
142
+ end
143
+
144
+ def wema_jump(msg, url)
145
+ return c_nredirect(msg, url) if $wema_redirect
146
+ return c_notice(msg, url)
147
+ end
148
+ end
149
+
150
+ class WemaPage
151
+ include Enumerable
152
+
153
+ def initialize(site, page)
154
+ @site = site
155
+ @page = page
156
+ @pagename = @page.key
157
+ @wemas = []
158
+ end
159
+ attr_reader :site, :pagename
160
+
161
+ def get_wemas
162
+ @wemas = get_list.map {|id|
163
+ Wema.new(self, id)
164
+ }
165
+ return @wemas
166
+ end
167
+
168
+ def [](id)
169
+ @wemas.each {|wema|
170
+ return wema if wema.id == id
171
+ }
172
+ return nil
173
+ end
174
+
175
+ def create_new
176
+ return create(get_new_id)
177
+ end
178
+
179
+ def delete(k)
180
+ self[k].delete
181
+ @wemas[k] = nil
182
+ end
183
+
184
+ private
185
+
186
+ def get_new_id
187
+ list = get_list
188
+ return 1 if list.empty?
189
+ return list.max + 1
190
+ end
191
+
192
+ def create(id)
193
+ return Wema.new(self, id)
194
+ end
195
+
196
+ def get_list
197
+ list = []
198
+ @site.to_a(true).each {|page| # true means get all pages.
199
+ if /\A_#{@pagename}_wema_([0-9]+)\z/ =~ page.key
200
+ list << $1.to_i
201
+ end
202
+ }
203
+ list
204
+ end
205
+
206
+ def get_lines
207
+ lines = []
208
+ @wemas.each {|wema|
209
+ connected = wema.connected
210
+ if connected && ! connected.empty?
211
+ lines << [wema.id, connected]
212
+ end
213
+ }
214
+ lines
215
+ end
216
+ end
217
+
218
+ class Wema
219
+ def initialize(wemapage, id)
220
+ @wemapage, @id = wemapage, id
221
+ @site = @wemapage.site
222
+ pagename = key(id)
223
+ @page = @site[pagename]
224
+ @page = @site.create(pagename) if @page.nil?
225
+ @connected = @x = @y = @fg = @bg = @text = nil
226
+ parse(@page.load)
227
+ end
228
+ attr_reader :id, :connected, :x, :y, :fg, :bg, :text
229
+
230
+ def get_data
231
+ data = {
232
+ :id => @id,
233
+ :connected => @connected,
234
+ :x => @x,
235
+ :y => @y,
236
+ :fg => @fg,
237
+ :bg => @bg,
238
+ :text => @text,
239
+ }
240
+ return data
241
+ end
242
+
243
+ def set(connected, x, y, fg, bg, text)
244
+ set_px(x) {|a| @x = a }
245
+ set_px(y) {|a| @y = a }
246
+ set_color(fg) {|a| @fg = a }
247
+ set_color(bg) {|a| @bg = a }
248
+ set_text(text) {|a| @text = a }
249
+ set_str(connected) {|a| @connected = a }
250
+ store
251
+ end
252
+
253
+ def setpos(x, y)
254
+ set(nil, x, y, nil, nil, nil)
255
+ end
256
+
257
+ def get_id
258
+ return "id#{@id}"
259
+ end
260
+
261
+ def delete
262
+ @site.delete(key(id))
263
+ end
264
+
265
+ private
266
+
267
+ def key(id)
268
+ return "_#{@wemapage.pagename}_wema_#{id}"
269
+ end
270
+
271
+ def parse(str)
272
+ lines = str.to_a
273
+ f = lines.shift # first line
274
+ return if f.nil?
275
+ f.chomp!
276
+ dummy, @connected, @x, @y, @fg, @bg = f.split(',')
277
+ @text = lines.join('')
278
+ end
279
+
280
+ def store
281
+ str = [nil, @connected, @x, @y, @fg, @bg].join(',')+"\n"
282
+ str << @text.to_s
283
+ @page.store(str)
284
+ end
285
+
286
+ private
287
+
288
+ def set_px(a)
289
+ return if is_nil?(a)
290
+ yield a.sub(/px$/, '').to_i
291
+ end
292
+
293
+ def set_color(a)
294
+ return if is_nil?(a)
295
+ return unless /\A[\#a-z0-9]+\z/ =~ a
296
+ yield a
297
+ end
298
+
299
+ def set_text(a)
300
+ return if is_nil?(a)
301
+ yield a.delete("\r").chomp+"\n"
302
+ end
303
+
304
+ def set_str(a)
305
+ return if is_nil?(a)
306
+ return unless /\A[a-z0-9]+\z/ =~ a
307
+ yield a
308
+ end
309
+
310
+ def is_nil?(a)
311
+ return a.nil? || ! a.is_a?(String) || a.empty?
312
+ end
313
+ end
314
+
315
+ class WemaHtmlGenerator
316
+ def self.generate(wemas, pagename)
317
+ ar = [:div]
318
+ ar << load_css # At the first, load CSS.
319
+ ar << make_menu # Then, make menu.
320
+ wemas.each {|wema|
321
+ ar << get_div(wema) # Create all divs for wemas.
322
+ }
323
+ ar << editor_html(pagename) # Create an editor.
324
+ ar << load_js # At the last, load JavaScript.
325
+ return ar
326
+ end
327
+
328
+ private
329
+
330
+ def self.load_css
331
+ return [:style, "@import '.theme/css/wema.css';"]
332
+ end
333
+
334
+ def self.make_menu
335
+ return [:span, {:class=>'attribute'}, 'Post-it', ': ',
336
+ [:a, {:href=>'javascript:wema_editor_show()'}, 'New Post-it'],
337
+ ' (', [:a, {:href=>'javascript:wema_help_show()'}, 'Help'], ')']
338
+ end
339
+
340
+ def self.load_js
341
+ [:script, {:type=>'text/javascript', :src=>'.theme/js/wema.js'}, '']
342
+ end
343
+
344
+ # ============================== wema window
345
+ def self.get_div(wema)
346
+ k = wema.get_id
347
+
348
+ text = wema.text || ''
349
+
350
+ tokens = TextTokenizer.tokenize(text, true)
351
+ h = TextParser.make_tree(tokens)
352
+
353
+ h = resolve_href(h)
354
+
355
+ h << '' if h.length == 0
356
+
357
+ fg = wema.fg
358
+ fg = '#000' if fg.nil? || fg.empty?
359
+ bg = wema.bg
360
+ bg = '#fff' if bg.nil? || bg.empty?
361
+
362
+ x = wema.x
363
+ y = wema.y
364
+
365
+ div = [:div, {:id=>k, :class=>'wema',
366
+ :style=>"left:#{x}px;top:#{y}px;color:#{fg};background:#{bg};",
367
+ :wema_tc=>wema.fg,
368
+ :wema_bg=>wema.bg,
369
+ :wema_ln=>wema.connected,
370
+ :wema_d=>wema.text},
371
+ [:div, {:class=>'menubar'}, [:span, {:class=>'handle'}, k],
372
+ [:span, {:class=>'cmd'},
373
+ [:a, {:href=>"javascript:wema_setpos('#{k}')"}, 'set'],
374
+ [:a, {:href=>"javascript:wema_edit('#{k}')"}, 'edit'],
375
+ [:a, {:href=>"javascript:wema_link('#{k}')"}, 'link']]],
376
+ [:div, {:class=>'cont'}, h]]
377
+ return div
378
+ end
379
+
380
+ def self.resolve_href(wabisabi)
381
+ wabisabi.each_tag(:a){|w|
382
+ ww = resolve_ref(w)
383
+ w = ww ? ww : [w]
384
+ w
385
+ }
386
+ end
387
+
388
+ def self.resolve_ref(w)
389
+ attr = w[1]
390
+ return nil if attr.nil? || !attr.is_a?(Hash)
391
+ href = attr[:href].to_s
392
+
393
+ if /^(?:http|https|ftp|file):\/\// =~ href # external link
394
+ w.set_attr :class=>'external', :rel=>'nofollow',
395
+ :href=>".redirect?url=#{href}"
396
+ return [w]
397
+ end
398
+
399
+ return nil
400
+ end
401
+
402
+ # ============================== editor window
403
+ def self.editor_html(pagename)
404
+ action = "#{pagename}.wema"
405
+ return [:div, {:id=>'editor', :class=>'wema'},
406
+ [:div, {:class=>'menubar'},
407
+ [:span, {:class=>'handle'}, 'editor'],
408
+ [:span, {:class=>'close'},
409
+ [:a, {:href=>'javascript:wema_editor_hide()'}, 'X']]],
410
+ [:div, {:class=>'cont'},
411
+ [:form, {:method=>'POST', :action=>action,
412
+ :id=>'frm', :name=>'frm'},
413
+ [:p, {:class=>'save'},
414
+ [:input, {:type=>'submit', :value=>'Save'}]],
415
+ [:textarea, {:name=>'body', :cols=>'40', :rows=>'7'}, ''],
416
+ font_color,
417
+ bg_color,
418
+ [:p, 'Draw Line: ', text('ln')],
419
+ [:p, 'x:', text('l'), ' y:', text('t')],
420
+ param('id', ''),
421
+ param('mode', 'edit')]]]
422
+ end
423
+
424
+ def self.font_color
425
+ ar = ['Text color: ', [:input, {:id=>'tc', :name=>'tc'}]]
426
+ ar += ['#000', '#600', '#060', '#006'].map {|c| radio_color('tc', c) }
427
+ return [:p, ar]
428
+ end
429
+
430
+ def self.bg_color
431
+ ar = ['Background'+': ', [:input, {:id=>'bg', :name=>'bg'}]]
432
+ ar += ['#fff', '#fcc', '#cfc', '#ccf', '#ffc', '#000'].map {|c|
433
+ radio_color('bg', c)
434
+ }
435
+ return [:p, ar]
436
+ end
437
+
438
+ def self.radio_color(name, color)
439
+ return [:a, {:href=>"javascript:wema_set_color('#{name}', '#{color}')",
440
+ :class=>'color',
441
+ :style=>"color:#{color};background:#{color};"}, '[_]']
442
+ end
443
+
444
+ def self.param(*a)
445
+ return text(*a) if $wema_debug
446
+ return hidden(*a)
447
+ end
448
+
449
+ def self.text(a='', b=nil)
450
+ h = {}
451
+ h.update(:name=>a) if a
452
+ h.update(:value=>b) if b
453
+ return [:input, h]
454
+ end
455
+
456
+ def self.hidden(a='', b=nil)
457
+ h = {:type=>'hidden'}
458
+ h.update(:name=>a) if a
459
+ h.update(:value=>b) if b
460
+ return [:input, h]
461
+ end
462
+ end
463
+ end
464
+
465
+ if $0 == __FILE__
466
+ require 'qwik/test-common'
467
+ $test = true
468
+ end
469
+
470
+ if defined?($test) && $test
471
+ class TestExtWema < Test::Unit::TestCase
472
+ include TestSession
473
+
474
+ def test_act_wema
475
+ t_add_user
476
+
477
+ page = @site['_PageAttribute']
478
+ page.store '{{wema}}'
479
+
480
+ page = @site.create_new
481
+
482
+ res = session '/test/1.wema'
483
+ ok_title 'Please input POST'
484
+
485
+ res = session 'POST /test/1.wema'
486
+ assert_text 'Unknown mode: []', 'title'
487
+
488
+ res = session 'POST /test/1.wema?mode=edit&body='
489
+ ok_title 'No action.'
490
+
491
+ res = session 'POST /test/1.wema?mode=edit&body=t'
492
+ ok_title 'New post-it is created.'
493
+ page = @site['_1_wema_1']
494
+ eq ",,,,,\nt\n", page.load
495
+
496
+ res = session 'POST /test/1.wema?mode=edit&id=id1&body=t2'
497
+ ok_title 'Edit done.'
498
+ page = @site['_1_wema_1']
499
+ eq ",,,,,\nt2\n", page.load
500
+
501
+ res = session 'POST /test/1.wema?mode=setpos&id=id1&l=1&t=2'
502
+ ok_title 'Set position.'
503
+ page = @site['_1_wema_1']
504
+ eq ",,1,2,,\nt2\n", page.load
505
+
506
+ res = session '/test/1.html'
507
+ ok_title '1'
508
+ ok_in ['t2'], "//div[@class='wema']/p"
509
+ ok_in [:p, 't2'], "//div[@class='wema']/div[@class='cont']"
510
+
511
+ res = session 'POST /test/1.wema?mode=edit&id=id1&body=* t3'
512
+ ok_title 'Edit done.'
513
+ page = @site['_1_wema_1']
514
+ eq ",,1,2,,\n* t3\n", page.load
515
+
516
+ res = session '/test/1.html'
517
+ ok_in [:h2, 't3'], "//div[@class='wema']/div[@class='cont']"
518
+
519
+ res = session 'POST /test/1.wema?mode=edit&id=id1&body={{recent}}'
520
+ ok_title 'Edit done.'
521
+ page = @site['_1_wema_1']
522
+ eq ",,1,2,,\n{{recent}}\n", page.load
523
+
524
+ res = session '/test/1.html'
525
+ ok_in [:plugin, {:method=>'recent', :param=>''}],
526
+ "//div[@class='wema']/div[@class='cont']"
527
+
528
+ res = session 'POST /test/1.wema?mode=edit&id=id1&body=http://e.com/'
529
+ ok_title 'Edit done.'
530
+ page = @site['_1_wema_1']
531
+ eq ",,1,2,,\nhttp://e.com/\n", page.load
532
+
533
+ res = session '/test/1.html'
534
+ ok_xp [:a, {:href=>'.redirect?url=http://e.com/',
535
+ :rel=>'nofollow', :class=>'external'}, 'http://e.com/'],
536
+ "//div[@class='wema']/p/a"
537
+
538
+ res = session 'POST /test/1.wema?mode=edit&id=id1&body='
539
+ ok_title 'Delete a Post-it.'
540
+ page = @site['_1_wema_1']
541
+ # comment outed due to cache issue.
542
+ # eq nil, page
543
+ end
544
+
545
+ def test_act_wema_without_login
546
+ t_add_user
547
+
548
+ page = @site.create_new
549
+
550
+ res = session('POST /test/1.wema?mode=edit&body=t') {|req|
551
+ req.cookies.delete('user')
552
+ req.cookies.delete('pass')
553
+ }
554
+ ok_title 'Login'
555
+ eq false, @site.exist?('_1_wema_1')
556
+ end
557
+ end
558
+ end