qwik2md 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/qwik2md +17 -0
- data/lib/qwik2md/version.rb +3 -0
- data/lib/qwik2md.rb +39 -0
- data/qwik2md.gemspec +30 -0
- data/vendor/qwik/AUTHORS +10 -0
- data/vendor/qwik/COPYING +340 -0
- data/vendor/qwik/COPYRIGHT +346 -0
- data/vendor/qwik/lib/qwik/Makefile +63 -0
- data/vendor/qwik/lib/qwik/Rakefile +17 -0
- data/vendor/qwik/lib/qwik/act-aa.rb +83 -0
- data/vendor/qwik/lib/qwik/act-archive.rb +386 -0
- data/vendor/qwik/lib/qwik/act-attach.rb +304 -0
- data/vendor/qwik/lib/qwik/act-backup.rb +236 -0
- data/vendor/qwik/lib/qwik/act-basic.rb +325 -0
- data/vendor/qwik/lib/qwik/act-book.rb +161 -0
- data/vendor/qwik/lib/qwik/act-calc.rb +371 -0
- data/vendor/qwik/lib/qwik/act-charset.rb +251 -0
- data/vendor/qwik/lib/qwik/act-christel.rb +112 -0
- data/vendor/qwik/lib/qwik/act-chronology.rb +149 -0
- data/vendor/qwik/lib/qwik/act-code.rb +155 -0
- data/vendor/qwik/lib/qwik/act-comment.rb +554 -0
- data/vendor/qwik/lib/qwik/act-config.rb +49 -0
- data/vendor/qwik/lib/qwik/act-counter.rb +125 -0
- data/vendor/qwik/lib/qwik/act-day.rb +96 -0
- data/vendor/qwik/lib/qwik/act-describe.rb +135 -0
- data/vendor/qwik/lib/qwik/act-diary.rb +109 -0
- data/vendor/qwik/lib/qwik/act-edit.rb +317 -0
- data/vendor/qwik/lib/qwik/act-embed-html.rb +296 -0
- data/vendor/qwik/lib/qwik/act-emode.rb +150 -0
- data/vendor/qwik/lib/qwik/act-event.rb +187 -0
- data/vendor/qwik/lib/qwik/act-file.rb +303 -0
- data/vendor/qwik/lib/qwik/act-files.rb +771 -0
- data/vendor/qwik/lib/qwik/act-getpass.rb +295 -0
- data/vendor/qwik/lib/qwik/act-history.rb +136 -0
- data/vendor/qwik/lib/qwik/act-html.rb +204 -0
- data/vendor/qwik/lib/qwik/act-httpauth.rb +147 -0
- data/vendor/qwik/lib/qwik/act-include.rb +142 -0
- data/vendor/qwik/lib/qwik/act-interwiki.rb +189 -0
- data/vendor/qwik/lib/qwik/act-isearch.rb +109 -0
- data/vendor/qwik/lib/qwik/act-keywords.rb +137 -0
- data/vendor/qwik/lib/qwik/act-lang.rb +81 -0
- data/vendor/qwik/lib/qwik/act-license.rb +63 -0
- data/vendor/qwik/lib/qwik/act-list.rb +287 -0
- data/vendor/qwik/lib/qwik/act-login.rb +410 -0
- data/vendor/qwik/lib/qwik/act-logout.rb +60 -0
- data/vendor/qwik/lib/qwik/act-mail.rb +159 -0
- data/vendor/qwik/lib/qwik/act-map.rb +292 -0
- data/vendor/qwik/lib/qwik/act-md5.rb +42 -0
- data/vendor/qwik/lib/qwik/act-mdlb.rb +741 -0
- data/vendor/qwik/lib/qwik/act-media.rb +416 -0
- data/vendor/qwik/lib/qwik/act-member.rb +157 -0
- data/vendor/qwik/lib/qwik/act-menu.rb +142 -0
- data/vendor/qwik/lib/qwik/act-metadata.rb +323 -0
- data/vendor/qwik/lib/qwik/act-mlsubmitform.rb +49 -0
- data/vendor/qwik/lib/qwik/act-monitor.rb +167 -0
- data/vendor/qwik/lib/qwik/act-new.rb +418 -0
- data/vendor/qwik/lib/qwik/act-pagelist.rb +248 -0
- data/vendor/qwik/lib/qwik/act-password.rb +145 -0
- data/vendor/qwik/lib/qwik/act-plan.rb +210 -0
- data/vendor/qwik/lib/qwik/act-povray.rb +230 -0
- data/vendor/qwik/lib/qwik/act-presen.rb +380 -0
- data/vendor/qwik/lib/qwik/act-redirect.rb +133 -0
- data/vendor/qwik/lib/qwik/act-ring.rb +1071 -0
- data/vendor/qwik/lib/qwik/act-rrefs.rb +255 -0
- data/vendor/qwik/lib/qwik/act-ruby.rb +116 -0
- data/vendor/qwik/lib/qwik/act-sample.rb +170 -0
- data/vendor/qwik/lib/qwik/act-save.rb +295 -0
- data/vendor/qwik/lib/qwik/act-schedule.rb +374 -0
- data/vendor/qwik/lib/qwik/act-search.rb +180 -0
- data/vendor/qwik/lib/qwik/act-searchwords.rb +51 -0
- data/vendor/qwik/lib/qwik/act-sendpass.rb +83 -0
- data/vendor/qwik/lib/qwik/act-site.rb +89 -0
- data/vendor/qwik/lib/qwik/act-sitebackup.rb +419 -0
- data/vendor/qwik/lib/qwik/act-sitelog.rb +118 -0
- data/vendor/qwik/lib/qwik/act-smil.rb +299 -0
- data/vendor/qwik/lib/qwik/act-status.rb +220 -0
- data/vendor/qwik/lib/qwik/act-style.rb +608 -0
- data/vendor/qwik/lib/qwik/act-table.rb +263 -0
- data/vendor/qwik/lib/qwik/act-tableform.rb +241 -0
- data/vendor/qwik/lib/qwik/act-tag.rb +103 -0
- data/vendor/qwik/lib/qwik/act-text.rb +70 -0
- data/vendor/qwik/lib/qwik/act-textarea.rb +164 -0
- data/vendor/qwik/lib/qwik/act-theme.rb +346 -0
- data/vendor/qwik/lib/qwik/act-toc.rb +112 -0
- data/vendor/qwik/lib/qwik/act-typekey.rb +198 -0
- data/vendor/qwik/lib/qwik/act-under-const.rb +94 -0
- data/vendor/qwik/lib/qwik/act-webservice.rb +321 -0
- data/vendor/qwik/lib/qwik/act-wema.rb +558 -0
- data/vendor/qwik/lib/qwik/act-wysiwyg.rb +238 -0
- data/vendor/qwik/lib/qwik/action.rb +325 -0
- data/vendor/qwik/lib/qwik/autoreload.rb +98 -0
- data/vendor/qwik/lib/qwik/bench-bench.rb +28 -0
- data/vendor/qwik/lib/qwik/bench-emode.rb +47 -0
- data/vendor/qwik/lib/qwik/bench-format-xml.rb +70 -0
- data/vendor/qwik/lib/qwik/bench-large-table.rb +62 -0
- data/vendor/qwik/lib/qwik/bench-md5.rb +14 -0
- data/vendor/qwik/lib/qwik/bench-module-session.rb +19 -0
- data/vendor/qwik/lib/qwik/bench-page.rb +50 -0
- data/vendor/qwik/lib/qwik/bench-s-md5.rb +28 -0
- data/vendor/qwik/lib/qwik/bench-session.rb +25 -0
- data/vendor/qwik/lib/qwik/bench-textformat.rb +31 -0
- data/vendor/qwik/lib/qwik/catalog-factory.rb +91 -0
- data/vendor/qwik/lib/qwik/catalog-ja.rb +479 -0
- data/vendor/qwik/lib/qwik/catalog-ml-ja.rb +145 -0
- data/vendor/qwik/lib/qwik/check-act-monitor.rb +112 -0
- data/vendor/qwik/lib/qwik/check-act-monitor2.rb +46 -0
- data/vendor/qwik/lib/qwik/check-act-theme.rb +27 -0
- data/vendor/qwik/lib/qwik/check-event.rb +112 -0
- data/vendor/qwik/lib/qwik/check-event2.rb +55 -0
- data/vendor/qwik/lib/qwik/check-htree-rexml.rb +77 -0
- data/vendor/qwik/lib/qwik/check-htree.rb +51 -0
- data/vendor/qwik/lib/qwik/check-libxml.rb +135 -0
- data/vendor/qwik/lib/qwik/check-many-pages.rb +47 -0
- data/vendor/qwik/lib/qwik/check-monitor.rb +33 -0
- data/vendor/qwik/lib/qwik/check-observer.rb +67 -0
- data/vendor/qwik/lib/qwik/check-server.rb +61 -0
- data/vendor/qwik/lib/qwik/check-uuencode.rb +33 -0
- data/vendor/qwik/lib/qwik/check-webdav.rb +65 -0
- data/vendor/qwik/lib/qwik/check-xml-xpath.rb +27 -0
- data/vendor/qwik/lib/qwik/common-backtrace.rb +94 -0
- data/vendor/qwik/lib/qwik/common-basic.rb +111 -0
- data/vendor/qwik/lib/qwik/common-condition.rb +142 -0
- data/vendor/qwik/lib/qwik/common-error.rb +48 -0
- data/vendor/qwik/lib/qwik/common-gettext.rb +50 -0
- data/vendor/qwik/lib/qwik/common-javascript.rb +45 -0
- data/vendor/qwik/lib/qwik/common-notice.rb +132 -0
- data/vendor/qwik/lib/qwik/common-plain.rb +105 -0
- data/vendor/qwik/lib/qwik/common-plugin.rb +111 -0
- data/vendor/qwik/lib/qwik/common-res.rb +76 -0
- data/vendor/qwik/lib/qwik/common-resolve.rb +92 -0
- data/vendor/qwik/lib/qwik/common-send.rb +171 -0
- data/vendor/qwik/lib/qwik/common-session.rb +139 -0
- data/vendor/qwik/lib/qwik/common-surface.rb +261 -0
- data/vendor/qwik/lib/qwik/common-url.rb +90 -0
- data/vendor/qwik/lib/qwik/compat/Makefile +12 -0
- data/vendor/qwik/lib/qwik/compat/add_load_path.rb +1 -0
- data/vendor/qwik/lib/qwik/config.rb +299 -0
- data/vendor/qwik/lib/qwik/db-b-backup.rb +142 -0
- data/vendor/qwik/lib/qwik/db-backup.rb +184 -0
- data/vendor/qwik/lib/qwik/db-berkeley.rb +306 -0
- data/vendor/qwik/lib/qwik/db-filesystem.rb +305 -0
- data/vendor/qwik/lib/qwik/db-indexer.rb +154 -0
- data/vendor/qwik/lib/qwik/db-searchwords.rb +238 -0
- data/vendor/qwik/lib/qwik/description-ja.rb +267 -0
- data/vendor/qwik/lib/qwik/description.rb +256 -0
- data/vendor/qwik/lib/qwik/dev-add-copyright.rb +23 -0
- data/vendor/qwik/lib/qwik/dev-backup.rb +24 -0
- data/vendor/qwik/lib/qwik/dev-bench.rb +175 -0
- data/vendor/qwik/lib/qwik/dev-calctime.rb +52 -0
- data/vendor/qwik/lib/qwik/dev-css-compressor.rb +60 -0
- data/vendor/qwik/lib/qwik/dev-extract-catalog.rb +102 -0
- data/vendor/qwik/lib/qwik/dev-js-compressor.rb +73 -0
- data/vendor/qwik/lib/qwik/dev-release.rb +235 -0
- data/vendor/qwik/lib/qwik/dev-replace.rb +353 -0
- data/vendor/qwik/lib/qwik/dev-sendmail.rb +25 -0
- data/vendor/qwik/lib/qwik/farm.rb +283 -0
- data/vendor/qwik/lib/qwik/gettext.rb +56 -0
- data/vendor/qwik/lib/qwik/group-cond.rb +157 -0
- data/vendor/qwik/lib/qwik/group-config.rb +247 -0
- data/vendor/qwik/lib/qwik/group-confirm.rb +147 -0
- data/vendor/qwik/lib/qwik/group-db.rb +326 -0
- data/vendor/qwik/lib/qwik/group-mail.rb +195 -0
- data/vendor/qwik/lib/qwik/group-member.rb +307 -0
- data/vendor/qwik/lib/qwik/group-sendmail.rb +231 -0
- data/vendor/qwik/lib/qwik/group-site.rb +374 -0
- data/vendor/qwik/lib/qwik/group-sweep.rb +63 -0
- data/vendor/qwik/lib/qwik/group.rb +157 -0
- data/vendor/qwik/lib/qwik/helper.rb +6 -0
- data/vendor/qwik/lib/qwik/html-generator.rb +104 -0
- data/vendor/qwik/lib/qwik/html-to-wabisabi.rb +148 -0
- data/vendor/qwik/lib/qwik/htree-diff.rb +87 -0
- data/vendor/qwik/lib/qwik/htree-format-xml.rb +57 -0
- data/vendor/qwik/lib/qwik/htree-generator.rb +144 -0
- data/vendor/qwik/lib/qwik/htree-get.rb +251 -0
- data/vendor/qwik/lib/qwik/htree-html-generator.rb +179 -0
- data/vendor/qwik/lib/qwik/htree-template.rb +263 -0
- data/vendor/qwik/lib/qwik/htree-to-wabisabi.rb +171 -0
- data/vendor/qwik/lib/qwik/loadlib.rb +79 -0
- data/vendor/qwik/lib/qwik/logger.rb +115 -0
- data/vendor/qwik/lib/qwik/mail-body.rb +171 -0
- data/vendor/qwik/lib/qwik/mail-header.rb +474 -0
- data/vendor/qwik/lib/qwik/mail-multipart.rb +193 -0
- data/vendor/qwik/lib/qwik/mail-parse.rb +147 -0
- data/vendor/qwik/lib/qwik/mail.rb +341 -0
- data/vendor/qwik/lib/qwik/mailaddress.rb +83 -0
- data/vendor/qwik/lib/qwik/mdlb-model.rb +81 -0
- data/vendor/qwik/lib/qwik/mdlb-sample.rb +324 -0
- data/vendor/qwik/lib/qwik/ml-catalog-factory.rb +27 -0
- data/vendor/qwik/lib/qwik/ml-exception.rb +15 -0
- data/vendor/qwik/lib/qwik/ml-generator.rb +28 -0
- data/vendor/qwik/lib/qwik/ml-gettext.rb +137 -0
- data/vendor/qwik/lib/qwik/ml-logger.rb +82 -0
- data/vendor/qwik/lib/qwik/ml-memory.rb +65 -0
- data/vendor/qwik/lib/qwik/ml-msg-validator.rb +86 -0
- data/vendor/qwik/lib/qwik/ml-processor.rb +609 -0
- data/vendor/qwik/lib/qwik/ml-quickml-server.rb +122 -0
- data/vendor/qwik/lib/qwik/ml-sendmail.rb +0 -0
- data/vendor/qwik/lib/qwik/ml-server.rb +107 -0
- data/vendor/qwik/lib/qwik/ml-session.rb +348 -0
- data/vendor/qwik/lib/qwik/ml-sweeper.rb +101 -0
- data/vendor/qwik/lib/qwik/mock-logger.rb +65 -0
- data/vendor/qwik/lib/qwik/mock-sendmail.rb +78 -0
- data/vendor/qwik/lib/qwik/mock-socket.rb +82 -0
- data/vendor/qwik/lib/qwik/modulobe.rb +406 -0
- data/vendor/qwik/lib/qwik/mongrel-server.rb +72 -0
- data/vendor/qwik/lib/qwik/page-files.rb +249 -0
- data/vendor/qwik/lib/qwik/page-generate.rb +82 -0
- data/vendor/qwik/lib/qwik/page-get.rb +262 -0
- data/vendor/qwik/lib/qwik/page-images.rb +168 -0
- data/vendor/qwik/lib/qwik/page-put.rb +128 -0
- data/vendor/qwik/lib/qwik/page-rrefs.rb +154 -0
- data/vendor/qwik/lib/qwik/page-title.rb +0 -0
- data/vendor/qwik/lib/qwik/page-wikidb.rb +234 -0
- data/vendor/qwik/lib/qwik/page.rb +67 -0
- data/vendor/qwik/lib/qwik/pages.rb +444 -0
- data/vendor/qwik/lib/qwik/parse-plugin.rb +249 -0
- data/vendor/qwik/lib/qwik/parser-emode.rb +116 -0
- data/vendor/qwik/lib/qwik/parser-inline.rb +272 -0
- data/vendor/qwik/lib/qwik/parser.rb +349 -0
- data/vendor/qwik/lib/qwik/password.rb +183 -0
- data/vendor/qwik/lib/qwik/periodic.rb +79 -0
- data/vendor/qwik/lib/qwik/qp.rb +56 -0
- data/vendor/qwik/lib/qwik/qwik-service.rb +341 -0
- data/vendor/qwik/lib/qwik/qwik.rb +5 -0
- data/vendor/qwik/lib/qwik/qwikweb-adduser.rb +34 -0
- data/vendor/qwik/lib/qwik/qwikweb-catalog-validator.rb +110 -0
- data/vendor/qwik/lib/qwik/qwikweb-incgen.rb +28 -0
- data/vendor/qwik/lib/qwik/qwikweb-makesite.rb +41 -0
- data/vendor/qwik/lib/qwik/qwikweb-server.rb +44 -0
- data/vendor/qwik/lib/qwik/qwikweb-showpassword.rb +26 -0
- data/vendor/qwik/lib/qwik/qwikweb-watchlog.rb +67 -0
- data/vendor/qwik/lib/qwik/request-path.rb +304 -0
- data/vendor/qwik/lib/qwik/request-ua.rb +76 -0
- data/vendor/qwik/lib/qwik/request-webrick.rb +81 -0
- data/vendor/qwik/lib/qwik/request.rb +91 -0
- data/vendor/qwik/lib/qwik/resolve-tdiary.rb +292 -0
- data/vendor/qwik/lib/qwik/resolve.rb +121 -0
- data/vendor/qwik/lib/qwik/response.rb +228 -0
- data/vendor/qwik/lib/qwik/server-memory.rb +57 -0
- data/vendor/qwik/lib/qwik/server-webrick.rb +102 -0
- data/vendor/qwik/lib/qwik/server.rb +252 -0
- data/vendor/qwik/lib/qwik/site-config.rb +149 -0
- data/vendor/qwik/lib/qwik/site-db.rb +136 -0
- data/vendor/qwik/lib/qwik/site-event.rb +162 -0
- data/vendor/qwik/lib/qwik/site-files.rb +86 -0
- data/vendor/qwik/lib/qwik/site-group.rb +103 -0
- data/vendor/qwik/lib/qwik/site-index.rb +47 -0
- data/vendor/qwik/lib/qwik/site-log.rb +64 -0
- data/vendor/qwik/lib/qwik/site-member.rb +230 -0
- data/vendor/qwik/lib/qwik/site-monitor.rb +97 -0
- data/vendor/qwik/lib/qwik/site-pages.rb +62 -0
- data/vendor/qwik/lib/qwik/site-plan.rb +139 -0
- data/vendor/qwik/lib/qwik/site-report.rb +282 -0
- data/vendor/qwik/lib/qwik/site-resolve.rb +230 -0
- data/vendor/qwik/lib/qwik/site-rrefs.rb +18 -0
- data/vendor/qwik/lib/qwik/site-search.rb +180 -0
- data/vendor/qwik/lib/qwik/site-timeline.rb +153 -0
- data/vendor/qwik/lib/qwik/site-url.rb +189 -0
- data/vendor/qwik/lib/qwik/site.rb +76 -0
- data/vendor/qwik/lib/qwik/smil-time.rb +105 -0
- data/vendor/qwik/lib/qwik/smtp-session.rb +331 -0
- data/vendor/qwik/lib/qwik/template-generator.rb +149 -0
- data/vendor/qwik/lib/qwik/template.rb +85 -0
- data/vendor/qwik/lib/qwik/test-common.rb +10 -0
- data/vendor/qwik/lib/qwik/test-ml-info.rb +225 -0
- data/vendor/qwik/lib/qwik/test-module-ml.rb +142 -0
- data/vendor/qwik/lib/qwik/test-module-path.rb +110 -0
- data/vendor/qwik/lib/qwik/test-module-public.rb +70 -0
- data/vendor/qwik/lib/qwik/test-module-server.rb +98 -0
- data/vendor/qwik/lib/qwik/test-module-session.rb +264 -0
- data/vendor/qwik/lib/qwik/test-module-suite.rb +91 -0
- data/vendor/qwik/lib/qwik/test-ms-applemail.rb +59 -0
- data/vendor/qwik/lib/qwik/test-ms-attach.rb +174 -0
- data/vendor/qwik/lib/qwik/test-ms-basic.rb +40 -0
- data/vendor/qwik/lib/qwik/test-ms-close.rb +35 -0
- data/vendor/qwik/lib/qwik/test-ms-confirm.rb +75 -0
- data/vendor/qwik/lib/qwik/test-ms-ignore-spam.rb +57 -0
- data/vendor/qwik/lib/qwik/test-ms-japanese.rb +97 -0
- data/vendor/qwik/lib/qwik/test-ms-jfilename.rb +82 -0
- data/vendor/qwik/lib/qwik/test-ms-large.rb +58 -0
- data/vendor/qwik/lib/qwik/test-ms-member.rb +103 -0
- data/vendor/qwik/lib/qwik/test-ms-multipart.rb +84 -0
- data/vendor/qwik/lib/qwik/test-ms-org.rb +129 -0
- data/vendor/qwik/lib/qwik/test-ms-plan.rb +130 -0
- data/vendor/qwik/lib/qwik/test-ms-post.rb +53 -0
- data/vendor/qwik/lib/qwik/test-ms-quopri.rb +76 -0
- data/vendor/qwik/lib/qwik/test-sub-quopri.rb +45 -0
- data/vendor/qwik/lib/qwik/test-submit-base64.rb +59 -0
- data/vendor/qwik/lib/qwik/test-submit-forward.rb +61 -0
- data/vendor/qwik/lib/qwik/test-submit-html-mail.rb +52 -0
- data/vendor/qwik/lib/qwik/test-submit-japanese.rb +135 -0
- data/vendor/qwik/lib/qwik/test-submit-jfilename.rb +144 -0
- data/vendor/qwik/lib/qwik/test-submit-uuencode.rb +71 -0
- data/vendor/qwik/lib/qwik/test-suite-all.rb +8 -0
- data/vendor/qwik/lib/qwik/test-suite-basic.rb +9 -0
- data/vendor/qwik/lib/qwik/test-suite-ml.rb +9 -0
- data/vendor/qwik/lib/qwik/test-typekey.rb +64 -0
- data/vendor/qwik/lib/qwik/testunit.rb +45 -0
- data/vendor/qwik/lib/qwik/tokenizer-inline.rb +288 -0
- data/vendor/qwik/lib/qwik/tokenizer.rb +331 -0
- data/vendor/qwik/lib/qwik/typekey.rb +160 -0
- data/vendor/qwik/lib/qwik/util-basic.rb +135 -0
- data/vendor/qwik/lib/qwik/util-charset.rb +331 -0
- data/vendor/qwik/lib/qwik/util-css.rb +56 -0
- data/vendor/qwik/lib/qwik/util-csv-tokenizer.rb +113 -0
- data/vendor/qwik/lib/qwik/util-filename.rb +112 -0
- data/vendor/qwik/lib/qwik/util-pathname.rb +202 -0
- data/vendor/qwik/lib/qwik/util-pid.rb +58 -0
- data/vendor/qwik/lib/qwik/util-safe.rb +67 -0
- data/vendor/qwik/lib/qwik/util-sendmail.rb +273 -0
- data/vendor/qwik/lib/qwik/util-string.rb +202 -0
- data/vendor/qwik/lib/qwik/util-time.rb +125 -0
- data/vendor/qwik/lib/qwik/util-webrick.rb +176 -0
- data/vendor/qwik/lib/qwik/version.rb +11 -0
- data/vendor/qwik/lib/qwik/wabisabi-basic.rb +163 -0
- data/vendor/qwik/lib/qwik/wabisabi-diff.rb +130 -0
- data/vendor/qwik/lib/qwik/wabisabi-format-xml.rb +310 -0
- data/vendor/qwik/lib/qwik/wabisabi-generator.rb +262 -0
- data/vendor/qwik/lib/qwik/wabisabi-index.rb +174 -0
- data/vendor/qwik/lib/qwik/wabisabi-table.rb +212 -0
- data/vendor/qwik/lib/qwik/wabisabi-template.rb +295 -0
- data/vendor/qwik/lib/qwik/wabisabi-to-htree.rb +111 -0
- data/vendor/qwik/lib/qwik/wabisabi-to-wiki.rb +690 -0
- data/vendor/qwik/lib/qwik/wabisabi-traverse.rb +207 -0
- data/vendor/qwik/lib/qwik/wabisabi-validator.rb +116 -0
- data/vendor/qwik/lib/qwik/wabisabi.rb +5 -0
- metadata +492 -0
@@ -0,0 +1,112 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/test-module-server'
|
7
|
+
|
8
|
+
if $0 == __FILE__
|
9
|
+
$test = true
|
10
|
+
end
|
11
|
+
|
12
|
+
module TestMonitorModule
|
13
|
+
include TestServerSetupModule
|
14
|
+
include TestServerModule
|
15
|
+
|
16
|
+
def setup_monitor
|
17
|
+
Thread.abort_on_exception = true
|
18
|
+
|
19
|
+
server, config, memory, wreq, wres = setup_server
|
20
|
+
server_thread = Thread.new { server.start }
|
21
|
+
|
22
|
+
write_page('_SiteMember', ",user@e.com\n")
|
23
|
+
write_page('1', "*t\np")
|
24
|
+
|
25
|
+
return server
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if defined?($test) && $test
|
30
|
+
class CheckActMonitor < Test::Unit::TestCase
|
31
|
+
include TestMonitorModule
|
32
|
+
|
33
|
+
# http://colinux:9190/HelloQwik/ActMonitor.html
|
34
|
+
def test_act_monitor
|
35
|
+
return if $0 != __FILE__ # Only for unit test.
|
36
|
+
|
37
|
+
server = setup_monitor
|
38
|
+
|
39
|
+
str = get_path('1.html')
|
40
|
+
ok_in(['t'], '//title', str)
|
41
|
+
ok_in([:p, 'p'], "//div[@class='section']", str)
|
42
|
+
|
43
|
+
t = Thread.new {
|
44
|
+
sleep 0.1
|
45
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
46
|
+
ok_in(['Page is saved.'], '//title', str)
|
47
|
+
ok_eq("*t2\np2", read_page('1'))
|
48
|
+
}
|
49
|
+
|
50
|
+
str = get_path('1.monitor') # Wait for update.
|
51
|
+
ok_in([:p, 'p2'], "//div[@class='section']", str)
|
52
|
+
|
53
|
+
t.join # Wait for the thread.
|
54
|
+
|
55
|
+
teardown_server(server)
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_monitor_in_thread
|
59
|
+
return if $0 != __FILE__ # Only for unit test.
|
60
|
+
|
61
|
+
server = setup_monitor
|
62
|
+
|
63
|
+
str = get_path('1.html')
|
64
|
+
ok_in(['t'], '//title', str)
|
65
|
+
ok_in([:p, 'p'], "//div[@class='section']", str)
|
66
|
+
|
67
|
+
t = Thread.new {
|
68
|
+
str = get_path('1.monitor') # Wait for update.
|
69
|
+
ok_in([:p, 'p2'], "//div[@class='section']", str)
|
70
|
+
}
|
71
|
+
|
72
|
+
sleep 0.1
|
73
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
74
|
+
ok_in(['Page is saved.'], '//title', str)
|
75
|
+
ok_eq("*t2\np2", read_page('1'))
|
76
|
+
|
77
|
+
t.join # Wait for the thread.
|
78
|
+
|
79
|
+
teardown_server(server)
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_several_monitors
|
83
|
+
return if $0 != __FILE__ # Only for unit test.
|
84
|
+
|
85
|
+
server = setup_monitor
|
86
|
+
|
87
|
+
str = get_path('1.html')
|
88
|
+
ok_in(['t'], '//title', str)
|
89
|
+
ok_in([:p, 'p'], "//div[@class='section']", str)
|
90
|
+
|
91
|
+
t1 = Thread.new {
|
92
|
+
str1 = get_path('1.monitor') # Wait for update.
|
93
|
+
ok_in([:p, 'p2'], "//div[@class='section']", str1)
|
94
|
+
}
|
95
|
+
|
96
|
+
t2 = Thread.new {
|
97
|
+
str2 = get_path('1.monitor') # Wait for update.
|
98
|
+
ok_in([:p, 'p2'], "//div[@class='section']", str2)
|
99
|
+
}
|
100
|
+
|
101
|
+
sleep 0.1
|
102
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
103
|
+
ok_in(['Page is saved.'], '//title', str)
|
104
|
+
ok_eq("*t2\np2", read_page('1'))
|
105
|
+
|
106
|
+
t1.join # Wait for the thread.
|
107
|
+
t2.join # Wait for the thread.
|
108
|
+
|
109
|
+
teardown_server(server)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/check-act-monitor'
|
7
|
+
|
8
|
+
if $0 == __FILE__
|
9
|
+
require 'qwik/server'
|
10
|
+
$test = true
|
11
|
+
end
|
12
|
+
|
13
|
+
if defined?($test) && $test
|
14
|
+
class CheckActMonitor2 < Test::Unit::TestCase
|
15
|
+
include TestMonitorModule
|
16
|
+
|
17
|
+
def test_many_monitors
|
18
|
+
return if $0 != __FILE__ # Only for unit test.
|
19
|
+
|
20
|
+
server = setup_monitor
|
21
|
+
|
22
|
+
ts = []
|
23
|
+
res = []
|
24
|
+
max = 15 # OK.
|
25
|
+
#max = 10 # Not OK.
|
26
|
+
(0..max).each {|i|
|
27
|
+
ts[i] = Thread.new {
|
28
|
+
res[i] = get_path('1.monitor') # Wait for update.
|
29
|
+
p res[i]
|
30
|
+
#ok_in([:p, 'p2'], "//div[@class='section']", res[i])
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
sleep 0.1
|
35
|
+
str = get_path('1.save?contents=*t2%0Ap2') # Save to the page.
|
36
|
+
ok_in(['Page is saved.'], '//title', str)
|
37
|
+
ok_eq("*t2\np2", read_page('1'))
|
38
|
+
|
39
|
+
(0..max).each {|i|
|
40
|
+
ts[i].join # Wait for the thread.
|
41
|
+
}
|
42
|
+
|
43
|
+
teardown_server(server)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/test-common'
|
7
|
+
require 'qwik/act-theme'
|
8
|
+
|
9
|
+
class CheckExternalCss < Test::Unit::TestCase
|
10
|
+
include TestSession
|
11
|
+
|
12
|
+
def test_all
|
13
|
+
return if $0 != __FILE__ # Only for separated test.
|
14
|
+
|
15
|
+
# test_extcss_nosuch
|
16
|
+
res = session '/.css/http://nosuchhostname/q.css'
|
17
|
+
ok_title 'Access Failed'
|
18
|
+
|
19
|
+
# test_extcss_hatena
|
20
|
+
res = session '/.css/http://d.hatena.ne.jp/theme/clover/clover.css'
|
21
|
+
if @res.body.is_a?(Array)
|
22
|
+
ok_title 'Access Failed'
|
23
|
+
else
|
24
|
+
#eq true, 1000 < @res.body.length
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/test-module-server'
|
7
|
+
|
8
|
+
if $0 == __FILE__
|
9
|
+
$test = true
|
10
|
+
end
|
11
|
+
|
12
|
+
module CheckEventModule
|
13
|
+
include TestServerSetupModule
|
14
|
+
include TestServerModule
|
15
|
+
|
16
|
+
def setup_event
|
17
|
+
Thread.abort_on_exception = true
|
18
|
+
|
19
|
+
server, config, memory, wreq, wres = setup_server
|
20
|
+
server_thread = Thread.new { server.start }
|
21
|
+
|
22
|
+
write_page('_SiteMember', ",user@e.com\n")
|
23
|
+
write_page('1', "*t\np")
|
24
|
+
|
25
|
+
return server
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if defined?($test) && $test
|
30
|
+
class CheckEvent < Test::Unit::TestCase
|
31
|
+
include CheckEventModule
|
32
|
+
|
33
|
+
# http://colinux:9190/HelloQwik/ActMonitor.html
|
34
|
+
def test_1
|
35
|
+
return if $0 != __FILE__ # Only for unit test.
|
36
|
+
|
37
|
+
server = setup_event
|
38
|
+
|
39
|
+
str = get_path('1.html')
|
40
|
+
ok_in(['t'], '//title', str)
|
41
|
+
ok_in([:p, 'p'], "//div[@class='section']", str)
|
42
|
+
|
43
|
+
t = Thread.new {
|
44
|
+
sleep 0.1
|
45
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
46
|
+
ok_in(['Page is saved.'], '//title', str)
|
47
|
+
ok_eq("*t2\np2", read_page('1'))
|
48
|
+
}
|
49
|
+
|
50
|
+
str = get_path('1.event') # Wait for update.
|
51
|
+
#ok_eq(",0,user@e.com,1,save,save\n", str)
|
52
|
+
#ok_in([:p, 'p2'], "//div[@class='section']", str)
|
53
|
+
|
54
|
+
t.join # Wait for the thread.
|
55
|
+
|
56
|
+
teardown_server(server)
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_2
|
60
|
+
return if $0 != __FILE__ # Only for unit test.
|
61
|
+
|
62
|
+
server = setup_event
|
63
|
+
|
64
|
+
str = get_path('1.html')
|
65
|
+
ok_in(['t'], '//title', str)
|
66
|
+
ok_in([:p, 'p'], "//div[@class='section']", str)
|
67
|
+
|
68
|
+
t = Thread.new {
|
69
|
+
str = get_path('1.event') # Wait for update.
|
70
|
+
ok_eq(",0,user@e.com,1,save,save\n", str)
|
71
|
+
}
|
72
|
+
|
73
|
+
sleep 0.1
|
74
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
75
|
+
ok_in(['Page is saved.'], '//title', str)
|
76
|
+
ok_eq("*t2\np2", read_page('1'))
|
77
|
+
|
78
|
+
t.join # Wait for the thread.
|
79
|
+
|
80
|
+
teardown_server(server)
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_3
|
84
|
+
return if $0 != __FILE__ # Only for unit test.
|
85
|
+
|
86
|
+
server = setup_event
|
87
|
+
|
88
|
+
str = get_path('1.html')
|
89
|
+
ok_in(['t'], '//title', str)
|
90
|
+
ok_in([:p, 'p'], "//div[@class='section']", str)
|
91
|
+
|
92
|
+
t1 = Thread.new {
|
93
|
+
str1 = get_path('1.event') # Wait for update.
|
94
|
+
ok_eq(",0,user@e.com,1,save,save\n", str1)
|
95
|
+
}
|
96
|
+
t2 = Thread.new {
|
97
|
+
str2 = get_path('1.event') # Wait for update.
|
98
|
+
ok_eq(",0,user@e.com,1,save,save\n", str2)
|
99
|
+
}
|
100
|
+
|
101
|
+
sleep 0.1
|
102
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
103
|
+
ok_in(['Page is saved.'], '//title', str)
|
104
|
+
ok_eq("*t2\np2", read_page('1'))
|
105
|
+
|
106
|
+
t1.join # Wait for the thread.
|
107
|
+
t2.join # Wait for the thread.
|
108
|
+
|
109
|
+
teardown_server(server)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/check-event'
|
7
|
+
|
8
|
+
if $0 == __FILE__
|
9
|
+
$test = true
|
10
|
+
end
|
11
|
+
|
12
|
+
if defined?($test) && $test
|
13
|
+
class CheckEvent2 < Test::Unit::TestCase
|
14
|
+
include CheckEventModule
|
15
|
+
|
16
|
+
def test_many
|
17
|
+
return if $0 != __FILE__ # Only for unit test.
|
18
|
+
|
19
|
+
server = setup_event
|
20
|
+
|
21
|
+
ts = []
|
22
|
+
res = []
|
23
|
+
max = 15 # OK.
|
24
|
+
#max = 10 # Not OK.
|
25
|
+
(0..max).each {|i|
|
26
|
+
ts[i] = Thread.new {
|
27
|
+
res[i] = get_path('1.event') # Wait for update.
|
28
|
+
#ok_in([:p, 'p2'], "//div[@class='section']", res[i])
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
loop {
|
33
|
+
str = get_path("1.save?contents=*t2%0Ap2") # Save to the page.
|
34
|
+
ok_in(['Page is saved.'], '//title', str)
|
35
|
+
ok_eq("*t2\np2", read_page('1'))
|
36
|
+
|
37
|
+
sleep 0.1
|
38
|
+
|
39
|
+
endok = true
|
40
|
+
(0..max).each {|i|
|
41
|
+
if ts[i].status != false
|
42
|
+
endok = false
|
43
|
+
end
|
44
|
+
}
|
45
|
+
break if endok
|
46
|
+
}
|
47
|
+
|
48
|
+
(0..max).each {|i|
|
49
|
+
ts[i].join # Wait for the thread.
|
50
|
+
}
|
51
|
+
|
52
|
+
teardown_server(server)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH << 'compat' unless $LOAD_PATH.include? 'compat'
|
6
|
+
require 'htree'
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
9
|
+
require 'qwik/testunit'
|
10
|
+
|
11
|
+
class CheckHTree < Test::Unit::TestCase
|
12
|
+
def test_htree_to_rexml
|
13
|
+
str = '<p>あ</p>'
|
14
|
+
ok_eq("\202\240", 'あ') # Kanji code is SJIS.
|
15
|
+
h = HTree(str)
|
16
|
+
|
17
|
+
x = ''
|
18
|
+
h.display_xml(x)
|
19
|
+
ok_eq("<p\n>\202\240</p\n>", x)
|
20
|
+
|
21
|
+
r = h.to_rexml
|
22
|
+
ok_eq("<p>\202\240</p>", r.to_s)
|
23
|
+
#ok_eq(" <p>\202\240</p>", r.to_s(1))
|
24
|
+
|
25
|
+
html = <<'EOT'
|
26
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head id='header'><title>新規作成</title><link href="/.theme/base.css" rel='stylesheet' media="screen,tv" type="text/css"/><link href="/.theme/qwiksystem/qwiksystem.css" rel='stylesheet' media="screen,tv" type="text/css"/><meta name='ROBOTS' content="NOINDEX,NOFOLLOW"/><meta content="0; url=FirstPage.edit" http-equiv='Refresh'/></head><body><div class='container'><div class='header'><div><div><h1 id="view_title">新規作成</h1></div></div></div><div class="update day"><div class='form'><div class='msg' id='msg'><h2>新規作成</h2><p>新規ページを作成しました</p><p><a href="FirstPage.edit">新規ページを編集</a>してください。</p><p><a href="FirstPage.edit">FirstPage.edit</a></p></div></div></div><div class="update day"><div class='comment'></div></div></div></body></html>
|
27
|
+
EOT
|
28
|
+
h = HTree(html)
|
29
|
+
r = h.to_rexml
|
30
|
+
e = <<'EOT'
|
31
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html xmlns='http://www.w3.org/1999/xhtml'><head id='header'><title>新規作成</title><link href='/.theme/base.css' rel='stylesheet' type='text/css' media='screen,tv'/><link href='/.theme/qwiksystem/qwiksystem.css' rel='stylesheet' type='text/css' media='screen,tv'/><meta name='ROBOTS' content='NOINDEX,NOFOLLOW'/><meta content='0; url=FirstPage.edit' http-equiv='Refresh'/></head><body><div class='container'><div class='header'><div><div><h1 id='view_title'>新規作成</h1></div></div></div><div class='update day'><div class='form'><div class='msg' id='msg'><h2>新規作成</h2><p>新規ページを作成しました</p><p><a href='FirstPage.edit'>新規ページを編集</a>してください。</p><p><a href='FirstPage.edit'>FirstPage.edit</a></p></div></div></div><div class='update day'><div class='comment'/></div></div></body></html>
|
32
|
+
EOT
|
33
|
+
ok_eq(e, r.to_s)
|
34
|
+
|
35
|
+
e = <<'EOT'
|
36
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
37
|
+
<html xmlns='http://www.w3.org/1999/xhtml'>
|
38
|
+
<head id='header'>
|
39
|
+
<title>新規作成</title>
|
40
|
+
<link href='/.theme/base.css' rel='stylesheet' type='text/css' media='screen,tv'/>
|
41
|
+
<link href='/.theme/qwiksystem/qwiksystem.css' rel='stylesheet' type='text/css' media='screen,tv'/>
|
42
|
+
<meta name='ROBOTS' content='NOINDEX,NOFOLLOW'/>
|
43
|
+
<meta content='0; url=FirstPage.edit' http-equiv='Refresh'/>
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
<div class='container'>
|
47
|
+
<div class='header'>
|
48
|
+
<div>
|
49
|
+
<div>
|
50
|
+
<h1 id='view_title'>新規作成</h1>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
<div class='update day'>
|
55
|
+
<div class='form'>
|
56
|
+
<div class='msg' id='msg'>
|
57
|
+
<h2>新規作成</h2>
|
58
|
+
<p>新規ページを作成しました</p>
|
59
|
+
<p>
|
60
|
+
<a href='FirstPage.edit'>新規ページを編集</a>してください。</p>
|
61
|
+
<p>
|
62
|
+
<a href='FirstPage.edit'>FirstPage.edit</a>
|
63
|
+
</p>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
<div class='update day'>
|
68
|
+
<div class='comment'/>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
</body>
|
72
|
+
</html>
|
73
|
+
|
74
|
+
EOT
|
75
|
+
#ok_eq(e, r.to_s(0))
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH << 'compat' unless $LOAD_PATH.include? 'compat'
|
6
|
+
require 'htree'
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
9
|
+
require 'qwik/testunit'
|
10
|
+
|
11
|
+
class CheckHTree < Test::Unit::TestCase
|
12
|
+
def assert_xhtml(expected, template, message=nil) # from htree/test
|
13
|
+
prefix = "<html\n>"
|
14
|
+
suffix = "</html\n>"
|
15
|
+
result = HTree.expand_template(''){"<html>#{template}</html>"}
|
16
|
+
assert_match(/\A#{Regexp.quote prefix}/, result)
|
17
|
+
assert_match(/#{Regexp.quote suffix}\z/, result)
|
18
|
+
result = result[prefix.length..(-suffix.length-1)]
|
19
|
+
ok_eq(expected, result, message)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_htree
|
23
|
+
return # do not test.
|
24
|
+
|
25
|
+
assert_xhtml("<b\n>t</b\n>", '<b>t</b>')
|
26
|
+
assert_xhtml("<e\n>1</e\n>", '<e _text=1>d</e>')
|
27
|
+
str = '<html><e _text=1>d</e></html>'
|
28
|
+
|
29
|
+
doc = HTree(str) # doc is a template
|
30
|
+
assert_instance_of(HTree::Doc, doc)
|
31
|
+
assert_instance_of(HTree::Elem, doc.root)
|
32
|
+
ok_eq('{http://www.w3.org/1999/xhtml}html', doc.root.name)
|
33
|
+
assert_instance_of(HTree::Elem, doc.root.children[0])
|
34
|
+
assert_instance_of(HTree::Elem, doc.root.children[0])
|
35
|
+
assert_instance_of(HTree::Text, doc.root.children[0].children[0])
|
36
|
+
assert_instance_of(String, doc.root.children[0].children[0].rcdata)
|
37
|
+
ok_eq('d', doc.root.children[0].children[0].rcdata)
|
38
|
+
|
39
|
+
doc = HTree{str} # doc is a document. the template is evaluated.
|
40
|
+
assert_instance_of(HTree::Doc, doc)
|
41
|
+
assert_instance_of(HTree::Elem, doc.root)
|
42
|
+
assert_instance_of(HTree::Elem, doc.root.children[0])
|
43
|
+
assert_instance_of(HTree::Text, doc.root.children[0].children[0])
|
44
|
+
ok_eq('1', doc.root.children[0].children[0].rcdata)
|
45
|
+
|
46
|
+
str = "<html>\n <body _text=\"body\"></body>\n</html>"
|
47
|
+
body = 'b'
|
48
|
+
result = HTree.expand_template(''){str}
|
49
|
+
ok_eq("<html\n><body\n>b</body\n></html\n>", result)
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/test-common'
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'xml/libxml'
|
10
|
+
$have_libxml_so = true
|
11
|
+
rescue LoadError
|
12
|
+
$have_libxml_so = false
|
13
|
+
end
|
14
|
+
|
15
|
+
if $0 == __FILE__
|
16
|
+
$test = true
|
17
|
+
end
|
18
|
+
|
19
|
+
class TestLibXml < Test::Unit::TestCase
|
20
|
+
def test_parser
|
21
|
+
str = <<'EOT'
|
22
|
+
<html><head id='header'><title>FrontPage - example.com/test</title><link href="/.theme/qwikgreen/qwikgreen.css" rel='stylesheet' media="screen,tv,print" type="text/css"/><link href="/.theme/base.css" rel='stylesheet' media="screen,tv,print" type="text/css"/></head><body><div class='container'><div class='main'><div class='adminmenu' id='adminmenu'><p><span class='loginstatus'>user | <em>user@e.com</em> (<a href=".logout">.logout</a>)</span></p>
|
23
|
+
<ul><li><a href=".new">新規作成</a></li>
|
24
|
+
<li><a href="FrontPage.edit">編集</a></li>
|
25
|
+
</ul>
|
26
|
+
</div><h1 id="view_title">FrontPage</h1><div id='body'><div class='day'><h2>FrontPage</h2><div class='body'><div class='section'>
|
27
|
+
<p>これは新規qwikWebサイトの入口となるページです。</p>
|
28
|
+
<h3>使い方</h3>
|
29
|
+
<p>ページの上の方にある「編集」というリンクをたどると、このページの編集モードになります。</p>
|
30
|
+
<p>表示されたテキストの内容を変更し、「Save」ボタンをクリックすると、このページの内容が変更されます。</p>
|
31
|
+
<h3>記述方法</h3>
|
32
|
+
<p>ページの内容はテキストで書かれており、いくつかの記号によって見出しなどの指定をします。詳しい情報は、<a href="/test/TextFormat.html">TextFormat</a>をご覧下さい。</p>
|
33
|
+
<h3>qwikWeb</h3>
|
34
|
+
<p>詳しくは、<a href="http://example.com/" class='external'>qwikWeb</a>ホームページをご覧ください。</p>
|
35
|
+
<h3>QuickML</h3>
|
36
|
+
<p>メーリングリスト機能の使い方は、<a href="http://www.quickml.com/" class='external'>QuickML</a>ホームページをご覧ください。</p>
|
37
|
+
</div></div></div></div><div id="body_leave"><div class='day'><div class='comment'><div class='caption'><div class="page_attribute"><p><div class='qrcode'><a href="http://example.com/test/" class='external'><img src=".attach/qrcode-test.png" alt="http://example.com/test/"/><br/>http://example.com/test/</a></div><div>last modified: 2004-05-20</div></p>
|
38
|
+
</div></div></div><div class="body_leave"></div></div></div></div><div class='sidebar' id='sidemenu'><h2>menu</h2>
|
39
|
+
<ul><li><a href="/test/FrontPage.html">FrontPage</a></li>
|
40
|
+
<li><a href="/test/TitleList.html">TitleList</a></li>
|
41
|
+
<li><a href="/test/RecentList.html">RecentList</a></li>
|
42
|
+
<li><a href="/test/TextFormat.html">TextFormat</a></li>
|
43
|
+
<li><a href="/test/_SiteMenu.html">_SiteMenu</a></li>
|
44
|
+
</ul>
|
45
|
+
<h2>recent change</h2>
|
46
|
+
<p><h3>2004-09-09</h3>
|
47
|
+
<ul><li><a href="/test/_SiteMember.html">_SiteMember</a></li>
|
48
|
+
</ul>
|
49
|
+
</p>
|
50
|
+
</div><div class='footer' id='footer'><p>powered by <a href="http://example.com/" class='external'>qwikWeb</a></p>
|
51
|
+
</div></div></body></html>
|
52
|
+
EOT
|
53
|
+
|
54
|
+
if $have_libxml_so
|
55
|
+
ok_eq('2.6.11', XML::Parser::LIBXML_VERSION)
|
56
|
+
ok_eq(28, XML::Parser::VERNUM)
|
57
|
+
xp = XML::Parser.new
|
58
|
+
xp.string = str.page_to_xml
|
59
|
+
doc = xp.parse
|
60
|
+
assert_instance_of(XML::Document, doc)
|
61
|
+
e = nil
|
62
|
+
doc.find('//a'){|ee|
|
63
|
+
e = ee
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_text
|
69
|
+
if $have_libxml_so
|
70
|
+
xp = XML::Parser.new
|
71
|
+
xp.string = '<html><p><b>a</b></p></html>'
|
72
|
+
doc = xp.parse
|
73
|
+
assert_instance_of(XML::Document, doc)
|
74
|
+
e = nil
|
75
|
+
doc.find('//title'){|e|
|
76
|
+
e = ee
|
77
|
+
}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
class TestAssertXPath < Test::Unit::TestCase
|
83
|
+
include TestSession
|
84
|
+
|
85
|
+
def test_ok_xp
|
86
|
+
t_add_user
|
87
|
+
session('/test/')
|
88
|
+
ok_in(['FrontPage'], '//h1')
|
89
|
+
ok_xp([:a, {:href=>'.logout'}, 'Logout'], '//a')
|
90
|
+
ok_in(['Logout'], '//a')
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
class CheckLibXml_OriginalTest < Test::Unit::TestCase
|
95
|
+
def make_sample_xml
|
96
|
+
str = "<nodes>\n"
|
97
|
+
10000.times {|i|
|
98
|
+
str << '<node sum="1" avg="'+i.to_s+'">Node sample text</node>'+"\n"
|
99
|
+
}
|
100
|
+
str << "</nodes>\n"
|
101
|
+
str
|
102
|
+
end
|
103
|
+
|
104
|
+
def nutest_rexml #9.851 seconds.
|
105
|
+
require 'rexml/document'
|
106
|
+
xmlStr = make_sample_xml
|
107
|
+
doc = REXML::Document.new xmlStr
|
108
|
+
sum = avgSum = count = 0
|
109
|
+
doc.elements.each('/nodes/node') { |e|
|
110
|
+
count += 1
|
111
|
+
sum += e.attributes['sum'].to_i
|
112
|
+
avgSum += e.attributes['avg'].to_i
|
113
|
+
}
|
114
|
+
puts "count(node): #{count}, sum(sum): #{sum}, avg(avg): #{avgSum/count}"
|
115
|
+
end
|
116
|
+
|
117
|
+
def nutest_libxml #4.685 seconds
|
118
|
+
require 'xml/libxml'
|
119
|
+
xmlStr = make_sample_xml
|
120
|
+
xp = XML::Parser.new
|
121
|
+
xp.string = xmlStr
|
122
|
+
doc = xp.parse
|
123
|
+
sum = avgSum = count = 0
|
124
|
+
doc.find('/nodes/node').each { |e|
|
125
|
+
count += 1
|
126
|
+
sum += e['sum'].to_i
|
127
|
+
avgSum += e['avg'].to_i
|
128
|
+
}
|
129
|
+
puts "count(node): #{count}, sum(sum): #{sum}, avg(avg): #{avgSum/count}"
|
130
|
+
end
|
131
|
+
|
132
|
+
def test_dummy #0.117 seconds.
|
133
|
+
xmlStr = make_sample_xml
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
|
7
|
+
if $0 == __FILE__
|
8
|
+
require 'qwik/test-common'
|
9
|
+
$test = true
|
10
|
+
end
|
11
|
+
|
12
|
+
if defined?($test) && $test
|
13
|
+
class CheckManyPages < Test::Unit::TestCase
|
14
|
+
include TestSession
|
15
|
+
|
16
|
+
def test_all
|
17
|
+
t_add_user
|
18
|
+
|
19
|
+
# page = @site.create_new
|
20
|
+
# page.store("* t")
|
21
|
+
# res = session('/test/1.html')
|
22
|
+
# ok_title('t')
|
23
|
+
# page = @site['1']
|
24
|
+
|
25
|
+
# num = 200
|
26
|
+
num = 10
|
27
|
+
(1..num).each {|n|
|
28
|
+
page = @site.create_new
|
29
|
+
page.store("* t#{n}")
|
30
|
+
}
|
31
|
+
(1..num).each {|n|
|
32
|
+
res = session("/test/#{n}.html")
|
33
|
+
ok_title("t#{n}")
|
34
|
+
}
|
35
|
+
|
36
|
+
#100 Finished in 28.170425 seconds.
|
37
|
+
|
38
|
+
#100 Finished in 9.680146 seconds.
|
39
|
+
#200 Finished in 28.170425 seconds.
|
40
|
+
#1000 Finished in 603.93911 seconds.
|
41
|
+
|
42
|
+
#100 Finished in 4.67007 seconds.
|
43
|
+
#200 Finished in 9.030136 seconds.
|
44
|
+
#1000 Finished in 47.230712 seconds.
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|