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,416 @@
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 'stringio'
6
+
7
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
8
+ require 'qwik/wabisabi-generator'
9
+ require 'qwik/act-smil'
10
+
11
+ module Qwik
12
+ class Action
13
+ def act_media_server
14
+ ms = MediaServer.new(@config)
15
+
16
+ if 0 < @req.path_args.length # has target file
17
+ filename = @req.path_args.shift
18
+ file = filename.path
19
+
20
+ if @req.query['delete'] == 'yes'
21
+ output = ms.output_file(@site, file)
22
+ return c_nerror("already deleted: #{file.to_s}") unless output.exist?
23
+ output.unlink
24
+ return c_notice("delete content: #{file.to_s}"){}
25
+ end
26
+
27
+ if filename == 'all'
28
+ each_media_entry {|f|
29
+ file = f.basename
30
+ f = @site.attach.path(file)
31
+ next unless f.exist?
32
+ ms.publish_file(@site, f)
33
+ }
34
+ return c_notice('publish all')
35
+ end
36
+
37
+ f = @site.attach.path(filename)
38
+ return c_notfound('File not found.') unless f.exist?
39
+ ms.publish_file(@site, f)
40
+ return c_notice("pulish the content: #{file.to_s}")
41
+ end
42
+
43
+ ul = []
44
+ each_media_entry {|f|
45
+ file = f.basename
46
+ ar = []
47
+ ar << [:a, {:href=>c_relative_to_root(".media_server/#{file}")},
48
+ file.to_s]
49
+ output = ms.output_file(@site, file)
50
+ if output.exist?
51
+ outbase = output.basename.to_s
52
+ uri = URI(@config.public_url)
53
+ url = "rtsp://#{uri.host}:554/#{uri.path}#{@site.sitename}/#{outbase}"
54
+ ar << ' [' << [:a, {:href=>url}, outbase] << '] '
55
+ url = [:a, {:href=>c_relative_to_root(".media_server/#{file}?delete=yes")}, 'delete']
56
+ ar << url
57
+ end
58
+ ul << [:li, ar]
59
+ }
60
+
61
+ if 0 < ul.length
62
+ ul << [:li, [:a, {:href=>c_relative_to_root('.media_server/all')},
63
+ 'publish all']]
64
+ end
65
+
66
+ return c_notice('media server') {[:ul, ul]}
67
+ end
68
+
69
+ def each_media_entry
70
+ path = @site.attach.path('')
71
+ path.each_entry {|file|
72
+ base = file.to_s
73
+ next unless /\A(.+)\.rm\z/i =~ base
74
+ yield(path+file)
75
+ }
76
+ end
77
+
78
+ def each_movie_entry
79
+ path = @site.attach.path
80
+ path.each_entry {|file|
81
+ base = file.to_s
82
+ next unless /\A(.+)\.avi\z/i =~ base || /\A(.+)\.mp4\z/i =~ base
83
+ yield(path+file)
84
+ }
85
+ end
86
+
87
+ def act_encode
88
+ rp = RealProducer.new(@config, @site)
89
+ if 0 < @req.path_args.length # has target file
90
+ filename = @req.path_args.shift
91
+
92
+ if filename == 'all'
93
+ t = Thread.new {
94
+ each_movie_entry {|f|
95
+ file = f.basename
96
+ f = @site.attach.path(file)
97
+ next unless f.exist?
98
+ output = rp.output_file(file)
99
+ output.dirname.check_directory
100
+ next if output.exist?
101
+ msg = StringIO.new
102
+ rp.encode_file(f, output, msg)
103
+ puts 'done', msg.string
104
+ }
105
+ }
106
+ return c_notice('start encoding all')
107
+ end
108
+
109
+ file = filename.path
110
+ f = @site.attach.path(filename)
111
+ return c_notfound('File not found.') unless f.exist?
112
+ output = rp.output_file(file)
113
+ msg = StringIO.new
114
+ t = Thread.new {
115
+ rp.encode_file(f, output, msg)
116
+ }
117
+ return c_notice("start encoding: #{file.to_s}")
118
+ end
119
+
120
+ ul = []
121
+ each_movie_entry {|f|
122
+ file = f.basename
123
+ ar = []
124
+ ar << [:a, {:href=>c_relative_to_root(".encode/#{file}")},
125
+ file.to_s]
126
+ output = rp.output_file(file)
127
+ if output.exist?
128
+ outbase = output.basename.to_s
129
+ uri = URI(@config.public_url)
130
+ url = "rtsp://#{uri.host}:554/#{rpath}#{@site.sitename}/#{outbase}"
131
+ ar += [' [', [:a, {:href=>url}, outbase], ']']
132
+ end
133
+ ul << [:li, ar]
134
+ }
135
+
136
+ if 0 < ul.length
137
+ ul << [:li, [:a, {:href=>c_relative_to_root('.encode/all')},
138
+ 'encode all']]
139
+ end
140
+
141
+ return c_notice('movie file list') { [:ul, ul] }
142
+ end
143
+ end
144
+
145
+ class MediaServer
146
+ def initialize(config)
147
+ @config = config
148
+ end
149
+
150
+ def output_file(site, input)
151
+ path = @config.real_server_content.path+site.sitename
152
+ base = input.basename.to_s
153
+ base = base.sub(%r!\A(.+)\.(\w+)!){|a| $1 }
154
+ outbase = base+'.rm'
155
+ output = path+outbase
156
+ output
157
+ end
158
+
159
+ def windows?
160
+ r = RUBY_PLATFORM
161
+ return (r.index('cygwin') || r.index('mswin32') || r.index('mingw32'))
162
+ end
163
+
164
+ def publish_file(site, input)
165
+ output = output_file(site, input)
166
+ output.dirname.check_directory
167
+ if windows?
168
+ FileUtils.cp(input, output)
169
+ else
170
+ FileUtils.ln(input, output)
171
+ end
172
+ end
173
+ end
174
+
175
+ class RealProducer
176
+ def initialize(config, site)
177
+ @config = config
178
+ @site = site
179
+ @cmd = @config.real_producer
180
+ @audience = '768k'
181
+ @real_server_content_dir = @config.real_server_content
182
+ @o = ($VERBOSE) ? $stdout : StringIO.new
183
+ end
184
+ attr_reader :real_server_content_dir
185
+
186
+ def output_file(input)
187
+ path = @real_server_content_dir.path+@site.sitename
188
+ base = input.basename.to_s
189
+ base = base.sub(%r!\A(.+)\.(\w+)!){|a| $1 }
190
+ outbase = "#{base}.rm"
191
+ output = path+outbase
192
+ output
193
+ end
194
+
195
+ def encode_all
196
+ path = @site.attach.path
197
+ path.each_entry {|file|
198
+ base = file.basename.to_s
199
+ next unless /\A(.+)\.avi\z/i =~ base || /\A(.+)\.mp4\z/i =~ base
200
+ output_base = $1+'.rm'
201
+ output = path+output_base
202
+ if output.exist?
203
+ puts "already exist: #{output.to_s}"
204
+ next
205
+ end
206
+ encode_file(path+file)
207
+ }
208
+ end
209
+
210
+ def encode_file(input, output, msg=nil)
211
+ m = msg ? msg : @o
212
+ inf = input.to_win_dir
213
+ outf = output.to_win_dir
214
+ m.puts "start encode #{inf}"
215
+ open("|#{@cmd} -i #{inf} -o #{outf} -ad #{@audience}"){|f|
216
+ while line = f.gets
217
+ m.print line.normalize_eol
218
+ end
219
+ }
220
+ m.puts
221
+ end
222
+
223
+ def show_version
224
+ @o.puts(open("|#{@cmd} -pa"){|f| f.read })
225
+ end
226
+
227
+ def show_help
228
+ @o.puts(open("|#{@cmd} -h"){|f| f.read })
229
+ end
230
+
231
+ def show_more_help
232
+ @o.puts(open("|#{@cmd} -m"){|f| f.read })
233
+ end
234
+
235
+ def show_audience_list
236
+ @o.puts(open("|#{@cmd} -pa"){|f| f.read })
237
+ end
238
+ end
239
+
240
+ class Media
241
+ def initialize(site, name)
242
+ @site = site
243
+ @table = []
244
+ @msg = nil
245
+ @name = name
246
+ @param = {}
247
+ @param[:url] = nil
248
+ @param[:width] = 320 # default
249
+ @param[:height] = 240
250
+ @hash_delim = [':']
251
+ @table_delim = ['|', ',']
252
+ end
253
+
254
+ def parse(msg)
255
+ @msg = msg
256
+ lines = msg.split(/\n/)
257
+ lines.each {|line|
258
+ firstchar = line[0, 1]
259
+ if @table_delim.include?(firstchar)
260
+ ar = line.split(firstchar)
261
+ ar.shift # null
262
+ cbegin = cend = msg = nil
263
+ cbegin = VideoTime.new(ar.shift) if ! ar.empty?
264
+ cend = VideoTime.new(ar.shift) if ! ar.empty?
265
+ msg = ar.shift if ! ar.empty?
266
+ if @param[:url] && cbegin && cend
267
+ @table << {:url=>@param[:url],
268
+ :cbegin=>cbegin, :cend=>cend, :msg=>msg}
269
+ end
270
+ next
271
+ end
272
+ if @hash_delim.include?(firstchar)
273
+ ar = line.split(firstchar, 3)
274
+ ar.shift # null
275
+ name = ar.shift if ! ar.empty?
276
+ @param[name.intern] = ar.shift if ! ar.empty?
277
+ end
278
+ }
279
+ end
280
+
281
+ def generate_file
282
+ smil = make_smil.format_xml.page_to_xml
283
+ @site.attach.put(@name+'.smil', smil, true)
284
+ end
285
+
286
+ def make_smil
287
+ g = Generator.new
288
+ time = 0
289
+ par = []
290
+ @table.each {|tab|
291
+ dur = (tab[:cend] - tab[:cbegin]).to_i
292
+
293
+ ar = [{'region'=>'v'}, {'begin'=>"#{time}s"}, {'src'=>tab[:url]}]
294
+ ar << {'clip-begin'=>tab[:cbegin]} if tab[:cbegin]
295
+ ar << {'clip-end'=>tab[:cend]} if tab[:cend]
296
+ par << g.video(ar)
297
+ time += dur
298
+ }
299
+
300
+ g.smil(:xmlns=>'http://www.w3.org/2001/SMIL20/Language',
301
+ 'xmlns:rn'=>'http://features.real.com/2001/SMIL20/Extensions'){[
302
+ g.head{
303
+ g.layout{[
304
+ g.make('root-layout',
305
+ {'width'=>@param[:width]}, {'height'=>@param[:height]}),
306
+ g.region({'id'=>'v'}, {'fit'=>'meet'}),
307
+ ]}
308
+ },
309
+ g.body{
310
+ g.par{par}
311
+ }
312
+ ]}
313
+ end
314
+
315
+ def to_xml
316
+ table = []
317
+ table << [:tr,
318
+ [:td, 'IN'],
319
+ [:td, 'OUT'],
320
+ [:td, 'MSG']
321
+ ]
322
+ @table.each {|tab|
323
+ tr = []
324
+ tr << [:td, tab[:cbegin].to_s]
325
+ tr << [:td, tab[:cend].to_s]
326
+ tr << [:td, tab[:msg].to_s] if tab[:msg]
327
+ table << [:tr, *tr]
328
+ }
329
+ [:div, {:class=>'box'},
330
+ [:table, *table],
331
+ [:p, [:a, {:href=>".attach/#{@name}.smil"}, @name]]]
332
+ end
333
+ end
334
+
335
+ class Video < Media
336
+ end
337
+
338
+ class VideoTime
339
+ def initialize(arg=0)
340
+ @sec = @min = @hour = 0
341
+ @str = nil
342
+ if arg.kind_of? String
343
+ @str = arg
344
+ ar = @str.split(/:/)
345
+ @sec = ar.pop
346
+ @min = ar.pop
347
+ @hour = ar.empty? ? 0 : ar.pop
348
+ end
349
+ # start 2000/01/01 00:00
350
+ @t = Time.gm(2000, 1, 1, @hour, @min, @sec, 0)
351
+ end
352
+ attr_reader :t
353
+
354
+ def -(v)
355
+ @t-v.t
356
+ end
357
+
358
+ def +(v)
359
+ return @t+v if v.kind_of? Numeric
360
+ @t+v.t
361
+ end
362
+
363
+ def to_s
364
+ return @str if @str
365
+ end
366
+ alias inspect to_s
367
+ end
368
+ end
369
+
370
+ if $0 == __FILE__
371
+ require 'qwik/test-common'
372
+ $test = true
373
+ end
374
+
375
+ if defined?($test) && $test
376
+ class TestActMedia < Test::Unit::TestCase
377
+ include TestSession
378
+
379
+ def test_act_media_server
380
+ t_add_user
381
+ res = session('/test/.media_server')
382
+ ok_title('media server')
383
+ end
384
+
385
+ def copy_sample_file
386
+ path = @org_sites_dir.path+'eto/.attach'
387
+ f = path+'sample.avi'
388
+ FileUtils.cp(f.to_s, @site.attach.path)
389
+ end
390
+
391
+ def nutest_act_encode
392
+ copy_sample_file
393
+
394
+ t_add_user
395
+ res = session('/test/.encode')
396
+ ok_title('movie file list')
397
+
398
+ res = session('/test/.encode/nosuchfile.avi')
399
+ ok_title('File not found.')
400
+
401
+ res = session('/test/.encode/sample.avi')
402
+ ok_title('start encoding: sample.avi')
403
+ end
404
+
405
+ def nutest_encode
406
+ copy_sample_file
407
+ rp = Qwik::RealProducer.new(@site)
408
+ rp.encode_all
409
+ end
410
+ end
411
+
412
+ class TestMedia < Test::Unit::TestCase
413
+ def test_all
414
+ end
415
+ end
416
+ end
@@ -0,0 +1,157 @@
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
+ # Under constraction.
7
+
8
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
9
+ require 'qwik/site-member'
10
+
11
+ module Qwik
12
+ class Action
13
+ NotYet_D_ExtMember = {
14
+ :dt => 'Member control function',
15
+ :dd => 'Member control.',
16
+ :dc => "* How to
17
+ ** Member add
18
+ [[.member_add]]
19
+ ** Member list
20
+ [[.member_list]]
21
+ ** Member list in CSV format
22
+ [[.member_list_csv]]
23
+ "
24
+ }
25
+
26
+ def act_member_add
27
+ if @req.query && tomail = @req.query['tomail']
28
+ return member_add_exec(tomail)
29
+ end
30
+ return member_add_form
31
+ end
32
+
33
+ def member_add_form
34
+ return c_notice(_('Add a member')) {
35
+ [[:form, {:action=>".member_add",
36
+ :style=>'text-align: center; margin: 32px 0 32px;'},
37
+ [:p, [:em, _('Mail address to add'), ': ']],
38
+ [:p, [:input, {:name=>'tomail', :class=>'focus'}]],
39
+ [:div, {:class=>'rightbutton'},
40
+ [:input, {:value=>_('Add'), :type=>'submit'}]]],
41
+ [:hr],
42
+ [:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]]
43
+ }
44
+ end
45
+
46
+ def member_add_exec(tomail)
47
+ return member_error(_('Error')) if tomail.nil?
48
+ return member_error(_('Invalid Mail')) if ! MailAddress.valid?(tomail)
49
+ return member_error(_('Already exists')) if @site.member.exist?(tomail)
50
+
51
+ @site.member.add(tomail, @req.user)
52
+
53
+ c_make_log("member_add\t#{tomail}") # member_add
54
+
55
+ return member_error(_('Error')) if ! @site.member.exist?(tomail)
56
+
57
+ return c_notice(_('Member added')) {
58
+ [[:p, _('Member added')],
59
+ [:hr],
60
+ [:p, [:a, {:href=>'.member_add'}, _('Go back')]]]
61
+ }
62
+ end
63
+
64
+ def member_error(title)
65
+ return c_nerror(title) {
66
+ [[:p, title],
67
+ [:hr],
68
+ [:p, [:a, {:href=>'.member_add'}, _('Go back')]]]
69
+ }
70
+ end
71
+
72
+ def act_member_list
73
+ list = @site.member.list
74
+ return c_notice(_('Member list')) {
75
+ [[:ul] + list.sort.map {|user| [:li, user] },
76
+ [:p, _('Member'), ': ', list.length.to_s]]
77
+ }
78
+ end
79
+
80
+ CSV_DIVIDE = 50
81
+ def act_member_list_csv
82
+ list = @site.member.list
83
+ str = ''
84
+ list.sort.each_with_index {|user, i|
85
+ str += user+((i % CSV_DIVIDE == 0) ? "\n" : ', ')
86
+ }
87
+ return c_plain(_('Member list')) {
88
+ [:div, {:class=>'day'},
89
+ [:h2, _('Member list')],
90
+ [:form, {:action=>".member_list_csv"},
91
+ [:textarea, {:class=>'memberlist'}, str]
92
+ ]
93
+ ]
94
+ }
95
+ end
96
+ end
97
+ end
98
+
99
+ if $0 == __FILE__
100
+ require 'qwik/test-common'
101
+ $test = true
102
+ end
103
+
104
+ if defined?($test) && $test
105
+ class TestActMember < Test::Unit::TestCase
106
+ include TestSession
107
+
108
+ def nutest_member_plugin_unit
109
+ ok_wi([:form, {:action=>'1.html'},
110
+ [:p, '新規メンバーを追加します。'],
111
+ [:dl,
112
+ [:dt, 'あなたのメール'],
113
+ [:dd, [:em, 'user@e.com']],
114
+ [:dt, '追加メール'],
115
+ [:dd, [:input, {:name=>'tomail'}]],
116
+ [:dd, '追加したい人のメールアドレスを入力してください。'],
117
+ [:dd, [:input, {:value=>'追加', :type=>'submit'}]]]],
118
+ '{{member_add}}')
119
+ end
120
+
121
+ def test_member_plugin
122
+ t_add_user
123
+
124
+ # test_act_member_add
125
+ res = session('/test/.member_add')
126
+ ok_title('Add a member')
127
+ ok_xp([:form,
128
+ {:action=>".member_add",
129
+ :style=>"text-align: center; margin: 32px 0 32px;"},
130
+ [:p, [:em, "Mail address to add", ": "]],
131
+ [:p, [:input, {:class=>"focus", :name=>"tomail"}]],
132
+ [:div, {:class=>"rightbutton"},
133
+ [:input, {:value=>"Add", :type=>"submit"}]]],
134
+ '//form')
135
+
136
+ res = session('/test/.member_add?tomail=guest@example.com')
137
+ ok_title('Member added')
138
+ ok_eq(true, @site.member.exist?('guest@example.com'))
139
+ ok_eq(',user@e.com,
140
+ ,guest@example.com,user@e.com
141
+ ',
142
+ @site['_SiteMember'].load)
143
+
144
+ # test_act_member_list
145
+ res = session('/test/.member_list')
146
+ ok_title('Member list')
147
+ ok_in([[:ul, [:li, "guest@example.com"], [:li, "user@e.com"]],
148
+ [:p, "Member", ": ", "2"]],
149
+ "//div[@class='section']")
150
+
151
+ # test_act_member_list_csv
152
+ res = session('/test/.member_list_csv')
153
+ ok_title('Member list')
154
+ ok_in(["guest@example.com\nuser@e.com, "], "//textarea")
155
+ end
156
+ end
157
+ end
@@ -0,0 +1,142 @@
1
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
2
+ # This is free software with ABSOLUTELY NO WARRANTY.
3
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
4
+
5
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
6
+
7
+ module Qwik
8
+ class Action
9
+ D_PluginMenu = {
10
+ :dt => 'Menu plugin',
11
+ :dd => 'You can show a pull down menu.',
12
+ :dc => "* Example
13
+ {{hmenu
14
+ - [[Yahoo!|http://www.yahoo.co.jp/]]
15
+ -- [[map|http://map.yahoo.co.jp/]]
16
+ -- [[auctions|http://aunctions.yahoo.co.jp/]]
17
+ - [[Google|http://www.google.co.jp/]]
18
+ -- [[news|http://news.google.com/]]
19
+ -- [[map|http://map.google.com/]]
20
+ - [[qwik|http://qwik.jp/]]
21
+ -- [[hello|http://qwik.jp/HelloQwik/]]
22
+ }}
23
+
24
+ {{br}}
25
+ {{br}}
26
+ {{br}}
27
+ {{br}}
28
+
29
+ {{{
30
+ {{hmenu
31
+ - [[Yahoo!|http://www.yahoo.co.jp/]]
32
+ -- [[map|http://map.yahoo.co.jp/]]
33
+ -- [[auctions|http://aunctions.yahoo.co.jp/]]
34
+ - [[Google|http://www.google.co.jp/]]
35
+ -- [[news|http://news.google.com/]]
36
+ -- [[map|http://map.google.com/]]
37
+ - [[qwik|http://qwik.jp/]]
38
+ -- [[hello|http://qwik.jp/HelloQwik/]]
39
+ }}
40
+ }}}
41
+ "
42
+ }
43
+
44
+ D_PluginMenu_ja = {
45
+ :dt => 'メニュー・プラグイン',
46
+ :dd => 'プルダウン型メニューを作れます。',
47
+ :dc => "* 例
48
+ {{hmenu
49
+ - [[Yahoo!|http://www.yahoo.co.jp/]]
50
+ -- [[map|http://map.yahoo.co.jp/]]
51
+ -- [[auctions|http://aunctions.yahoo.co.jp/]]
52
+ - [[Google|http://www.google.co.jp/]]
53
+ -- [[news|http://news.google.com/]]
54
+ -- [[map|http://map.google.com/]]
55
+ - [[qwik|http://qwik.jp/]]
56
+ -- [[hello|http://qwik.jp/HelloQwik/]]
57
+ }}
58
+
59
+ {{br}}
60
+ {{br}}
61
+ {{br}}
62
+ {{br}}
63
+
64
+ {{{
65
+ {{hmenu
66
+ - [[Yahoo!|http://www.yahoo.co.jp/]]
67
+ -- [[map|http://map.yahoo.co.jp/]]
68
+ -- [[auctions|http://aunctions.yahoo.co.jp/]]
69
+ - [[Google|http://www.google.co.jp/]]
70
+ -- [[news|http://news.google.com/]]
71
+ -- [[map|http://map.google.com/]]
72
+ - [[qwik|http://qwik.jp/]]
73
+ -- [[hello|http://qwik.jp/HelloQwik/]]
74
+ }}
75
+ }}}
76
+ "
77
+ }
78
+
79
+ def plg_hmenu
80
+ ar = []
81
+
82
+ menu_define_style(ar) # Define style first.
83
+
84
+ content = yield
85
+ w = c_res(content)
86
+
87
+ w.each {|e|
88
+ if e.is_a?(Array) && e[0] == :ul
89
+ e.set_attr(:class=>'m1')
90
+ e.each {|ee|
91
+ if ee.is_a?(Array) && ee[0] == :li
92
+ ee.set_attr(:class=>'off')
93
+ ee.set_attr(:onmouseover=>"this.className='on'")
94
+ ee.set_attr(:onmouseout=>"this.className='off'")
95
+ elsif ee.is_a?(Array) && ee[0] == :ul
96
+ ee.set_attr(:class=>'m2')
97
+ end
98
+ }
99
+ end
100
+ }
101
+
102
+ div = [:div, {:class=>'hmenu'}] + w
103
+ ar << div
104
+ return ar
105
+ end
106
+
107
+ def menu_define_style(ar)
108
+ if ! defined?(@menu_defined)
109
+ @menu_defined = true
110
+ ar << [:style, "@import '.theme/css/menu.css';"]
111
+ end
112
+ end
113
+ end
114
+ end
115
+
116
+ if $0 == __FILE__
117
+ require 'qwik/test-common'
118
+ $test = true
119
+ end
120
+
121
+ if defined?($test) && $test
122
+ class TestActMenu < Test::Unit::TestCase
123
+ include TestSession
124
+
125
+ def test_plg_hmenu
126
+ t_add_user
127
+ page = @site.create_new
128
+ page.store("{{hmenu
129
+ - t
130
+ -- s
131
+ }}")
132
+ res = session('/test/1.html')
133
+ menu = [:div, {:class=>'hmenu'},
134
+ [:ul, {:class=>'m1'},
135
+ [:li, {:onmouseover=>"this.className='on'",
136
+ :onmouseout=>"this.className='off'",
137
+ :class=>'off'}, 't'],
138
+ [:ul, {:class=>'m2'}, [:li, 's']]]]
139
+ ok_xp(menu, "//div[@class='hmenu']")
140
+ end
141
+ end
142
+ end