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,295 @@
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/act-password'
7
+ require 'qwik/wabisabi-diff'
8
+ require 'qwik/act-edit'
9
+ require 'qwik/act-monitor'
10
+ require 'qwik/act-event'
11
+ #require 'qwik/act-rrefs'
12
+
13
+ module Qwik
14
+ class Action
15
+ def ext_save(contents=nil, ext='html')
16
+ c_require_login
17
+ c_require_page_exist
18
+
19
+ contents = @req.query['contents'] if contents.nil?
20
+ return c_nerror('contents is nil.') if contents.nil?
21
+
22
+ page = @site[@req.base]
23
+ # Do not delete a page with password
24
+ if contents.empty? && ! page.get_password
25
+ @site.delete(@req.base) # DELETE
26
+ c_make_log('delete') # DELETE
27
+ c_monitor('delete') # DELETE
28
+ # clear_rrefs(@req.base)
29
+ site_updated
30
+ return save_page_deleted
31
+ end
32
+
33
+ newcontents = Page.embed_password(contents) # embed the password
34
+ if ! page.match_password?(newcontents)
35
+ return save_password_does_not_match(contents)
36
+ end
37
+ contents = newcontents
38
+
39
+ contents = contents.gsub(/\r/, '')
40
+ md5hex = @req.query['md5hex']
41
+ md5hex = nil if page.get_password
42
+ begin
43
+ page.put_with_md5(contents, md5hex) # STORE
44
+ rescue PageCollisionError # failed to save?
45
+ return save_conflict(contents)
46
+ end
47
+
48
+ c_make_log('save') # STORE
49
+ c_monitor('save') # STORE
50
+ c_event('save') # STORE
51
+
52
+ url = "#{@req.base}.#{ext}"
53
+
54
+ # update_rrefs
55
+ site_updated
56
+
57
+ return save_page_is_saved(url)
58
+ end
59
+
60
+ def save_page_deleted
61
+ url = 'FrontPage.html'
62
+ c_notice(_('Page is deleted.'), url) {
63
+ [[:h2, _('Page is deleted.')],
64
+ [:p, [:a, {:href=>url}, _('Go next')]]]
65
+ }
66
+ end
67
+
68
+ def save_password_does_not_match(contents)
69
+ message = [:div, {:class=>'day'},
70
+ [:h2, _('Password does not match.')],
71
+ [:div, {:class=>'section'},
72
+ [:p, [:tt, '{{password('], _('Password'), [:tt, ')}}']],
73
+ [:p, _('Please find a line like that above, then input password in parentheses.')]]]
74
+ return generate_edit_page(contents, message)
75
+ end
76
+
77
+ def edit_conflict_message(url, editing_content)
78
+ return [:div, {:class=>'day'},
79
+ [:h2, _('Page edit conflict')],
80
+ [:div, {:class=>'section'},
81
+ [:p, _('Please save the following content to your text editor.'),
82
+ [:a, {:href=>url}, _('Newest page')],
83
+ _(': see this page and re-edit again.')]],
84
+ editing_content]
85
+ end
86
+
87
+ def save_conflict(contents)
88
+ pagename = @req.base
89
+ page = @site[pagename]
90
+ differ = DiffGenerator.generate(contents, page.load)
91
+ return save_edit_conflict(pagename, differ, contents)
92
+ end
93
+
94
+ def save_edit_conflict(pagename, differ, contents)
95
+ url = pagename+'.html'
96
+ editing_contents = [:div, {:class=>'differ'}, differ]
97
+ message = edit_conflict_message(url, editing_contents)
98
+ return generate_edit_page(contents, message)
99
+ end
100
+
101
+ def save_page_is_saved(url)
102
+ return c_notice(_('Page is saved.'), url){
103
+ [[:h2, _('Page is saved.')],
104
+ [:p, [:a, {:href=>url}, _('Go next')]]]
105
+ }
106
+ end
107
+ end
108
+ end
109
+
110
+ if $0 == __FILE__
111
+ require 'qwik/test-common'
112
+ $test = true
113
+ end
114
+
115
+ if defined?($test) && $test
116
+ class TestActSave < Test::Unit::TestCase
117
+ include TestSession
118
+
119
+ def test_save_basic
120
+ t_add_user
121
+
122
+ # Create a new page.
123
+ res = session('POST /test/.new?t=TestPage')
124
+ ok_xp([:a, {:href=>'TestPage.edit'}, 'Edit new page'],
125
+ '//div[@class="section"]/a')
126
+
127
+ res = session('/test/TestPage.edit')
128
+ ok_in(['Edit | TestPage'], 'title')
129
+ ok_in(['* TestPage
130
+ '], 'textarea')
131
+
132
+ # Try to save a nonexistent page.
133
+ res = session('/test/NoSuchPage.save?contents=t')
134
+ #ok_eq(404, @res.status)
135
+ ok_in(['Page not found.'], 'h1')
136
+
137
+ # Save to the page.
138
+ res = session('/test/TestPage.save?contents=t')
139
+ ok_in(['Page is saved.'], 'title')
140
+ ok_in(['Page is saved.'], 'h1')
141
+ ok_eq('t', @site['TestPage'].load)
142
+
143
+ # Delete the page.
144
+ res = session('/test/TestPage.save?contents=') # null content
145
+ ok_in(['Page is deleted.'], 'title')
146
+
147
+ # Try to delete the page again.
148
+ res = session('/test/TestPage.save?contents=') # null content
149
+ ok_in(['Page not found.'], 'title')
150
+ end
151
+
152
+ def test_save_again
153
+ t_add_user
154
+
155
+ page = @site.create_new
156
+ page.store('* t')
157
+ res = session('/test/1.edit') # See the edit page.
158
+ ok_in(['Edit | t'], 'title')
159
+ ok_in(['Edit', ' | ', [:a, {:href=>'1.html'}, 't']], 'h1')
160
+ ok_in(['* t'], 'textarea')
161
+
162
+ # Save to the page.
163
+ res = session('/test/1.save?contents=* t%0A* h2 of 2%0Ah22body%0A')
164
+ ok_in(['Page is saved.'], 'title')
165
+ ok_in(['Page is saved.'], 'h1')
166
+
167
+ # See the result.
168
+ res = session('/test/1.html')
169
+ ok_in(['t'], 'h1')
170
+ end
171
+
172
+ def test_save_new_delete
173
+ t_add_user
174
+
175
+ res = session('/test/') # See the page.
176
+ ok_in(['FrontPage'], 'title')
177
+
178
+ # See the edit page.
179
+ res = session('/test/FrontPage.edit')
180
+ ok_in(['Edit | FrontPage'], 'title')
181
+ assert_attr({:action=>'FrontPage.save', :method=>'POST'}, 'form')
182
+ #ok_in(/^\* FrontPage/, '//textarea')
183
+ ok_xp([:input, {:value=>'dae58ef7afd29544c7196b4cbde04902',
184
+ :type=>'hidden', :name=>'md5hex'}], '//input')
185
+ e = @res.body.get_path('//input')
186
+ md5hex = e[1][:value]
187
+ ok_eq('dae58ef7afd29544c7196b4cbde04902', md5hex)
188
+ ok_xp([:input, {:value=>'Save', :type=>'submit',
189
+ :class=>'submit', :name=>'save'}],
190
+ '//input[2]')
191
+
192
+ # Save to the page.
193
+ res = session("/test/FrontPage.save?md5hex=#{md5hex}&save=Save&contents=* FrontPage%0A[[test]]%0A")
194
+ ok_in(['Page is saved.'], 'title')
195
+ ok_in(['Page is saved.'], 'h1')
196
+ ok_xp([:a, {:href=>'FrontPage.html'}, 'Go next'], '//a')
197
+
198
+ # See the result. The page contains a link to the new page.
199
+ res = session('/test/')
200
+ ok_in(['test', [:a, {:href=>'.new?t=test'},
201
+ [:img, {:src=>'.theme/i/new.png', :alt=>'create'}]]],
202
+ '//div[@class="section"]//span')
203
+ ok_xp([:a, {:href=>'.new?t=test'},
204
+ [:img, {:src=>'.theme/i/new.png', :alt=>'create'}]],
205
+ '//div[@class="section"]//a')
206
+
207
+ # Create a new page.
208
+ res = session('POST /test/.new?t=test')
209
+ ok_in(['New page'], 'title')
210
+ ok_in(['New page'], 'h1')
211
+ ok_xp([:a, {:href=>'test.edit'}, 'Edit new page'],
212
+ '//div[@class="section"]//a')
213
+ ok_eq('* test
214
+ ', @site['test'].load)
215
+
216
+ # See the from page.
217
+ res = session('/test/')
218
+ ok_xp([:a, {:href=>'test.html'}, 'test'],
219
+ '//div[@class="section"]//a')
220
+
221
+ # Try to see a nonexistent page.
222
+ res = session('/test/nosuchpage.html')
223
+ #ok_eq(404, @res.status)
224
+ ok_in(['Page not found.'], 'title')
225
+ ok_in(['Page not found.'], 'h1')
226
+
227
+ # Try to edit a nonexistent page.
228
+ res = session('/test/nosuchpage.edit')
229
+ ok_in(['Page not found.'], 'title')
230
+
231
+ # See the edit page.
232
+ res = session('/test/test.edit')
233
+ ok_in(['* test
234
+ '], 'textarea')
235
+ ok_xp([:input, {:value=>'2f1580c9dc650a5d827ba7bf44be031b',
236
+ :type=>'hidden', :name=>'md5hex'}], '//input')
237
+ md5hex = '2f1580c9dc650a5d827ba7bf44be031b'
238
+
239
+ # Selete the new page.
240
+ res = session("/test/FrontPage.save?md5hex=#{md5hex}&save=Save&contents=")
241
+ ok_in(['Page is deleted.'], 'title')
242
+ ok_in(['Page is deleted.'], 'h1')
243
+ end
244
+
245
+ def test_conflict
246
+ t_add_user
247
+
248
+ page = @site.create_new
249
+ page.store('t1')
250
+
251
+ # See the page
252
+ res = session('/test/1.html')
253
+ ok_xp([:p, 't1'], '//div[@class="section"]/p')
254
+
255
+ # See the edit page.
256
+ res = session('/test/1.edit')
257
+ ok_xp([:textarea, {:id=>'contents', :name=>'contents',
258
+ :cols=>'70', :rows=>'20', :class=>'focus'}, 't1'],
259
+ '//textarea')
260
+ ok_xp([:input, {:value=>'83f1535f99ab0bf4e9d02dfd85d3e3f7',
261
+ :type=>'hidden', :name=>'md5hex'}], '//input')
262
+ ok_xp([:input, {:value=>'Save', :type=>'submit',
263
+ :class=>'submit', :name=>'save'}],
264
+ '//input[2]')
265
+
266
+ # Save the page.
267
+ res = session('/test/1.save?contents=t2&md5hex=83f1535f99ab0bf4e9d02dfd85d3e3f7')
268
+ ok_in(['Page is saved.'], 'title')
269
+ ok_eq('t2', page.load)
270
+
271
+ # See the edit page again.
272
+ res = session('/test/1.edit')
273
+ ok_xp([:textarea, {:id=>'contents', :name=>'contents',
274
+ :cols=>'70', :rows=>'20', :class=>'focus'}, 't2'],
275
+ '//textarea')
276
+ ok_xp([:input, {:value=>'0f826a89cf68c399c5f4cf320c1a5842',
277
+ :type=>'hidden', :name=>'md5hex'}], '//input')
278
+
279
+ # When you are editing the page, another person edited the page.
280
+ page.store('t3')
281
+
282
+ # Try to save the page, but it failed.
283
+ res = session('/test/1.save?contents=t4&md5hex=0f826a89cf68c399c5f4cf320c1a5842')
284
+ ok_in(['Edit | 1'], 'title')
285
+ ok_in(['Page edit conflict'], "//div[@class='message']/h2")
286
+ ok_in(['Please save the following content to your text editor.',
287
+ [:a, {:href=>'1.html'}, 'Newest page'],
288
+ ': see this page and re-edit again.'],
289
+ "//div[@class='message']/p")
290
+ ok_in([[:del, 't4'], [:br], [:ins, 't3'], [:br]],
291
+ "//div[@class='differ']")
292
+ ok_eq('t3', page.load)
293
+ end
294
+ end
295
+ end
@@ -0,0 +1,374 @@
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/act-edit'
7
+ require 'qwik/wabisabi-table'
8
+
9
+ module Qwik
10
+ class Action
11
+ D_PluginSchedule = {
12
+ :dt => 'Input your scuedule plugin',
13
+ :dd => 'You can input your schedule.',
14
+ :dc => "* Example
15
+ {{schedule}}
16
+ {{schedule}}
17
+ You can see a 5x5 table here.
18
+ You can not edit this table because this is a description page.
19
+ "
20
+ }
21
+
22
+ def plg_schedule
23
+ content = nil
24
+ content = yield if block_given?
25
+
26
+ if content.nil? || content.empty? # no contents
27
+ now = @req.start_time
28
+ content = Action.schedule_default_content(now)
29
+ end
30
+
31
+ w = c_parse(content)
32
+ return p_error(_('You can only use a table.')) if 1 < w.length
33
+
34
+ table = w[0]
35
+ if table.nil? || table[0] != :table
36
+ return p_error(_('You can only use a table.'))
37
+ end
38
+
39
+ if WabisabiTable.error_check(table)
40
+ return p_error(_('You can only use text.'))
41
+ end
42
+
43
+ WabisabiTable.prepare(table)
44
+
45
+ # @schedule_num is global for an action.
46
+ @schedule_num = 0 if !defined?(@schedule_num)
47
+ @schedule_num += 1
48
+ num = @schedule_num
49
+
50
+ action = "#{@req.base}.#{num}.schedule"
51
+ div = [:div, {:class=>'table'},
52
+ [:form, {:method=>'POST', :action=>action},
53
+ table,
54
+ [:div, {:class=>'submit'},
55
+ [:input, {:type=>'submit', :value=>_('Update')}]]]]
56
+ return div
57
+ end
58
+
59
+ def self.schedule_default_content(now)
60
+ content = ''
61
+ date = 'Date'
62
+ content << "|#{date}|A|B|C|D|E\n"
63
+ 5.times {|n|
64
+ theday = Time.at(now.to_i + (n+1) * (60*60*24))
65
+ ymd = theday.ymd
66
+ content << "|#{ymd}|||||\n"
67
+ }
68
+ return content
69
+ end
70
+
71
+ def ext_schedule
72
+ num = @req.ext_args[0].to_i
73
+ return c_nerror(_('Error')) if num < 1
74
+
75
+ query = @req.query
76
+ new_table_str = schedule_construct(query)
77
+
78
+ begin
79
+ plugin_edit(:schedule, num) {
80
+ new_table_str
81
+ }
82
+ rescue NoCorrespondingPlugin
83
+ return c_nerror(_('Failed'))
84
+ rescue PageCollisionError
85
+ url = "#{@req.base}.html"
86
+ editing_content = [:pre, new_table_str]
87
+ message = edit_conflict_message(url, editing_content)
88
+ return mcomment_error(_('Page collision detected.')) {
89
+ message
90
+ }
91
+ end
92
+
93
+ c_make_log('schedule') # COMMENT
94
+
95
+ url = "#{@req.base}.html"
96
+ return c_notice(_('Schedule'), url){
97
+ [[:h2, _('Schedule edit done.')],
98
+ [:p, [:a, {:href=>url}, _('Go back')]]]
99
+ }
100
+ end
101
+
102
+ def schedule_construct(query)
103
+ table = []
104
+ query.each {|k, v|
105
+ prefix, col, row = k.split('_')
106
+ next if prefix != 't' || col.nil? || row.nil?
107
+ col = col.to_i
108
+ row = row.to_i
109
+ table[row] = [] if table[row].nil?
110
+ table[row][col] = v
111
+ }
112
+
113
+ # Check last row
114
+ last_tr = table.last
115
+ empty = true
116
+ last_tr.each {|col|
117
+ if col && ! col.empty?
118
+ empty = false
119
+ end
120
+ }
121
+ if empty
122
+ table[table.length-1] = nil # Delete the last row.
123
+ end
124
+
125
+ str = ''
126
+ table.each_with_index {|row, y|
127
+ next if row.nil?
128
+ row.each_with_index {|col, x|
129
+ str << "|#{col}"
130
+ }
131
+ str << "\n"
132
+ }
133
+
134
+ return str
135
+ end
136
+ end
137
+ end
138
+
139
+ if $0 == __FILE__
140
+ require 'qwik/test-common'
141
+ $test = true
142
+ end
143
+
144
+ if defined?($test) && $test
145
+ class TestActSchedule < Test::Unit::TestCase
146
+ include TestSession
147
+
148
+ def test_schedule
149
+ now = Time.at(0)
150
+ content = Qwik::Action.schedule_default_content(now)
151
+ ok_eq('|Date|A|B|C|D|E
152
+ |1970-01-02|||||
153
+ |1970-01-03|||||
154
+ |1970-01-04|||||
155
+ |1970-01-05|||||
156
+ |1970-01-06|||||
157
+ ', content)
158
+ end
159
+
160
+ def test_plg_schedule
161
+ t_add_user
162
+ ok_wi([:div, {:class=>'error'},
163
+ [:strong, 'Error', ':'], ' ', 'You can only use a table.'],
164
+ '{{schedule
165
+ a
166
+ }}')
167
+ ok_wi([:div, {:class=>'error'},
168
+ [:strong, 'Error', ':'], ' ', 'You can only use a table.'],
169
+ '{{schedule
170
+ |a
171
+
172
+ |b
173
+ }}')
174
+ ok_wi(
175
+ [:div,
176
+ {:class=>'table'},
177
+ [:form,
178
+ {:action=>'1.1.schedule', :method=>'POST'},
179
+ [:table,
180
+ [:tr,
181
+ [:th, [:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}]],
182
+ [:th,
183
+ {:class=>'new_col'},
184
+ [:input, {:size=>'1', :value=>'', :name=>'t_1_0'}]],
185
+ [:td,
186
+ {:class=>'new_col_button'},
187
+ [:a, {:href=>'javascript:show_new_col();'}, '>>']]],
188
+ [:tr,
189
+ {:class=>'new_row'},
190
+ [:th, [:input, {:size=>'1', :value=>'', :name=>'t_0_1'}]],
191
+ [:td,
192
+ {:class=>'new_col'},
193
+ [:input, {:size=>'1', :value=>'', :name=>'t_1_1'}]]],
194
+ [:tr,
195
+ {:class=>'new_row_button_row'},
196
+ [:td,
197
+ {:class=>'new_row_button'},
198
+ [:a, {:href=>'javascript:show_new_row();'}, 'v']]]],
199
+ [:div, {:class=>'submit'}, [:input, {:value=>'Update', :type=>'submit'}]]]],
200
+ '{{schedule
201
+ |a
202
+ }}')
203
+
204
+ ok_wi(
205
+ [:div,
206
+ {:class=>'table'},
207
+ [:form,
208
+ {:action=>'1.1.schedule', :method=>'POST'},
209
+ [:table,
210
+ [:tr,
211
+ [:th, [:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}]],
212
+ [:th, [:input, {:size=>'1', :value=>'b', :name=>'t_1_0'}]],
213
+ [:th,
214
+ {:class=>'new_col'},
215
+ [:input, {:size=>'1', :value=>'', :name=>'t_2_0'}]],
216
+ [:td,
217
+ {:class=>'new_col_button'},
218
+ [:a, {:href=>'javascript:show_new_col();'}, '>>']]],
219
+ [:tr,
220
+ [:th, [:input, {:size=>'1', :value=>'c', :name=>'t_0_1'}]],
221
+ [:td, [:input, {:size=>'1', :value=>'d', :name=>'t_1_1'}]],
222
+ [:td,
223
+ {:class=>'new_col'},
224
+ [:input, {:size=>'1', :value=>'', :name=>'t_2_1'}]]],
225
+ [:tr,
226
+ {:class=>'new_row'},
227
+ [:th, [:input, {:size=>'1', :value=>'', :name=>'t_0_2'}]],
228
+ [:td, [:input, {:size=>'1', :value=>'', :name=>'t_1_2'}]],
229
+ [:td,
230
+ {:class=>'new_col'},
231
+ [:input, {:size=>'1', :value=>'', :name=>'t_2_2'}]]],
232
+ [:tr,
233
+ {:class=>'new_row_button_row'},
234
+ [:td,
235
+ {:class=>'new_row_button'},
236
+ [:a, {:href=>'javascript:show_new_row();'}, 'v']]]],
237
+ [:div, {:class=>'submit'}, [:input, {:value=>'Update', :type=>'submit'}]]]],
238
+ '{{schedule
239
+ |a|b
240
+ |c|d
241
+ }}')
242
+ end
243
+
244
+ def test_ext_schedule
245
+ t_add_user
246
+ page = @site.create_new
247
+ page.store('{{schedule
248
+ |a
249
+ }}')
250
+
251
+ res = session('/test/1.html')
252
+ expected = [:form,
253
+ {:action=>'1.1.schedule', :method=>'POST'},
254
+ [:table,
255
+ [:tr,
256
+ [:th, [:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}]],
257
+ [:th,
258
+ {:class=>'new_col'},
259
+ [:input, {:size=>'1', :value=>'', :name=>'t_1_0'}]],
260
+ [:td,
261
+ {:class=>'new_col_button'},
262
+ [:a, {:href=>'javascript:show_new_col();'}, '>>']]],
263
+ [:tr,
264
+ {:class=>'new_row'},
265
+ [:th, [:input, {:size=>'1', :value=>'', :name=>'t_0_1'}]],
266
+ [:td,
267
+ {:class=>'new_col'},
268
+ [:input, {:size=>'1', :value=>'', :name=>'t_1_1'}]]],
269
+ [:tr,
270
+ {:class=>'new_row_button_row'},
271
+ [:td,
272
+ {:class=>'new_row_button'},
273
+ [:a, {:href=>'javascript:show_new_row();'}, 'v']]]],
274
+ [:div, {:class=>'submit'}, [:input, {:value=>'Update', :type=>'submit'}]]]
275
+ ok_in(expected, "//div[@class='table']")
276
+
277
+ res = session('/test/1.1.schedule?t_0_0=bb')
278
+ ok_in(['Schedule edit done.'], '//h2')
279
+
280
+ res = session('/test/1.html')
281
+ ok_xp([:input, {:size=>'2', :value=>'bb', :name=>'t_0_0'}],
282
+ "//div[@class='table']/form/input")
283
+
284
+ ok_eq('{{schedule
285
+ |bb
286
+ }}
287
+ ', page.load)
288
+
289
+ end
290
+
291
+ def test_ext_schedule2
292
+ t_add_user
293
+ page = @site.create_new
294
+ page.store('b
295
+ {{schedule
296
+ |a
297
+ }}
298
+ c
299
+ ')
300
+ res = session('/test/1.html')
301
+ ok_in([:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}],
302
+ "//div[@class='table']/table/tr/th")
303
+
304
+ res = session('/test/1.1.schedule?t_0_0=bb')
305
+ ok_in(['Schedule edit done.'], '//h2')
306
+
307
+ ok_eq('b
308
+ {{schedule
309
+ |bb
310
+ }}
311
+ c
312
+ ', page.load)
313
+ end
314
+
315
+ def test_ext_schedule_dbl
316
+ t_add_user
317
+ page = @site.create_new
318
+ page.store('p1
319
+ {{schedule
320
+ |a
321
+ }}
322
+ {{schedule
323
+ |b
324
+ }}
325
+ p2
326
+ ')
327
+ res = session('/test/1.html')
328
+ ok_in([:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}],
329
+ "//div[@class='table']/table/tr/th")
330
+
331
+ res = session('/test/1.1.schedule?t_0_0=bb')
332
+ ok_in(['Schedule edit done.'], '//h2')
333
+
334
+ ok_eq('p1
335
+ {{schedule
336
+ |bb
337
+ }}
338
+ {{schedule
339
+ |b
340
+ }}
341
+ p2
342
+ ', page.load)
343
+ end
344
+
345
+ def test_ext_schedule_with_mail
346
+ t_add_user
347
+ page = @site.create_new
348
+ page.store('p1
349
+ {{schedule
350
+ |a
351
+ }}
352
+ {{mail
353
+ m
354
+ }}
355
+ p2
356
+ ')
357
+ res = session('/test/1.html')
358
+ ok_in([:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}],
359
+ "//div[@class='table']/table/tr/th")
360
+
361
+ res = session('/test/1.1.schedule?t_0_0=bb')
362
+ ok_in(['Schedule edit done.'], '//h2')
363
+ ok_eq('p1
364
+ {{schedule
365
+ |bb
366
+ }}
367
+ {{mail
368
+ m
369
+ }}
370
+ p2
371
+ ', page.load)
372
+ end
373
+ end
374
+ end