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,410 @@
|
|
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
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
7
|
+
require 'qwik/mail'
|
8
|
+
require 'qwik/password'
|
9
|
+
require 'qwik/act-httpauth'
|
10
|
+
require 'qwik/act-typekey'
|
11
|
+
require 'qwik/act-logout'
|
12
|
+
require 'qwik/act-getpass'
|
13
|
+
|
14
|
+
module Qwik
|
15
|
+
class Action
|
16
|
+
D_QwikWebLogin = {
|
17
|
+
:dt => 'qwikWeb login',
|
18
|
+
:dd => 'You can login by using three auth methods.',
|
19
|
+
:dc => "* How to
|
20
|
+
** Login by TypeKey
|
21
|
+
You can login by using TypeKey authentication.
|
22
|
+
In login screen, you see 'Log in by TypeKey' link.
|
23
|
+
Follow the link and login at the TypeKey authentication page.
|
24
|
+
Since the qwikWeb system uses your mailaddress for the authentication,
|
25
|
+
it is necessary to select to tell your mail address.
|
26
|
+
** Login by password
|
27
|
+
Please input your mail address as user ID and input your password.
|
28
|
+
The password to login qwikWeb is automatically generated by the system.
|
29
|
+
Please follow 'Get Password' link to get the password.
|
30
|
+
** Login by Basic Authentication
|
31
|
+
You can use Basic Authentication.
|
32
|
+
When you are using a mobile phone that only have Basic Authentication method,
|
33
|
+
please follow 'Log in by Basic Authentication.' link.
|
34
|
+
"
|
35
|
+
}
|
36
|
+
|
37
|
+
D_QwikWebLogin_ja = {
|
38
|
+
:dt => 'qwikWebのログイン',
|
39
|
+
:dd => 'qwikWebでは三種類の認証方法を使えます。',
|
40
|
+
:dc => "* 使い方
|
41
|
+
** TypeKeyによるログイン
|
42
|
+
TypeKey認証でログインすることができます。ログイン画面から「TypeKeyでロ
|
43
|
+
グインする」というリンクをたどってください。TypeKeyによる認証画面があ
|
44
|
+
らわれますので、その画面からログインします。qwikWebでは、メールアドレ
|
45
|
+
スによって認証をしているため、メールアドレスをシステムに通知する必要が
|
46
|
+
あります。
|
47
|
+
|
48
|
+
TypeKeyでのアカウント名ではなく、メールアドレスによって認証するため、
|
49
|
+
登録されているメールアドレスが、そのグループに登録されているメールアド
|
50
|
+
レスと一致している必要があります。
|
51
|
+
** パスワードでログイン
|
52
|
+
ユーザIDの欄に自分のメールアドレスを、またパスワード欄にはパスワードを
|
53
|
+
入力してください。qwikWebにおけるパスワードは、システムが自動的に生成
|
54
|
+
したパスワードが使われます。「パスワードを入手」というリンクをたどると、
|
55
|
+
パスワードを入手できます。
|
56
|
+
** BASIC認証によるログイン
|
57
|
+
BASIC認証も使えます。携帯電話のように、BASIC認証だけしかできない場合は、
|
58
|
+
「BASIC認証」のリンクをたどってください。
|
59
|
+
"
|
60
|
+
}
|
61
|
+
|
62
|
+
# ============================== show status
|
63
|
+
def plg_login_status
|
64
|
+
if @req.user
|
65
|
+
return [:span, {:class=>'loginstatus'},
|
66
|
+
'user', ' | ', plg_login_user,
|
67
|
+
' (', [:a, {:href=>'.logout'}, ('Logout')], ')']
|
68
|
+
else
|
69
|
+
return login_create_login_link
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def nu_login_create_login_link(msg='Login')
|
74
|
+
sitename = @site.sitename
|
75
|
+
pagename = @req.base
|
76
|
+
href = '/.login'
|
77
|
+
href += "?site=#{sitename}" if sitename
|
78
|
+
href += "&page=#{pagename}" if pagename
|
79
|
+
return [:a, {:href=>href}, msg]
|
80
|
+
end
|
81
|
+
|
82
|
+
def login_create_login_link
|
83
|
+
return [:a, {:href=>'.login'}, 'Login']
|
84
|
+
end
|
85
|
+
|
86
|
+
def plg_login_user
|
87
|
+
return [:em, @req.user]
|
88
|
+
end
|
89
|
+
|
90
|
+
# ============================== verify
|
91
|
+
# called from action.rb
|
92
|
+
def login_get_user
|
93
|
+
check_session # act-session: Check session id.
|
94
|
+
return if @req.user
|
95
|
+
|
96
|
+
check_cookie # Get user from cookie.
|
97
|
+
return if @req.user
|
98
|
+
|
99
|
+
check_basicauth # Get user from basicauth.
|
100
|
+
return if @req.user
|
101
|
+
end
|
102
|
+
|
103
|
+
def check_cookie
|
104
|
+
userpass = @req.cookies['userpass']
|
105
|
+
if userpass
|
106
|
+
user, pass = userpass.split(',', 2)
|
107
|
+
else
|
108
|
+
user = @req.cookies['user']
|
109
|
+
pass = @req.cookies['pass']
|
110
|
+
end
|
111
|
+
|
112
|
+
if user
|
113
|
+
return if user.nil? || user.empty?
|
114
|
+
return unless MailAddress.valid?(user)
|
115
|
+
gen = @memory.passgen
|
116
|
+
return unless gen.match?(user, pass)
|
117
|
+
|
118
|
+
@req.user = user
|
119
|
+
@req.auth = 'cookie'
|
120
|
+
|
121
|
+
# Do not move to session id for now.
|
122
|
+
# sid = session_store(user) # Move to session id.
|
123
|
+
# @res.set_cookie('sid', sid) # Set Session id by cookie
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# called from action.rb
|
128
|
+
def login_invalid_user
|
129
|
+
c_nerror(_('Login Error')){[
|
130
|
+
[:p, [:strong, _('Invalid ID (E-mail) or Password.')]],
|
131
|
+
[:p, {:class=>'warning'},
|
132
|
+
_('If you have no password,'), _('Access here'), [:br],
|
133
|
+
[:a, {:href=>'.getpass'}, [:em, _('Get Password')]]],
|
134
|
+
login_page_form,
|
135
|
+
login_page_menu,
|
136
|
+
]}
|
137
|
+
end
|
138
|
+
|
139
|
+
# ============================== login
|
140
|
+
def pre_act_login
|
141
|
+
if @req.user
|
142
|
+
return login_already_logged_in(@req.user)
|
143
|
+
end
|
144
|
+
|
145
|
+
user = @req.query['user'] # login from query
|
146
|
+
pass = @req.query['pass']
|
147
|
+
|
148
|
+
if ! user
|
149
|
+
return c_notice(_('Login')) {
|
150
|
+
login_show_login_page(@site.site_url) # show login page
|
151
|
+
}
|
152
|
+
end
|
153
|
+
|
154
|
+
begin
|
155
|
+
raise InvalidUserError if user.nil? || user.empty?
|
156
|
+
raise InvalidUserError unless MailAddress.valid?(user)
|
157
|
+
gen = @memory.passgen
|
158
|
+
raise InvalidUserError unless gen.match?(user, pass)
|
159
|
+
|
160
|
+
rescue InvalidUserError
|
161
|
+
@res.clear_cookies # IMPORTANT!
|
162
|
+
return login_invalid_user # password does not match
|
163
|
+
end
|
164
|
+
|
165
|
+
sid = session_store(user)
|
166
|
+
@res.set_cookie('sid', sid) # Set Session id by cookie.
|
167
|
+
|
168
|
+
return login_show_login_suceed_page
|
169
|
+
end
|
170
|
+
|
171
|
+
def login_already_logged_in(user)
|
172
|
+
ar = []
|
173
|
+
ar << [:p, _('You are now logged in with this user id.'), [:br],
|
174
|
+
[:strong, user]]
|
175
|
+
ar << [:p, _('If you would like to log in on another account,'), [:br],
|
176
|
+
_('please log out first.')]
|
177
|
+
ar << logout_form
|
178
|
+
ar << [:hr]
|
179
|
+
ar << login_go_frontpage
|
180
|
+
return c_nerror(_('Already logged in.')){ar}
|
181
|
+
end
|
182
|
+
|
183
|
+
def login_go_frontpage
|
184
|
+
style = ''
|
185
|
+
return [:div, {:class=>'go_frontpage',:style=>''},
|
186
|
+
[:a, {:href=>'FrontPage.html', :style=>style}, 'FrontPage']]
|
187
|
+
end
|
188
|
+
|
189
|
+
def login_show_login_page(url)
|
190
|
+
login_msg = nil
|
191
|
+
if page = @site['_LoginMessage']
|
192
|
+
login_msg = [:div, {:class=>'warning'}, c_res(page.load)]
|
193
|
+
end
|
194
|
+
login_target_div = [:div,
|
195
|
+
[:h2, _('Log in to '), [:em, url]],
|
196
|
+
[:p, _('Please input ID (E-mail) and password.')]]
|
197
|
+
|
198
|
+
div = [:div, {:class=>'login_page'}]
|
199
|
+
div << login_target_div
|
200
|
+
div << login_msg if login_msg
|
201
|
+
|
202
|
+
div << login_page_form
|
203
|
+
|
204
|
+
div << [:hr]
|
205
|
+
div << [:div,
|
206
|
+
[:h2, _('If you have no password')],
|
207
|
+
[:p, _('Please input your mail address.')],
|
208
|
+
getpass_form('', '', ''),
|
209
|
+
# [:p, [:a, {:href=>'.sendpass'},
|
210
|
+
# _('You can send password for members.')]],
|
211
|
+
]
|
212
|
+
|
213
|
+
div << [:hr]
|
214
|
+
div << [:div,
|
215
|
+
[:h2, [:a, {:href=>'.typekey'}, _('Log in by TypeKey')]],
|
216
|
+
[:p, _('Please send mail address for authentication.')]]
|
217
|
+
|
218
|
+
div << [:hr]
|
219
|
+
div << [:div,
|
220
|
+
[:h2, [:a, {:href=>'.basicauth'}, _('Log in by Basic Authentication.')]],
|
221
|
+
[:p, _('For mobile phone users')]]
|
222
|
+
|
223
|
+
# div << [:hr]
|
224
|
+
# div << login_page_menu
|
225
|
+
|
226
|
+
style = [:style, '
|
227
|
+
.container {
|
228
|
+
margin-top: 20px;
|
229
|
+
}
|
230
|
+
']
|
231
|
+
|
232
|
+
return [style, div]
|
233
|
+
end
|
234
|
+
|
235
|
+
def login_show_login_suceed_page
|
236
|
+
url = 'FrontPage.html'
|
237
|
+
title = _('Login') + ' ' + _('Success')
|
238
|
+
return c_notice(title, url) {
|
239
|
+
[login_go_frontpage]
|
240
|
+
}
|
241
|
+
end
|
242
|
+
|
243
|
+
private
|
244
|
+
|
245
|
+
def login_page_form
|
246
|
+
return [:div, {:class=>'login'},
|
247
|
+
[:form, {:method=>'POST', :action=>'.login'},
|
248
|
+
[:dl,
|
249
|
+
[:dt, _('ID'), '(E-mail)', ': '],
|
250
|
+
[:dd, [:input, {:name=>'user', :istyle=>'3', :class=>'focus'}]],
|
251
|
+
[:dt, _('Password'), ': '],
|
252
|
+
[:dd, [:input, {:type=>'password', :name=>'pass'}]]],
|
253
|
+
[:p,
|
254
|
+
[:input, {:type=>'submit', :value=>_('Login')}]]]]
|
255
|
+
end
|
256
|
+
|
257
|
+
def login_page_menu
|
258
|
+
return [:ul,
|
259
|
+
# [:li, _("If you don't have password"), ' : ',
|
260
|
+
# [:a, {:href=>'.getpass'}, [:em, _('Get Password')]]],
|
261
|
+
[:li, _('For mobile phone users'), ' : ',
|
262
|
+
[:a, {:href=>'.basicauth'}, _('Log in by Basic Authentication.')]],
|
263
|
+
# [:li,
|
264
|
+
# [:a, {:href=>'.typekey'}, _('Log in by TypeKey')]]
|
265
|
+
]
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
if $0 == __FILE__
|
271
|
+
require 'qwik/test-common'
|
272
|
+
$test = true
|
273
|
+
end
|
274
|
+
|
275
|
+
if defined?($test) && $test
|
276
|
+
class TestActLogin < Test::Unit::TestCase
|
277
|
+
include TestSession
|
278
|
+
|
279
|
+
def assert_cookie(hash, cookies)
|
280
|
+
cookies.each {|cookie|
|
281
|
+
eq cookie.value, hash[cookie.name]
|
282
|
+
}
|
283
|
+
end
|
284
|
+
|
285
|
+
def test_private_site
|
286
|
+
t_add_user
|
287
|
+
|
288
|
+
# See FrontPage.
|
289
|
+
res = session('/test/') {|req|
|
290
|
+
req.cookies.clear
|
291
|
+
}
|
292
|
+
ok_title 'Login'
|
293
|
+
ok_xp([:meta, {:content=>'1; url=/test/.login',
|
294
|
+
'http-equiv'=>'Refresh'}],
|
295
|
+
'//meta[2]')
|
296
|
+
|
297
|
+
# See login page.
|
298
|
+
res = session('/test/.login') {|req|
|
299
|
+
req.cookies.clear
|
300
|
+
}
|
301
|
+
ok_title 'Login'
|
302
|
+
ok_xp([:input, {:istyle=>'3', :name=>'user', :class=>'focus'}],
|
303
|
+
'//input')
|
304
|
+
# ok_xp([:a, {:href=>'.getpass'}, [:em, 'Get Password']], '//a')
|
305
|
+
assert_cookie({'user'=>'', 'pass'=>''}, @res.cookies)
|
306
|
+
|
307
|
+
# Get password by e-mail. See act-getpass.
|
308
|
+
|
309
|
+
# Invalid mail address
|
310
|
+
res = session('/test/.login?user=test@example') {|req|
|
311
|
+
req.cookies.clear
|
312
|
+
}
|
313
|
+
assert_text('Invalid ID (E-mail) or Password.', 'p')
|
314
|
+
|
315
|
+
# Invalid password
|
316
|
+
res = session('/test/.login?user=user@e.com&pass=wrongpassword') {|req|
|
317
|
+
req.cookies.clear
|
318
|
+
}
|
319
|
+
assert_text('Invalid ID (E-mail) or Password.', 'p')
|
320
|
+
|
321
|
+
# Login by GET method. Set cookies and redirect to FrontPage.
|
322
|
+
res = session('/test/.login?user=user@e.com&pass=95988593') {|req|
|
323
|
+
req.cookies.clear
|
324
|
+
}
|
325
|
+
ok_title 'Login Success'
|
326
|
+
#assert_cookie({'user'=>'user@e.com', 'pass'=>'95988593'}, @res.cookies)
|
327
|
+
eq 'sid', @res.cookies[0].name
|
328
|
+
eq 32, @res.cookies[0].value.length
|
329
|
+
#pw('//head')
|
330
|
+
ok_xp([:meta, {:content=>'0; url=FrontPage.html',
|
331
|
+
'http-equiv'=>'Refresh'}],
|
332
|
+
'//meta[2]') # force redirect for security reason.
|
333
|
+
|
334
|
+
# Set the cookie
|
335
|
+
res = session('/test/') {|req|
|
336
|
+
req.cookies.update({'user'=>'user@e.com', 'pass'=>'95988593'})
|
337
|
+
}
|
338
|
+
ok_title 'FrontPage'
|
339
|
+
assert_cookie({'user'=>'user@e.com', 'pass'=>'95988593'},
|
340
|
+
@res.cookies)
|
341
|
+
#eq 'sid', @res.cookies[0].name
|
342
|
+
#eq 32, @res.cookies[0].value.length
|
343
|
+
|
344
|
+
# Use POST method to set user and pass by queries.
|
345
|
+
res = session('POST /test/.login?user=user@e.com&pass=95988593') {|req|
|
346
|
+
req.cookies.clear
|
347
|
+
}
|
348
|
+
ok_title 'Login Success'
|
349
|
+
eq 200, @res.status
|
350
|
+
#assert_cookie({'user'=>'user@e.com', 'pass'=>'95988593'}, @res.cookies)
|
351
|
+
eq 'sid', @res.cookies[0].name
|
352
|
+
eq 32, @res.cookies[0].value.length
|
353
|
+
ok_xp([:meta, {:content=>'0; url=FrontPage.html',
|
354
|
+
'http-equiv'=>'Refresh'}],
|
355
|
+
'//meta[2]') # force redirect for security reason.
|
356
|
+
|
357
|
+
# test_login_status
|
358
|
+
res = session('/test/')
|
359
|
+
ok_in(['user', ' | ', [:em, 'user@e.com'],
|
360
|
+
' (', [:a, {:href=>'.logout'}, 'Logout'], ')'],
|
361
|
+
"//span[@class='loginstatus']")
|
362
|
+
|
363
|
+
# See TextFormat
|
364
|
+
res = session('/test/TextFormat.html')
|
365
|
+
|
366
|
+
# See the Logout page.
|
367
|
+
res = session('/test/.logout')
|
368
|
+
ok_title 'Log out Confirm'
|
369
|
+
ok_xp([:form, {:action=>'.logout', :method=>'POST'},
|
370
|
+
[:input, {:value=>'yes', :type=>'hidden',
|
371
|
+
:name=>'confirm'}], [:input, {:value=>'Log out',
|
372
|
+
:type=>'submit', :class=>'focus'}]], '//form')
|
373
|
+
ok_xp([:input, {:value=>'yes', :type=>'hidden', :name=>'confirm'}],
|
374
|
+
'//input')
|
375
|
+
ok_xp([:input, {:value=>'Log out',
|
376
|
+
:type=>'submit', :class=>'focus'}], '//input[2]')
|
377
|
+
|
378
|
+
# Confirm Logout.
|
379
|
+
res = session('/test/.logout?confirm=yes')
|
380
|
+
ok_title 'Log out done.'
|
381
|
+
assert_text('Log out done.', 'h1')
|
382
|
+
ok_xp([:p, [:a, {:href=>'FrontPage.html'}, 'Go back']],
|
383
|
+
"//div[@class='section']/p")
|
384
|
+
assert_cookie({'user'=>'', 'pass'=>'', 'sid'=>''}, @res.cookies)
|
385
|
+
#eq 'sid', @res.cookies[0].name
|
386
|
+
#eq 32, @res.cookies[0].value.length
|
387
|
+
end
|
388
|
+
|
389
|
+
def test_open_site
|
390
|
+
t_add_user
|
391
|
+
t_site_open # OPEN site
|
392
|
+
|
393
|
+
# See FrontPage. Check login_status before login.
|
394
|
+
res = session('/test/') {|req|
|
395
|
+
req.cookies.clear
|
396
|
+
}
|
397
|
+
ok_title 'FrontPage'
|
398
|
+
ok_in(['Login'], "//div[@class='adminmenu']//a")
|
399
|
+
ok_in([[:a, {:href=>'.login'}, 'Login'],
|
400
|
+
["\n"], ["\n"]],
|
401
|
+
"//div[@class='adminmenu']")
|
402
|
+
|
403
|
+
# You can see login page before login.
|
404
|
+
res = session('/test/.login') {|req|
|
405
|
+
req.cookies.clear
|
406
|
+
}
|
407
|
+
ok_title 'Login'
|
408
|
+
end
|
409
|
+
end
|
410
|
+
end
|
@@ -0,0 +1,60 @@
|
|
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
|
+
def pre_act_logout
|
10
|
+
return basicauth_logout if @req.auth == 'basicauth'
|
11
|
+
|
12
|
+
confirm = @req.query['confirm']
|
13
|
+
if confirm.nil? || confirm != 'yes'
|
14
|
+
return logout_show_confirm
|
15
|
+
end
|
16
|
+
|
17
|
+
session_clear
|
18
|
+
|
19
|
+
@res.clear_cookie('user') # Remove cookies from browser.
|
20
|
+
@res.clear_cookie('pass')
|
21
|
+
@res.clear_cookie('sid')
|
22
|
+
|
23
|
+
return c_notice(_('Log out done.'), 'FrontPage.html') {
|
24
|
+
[:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
def logout_show_confirm
|
29
|
+
title = _('Log out')+' '+_('Confirm')
|
30
|
+
c_notice(title) {
|
31
|
+
[[:p, _('Push "Log out".')],
|
32
|
+
logout_form,
|
33
|
+
[:hr],
|
34
|
+
[:p, [:a, {:href=>'FrontPage.html'}, _('Go next')]]]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
def logout_form
|
39
|
+
return [:div, {:class=>'logout'},
|
40
|
+
[:form, {:method=>'POST', :action=>'.logout'},
|
41
|
+
[:input, {:type=>'hidden', :name=>'confirm', :value=>'yes'}],
|
42
|
+
[:input, {:type=>'submit', :value=>_('Log out'), :class=>'focus'}]]]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
if $0 == __FILE__
|
48
|
+
require 'qwik/test-common'
|
49
|
+
$test = true
|
50
|
+
end
|
51
|
+
|
52
|
+
if defined?($test) && $test
|
53
|
+
class TestActLogout < Test::Unit::TestCase
|
54
|
+
include TestSession
|
55
|
+
|
56
|
+
def test_all
|
57
|
+
# The test for logout is already done in act-login.rb
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,159 @@
|
|
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-text'
|
7
|
+
|
8
|
+
module Qwik
|
9
|
+
class Action
|
10
|
+
def plg_mail(from = '', time = nil)
|
11
|
+
h2 = [:h2]
|
12
|
+
h2 << plg_date(time) if time
|
13
|
+
h2 << ' From: '+MailAddress.obfuscate(from)
|
14
|
+
|
15
|
+
content = yield
|
16
|
+
content = MailAddress.obfuscate_str(content)
|
17
|
+
content = c_pre_text { content }
|
18
|
+
|
19
|
+
ar = []
|
20
|
+
ar << h2
|
21
|
+
ar += content
|
22
|
+
return ar
|
23
|
+
end
|
24
|
+
|
25
|
+
def plg_date(time_str = nil)
|
26
|
+
return unless time_str.is_a?(String)
|
27
|
+
|
28
|
+
if /\A\d+\z/ =~ time_str # Only number.
|
29
|
+
time = Time.at(time_str.to_i)
|
30
|
+
date = time.strftime("%b #{time.day}, %Y")
|
31
|
+
return [:span, {:class=>'date'}, date]
|
32
|
+
elsif /\A\d\d\d\d\-\d\d\-\d\d\z/ =~ time_str # 2005-04-19
|
33
|
+
return [:span, {:class=>'date'}, time_str]
|
34
|
+
end
|
35
|
+
return
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
if $0 == __FILE__
|
41
|
+
require 'qwik/test-common'
|
42
|
+
$test = true
|
43
|
+
end
|
44
|
+
|
45
|
+
if defined?($test) && $test
|
46
|
+
class TestActMail < Test::Unit::TestCase
|
47
|
+
include TestSession
|
48
|
+
|
49
|
+
def ok(e, w, user=DEFAULT_USER) # assert_body_main
|
50
|
+
assert_path(e, w, user, "//div[@class='body_main']")
|
51
|
+
end
|
52
|
+
|
53
|
+
def nu_test_mail_old
|
54
|
+
ok([:div, {:class=>'day'}, [:h2, {:id=>'From'}, 'From:'],
|
55
|
+
[:div, {:class=>'body'},
|
56
|
+
[:div, {:class=>'section'}, [[:p, 'a']]]]],
|
57
|
+
"{{mail\na\n}}")
|
58
|
+
ok([:div,
|
59
|
+
{:class=>'day'},
|
60
|
+
[:h2, {:id=>'From'}, 'From:'],
|
61
|
+
[:div,
|
62
|
+
{:class=>'body'},
|
63
|
+
[:div, {:class=>'section'}, [[:p, 'テストです。'], ["\n"]]]]],
|
64
|
+
"* テスト\n{{mail\nテストです。\n\n}}")
|
65
|
+
ok([:div,
|
66
|
+
{:class=>'day'},
|
67
|
+
[:h2, {:id=>'979dff15c789fca0315256fc8af6fa64'}, 'From: t@e...'],
|
68
|
+
[:div, {:class=>'body'}, [:div, {:class=>'section'},
|
69
|
+
[[:p, 'ス'], ["\n"]]]]],
|
70
|
+
"* テ\n{{mail(t@e.com)\nス\n\n}}")
|
71
|
+
ok([:div,
|
72
|
+
{:class=>'day'},
|
73
|
+
[:h2,
|
74
|
+
{:id=>'979dff15c789fca0315256fc8af6fa64'},
|
75
|
+
[:span, {:class=>'date'}, 'Jan 1, 1970'],
|
76
|
+
' From: t@e...'],
|
77
|
+
[:div, {:class=>'body'}, [:div, {:class=>'section'},
|
78
|
+
[[:p, 'ス'], ["\n"]]]]],
|
79
|
+
"* テ\n{{mail(t@e.com,0)\nス\n\n}}")
|
80
|
+
ok([:div,
|
81
|
+
{:class=>'day'},
|
82
|
+
[:h2, {:id=>'979dff15c789fca0315256fc8af6fa64'}, 'From: t@e...'],
|
83
|
+
[:div,
|
84
|
+
{:class=>'body'},
|
85
|
+
[:div, {:class=>'section'}, [[:p, 't@e...'], ["\n"]]]]],
|
86
|
+
"* テ\n{{mail(t@e.com)\nt@e.com\n\n}}")
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_mail_new
|
90
|
+
ok([:div, {:class=>'day'},
|
91
|
+
[:h2, {:id=>'From'}, ' From: '],
|
92
|
+
[:div, {:class=>'body'},
|
93
|
+
[:div, {:class=>'section'},
|
94
|
+
[[:p, 'a']]]]],
|
95
|
+
"{{mail\na\n}}")
|
96
|
+
ok([:div, {:class=>'day'},
|
97
|
+
[:h2, {:id=>'From'}, ' From: '],
|
98
|
+
[:div, {:class=>'body'},
|
99
|
+
[:div, {:class=>'section'}, [[:p, 'テストです。'], ["\n"]]]]],
|
100
|
+
"* テスト\n{{mail\nテストです。\n\n}}")
|
101
|
+
ok([:div, {:class=>'day'},
|
102
|
+
[:h2, {:id=>'979dff15c789fca0315256fc8af6fa64'}, ' From: t@e...'],
|
103
|
+
[:div, {:class=>'body'},
|
104
|
+
[:div, {:class=>'section'}, [[:p, 'ス'], ["\n"]]]]],
|
105
|
+
"* テ\n{{mail(t@e.com)\nス\n\n}}")
|
106
|
+
ok([:div, {:class=>'day'},
|
107
|
+
[:h2, {:id=>'979dff15c789fca0315256fc8af6fa64'},
|
108
|
+
[:span, {:class=>'date'}, 'Jan 1, 1970'],
|
109
|
+
' From: t@e...'],
|
110
|
+
[:div, {:class=>'body'},
|
111
|
+
[:div, {:class=>'section'}, [[:p, 'ス'], ["\n"]]]]],
|
112
|
+
"* テ\n{{mail(t@e.com,0)\nス\n\n}}")
|
113
|
+
ok([:div, {:class=>'day'},
|
114
|
+
[:h2, {:id=>'979dff15c789fca0315256fc8af6fa64'}, ' From: t@e...'],
|
115
|
+
[:div, {:class=>'body'},
|
116
|
+
[:div, {:class=>'section'}, [[:p, 't@e...'], ["\n"]]]]],
|
117
|
+
"* テ\n{{mail(t@e.com)\nt@e.com\n\n}}")
|
118
|
+
ok([:div, {:class=>'day'},
|
119
|
+
[:h2, {:id=>'979dff15c789fca0315256fc8af6fa64'},
|
120
|
+
[:span, {:class=>'date'}, 'Jan 1, 1970'], ' From: t@e...'],
|
121
|
+
[:div, {:class=>'body'},
|
122
|
+
[:div, {:class=>'section'}, [[:p, 'a', [:br], 'b']]]]],
|
123
|
+
"* Test\n{{mail(t@e.com,0)\na\nb\n}}")
|
124
|
+
end
|
125
|
+
|
126
|
+
def test_date
|
127
|
+
ok_wi([:span, {:class=>'date'}, '2001-01-01'], '{{date(2001-01-01)}}')
|
128
|
+
ok_wi([:span, {:class=>'date'}, 'Jan 1, 1970'], '{{date(0)}}')
|
129
|
+
ok_wi([:span, {:class=>'date'}, 'Sep 9, 2001'], '{{date(1000000000)}}')
|
130
|
+
ok_wi([], '{{date(a)}}')
|
131
|
+
end
|
132
|
+
|
133
|
+
def nu_test_all_old
|
134
|
+
res = session
|
135
|
+
ok_wi([:p, 'a ',
|
136
|
+
[:h2, 'From: a'], ' b'],
|
137
|
+
'a {{mail(a)}} b')
|
138
|
+
ok_wi([:p, 'a ', [:span, {:class=>'date'}, 'Jan 1, 1970'], ' b'],
|
139
|
+
'a {{date(0)}} b')
|
140
|
+
ok_wi([:p, 'a ',
|
141
|
+
[:h2, [:span, {:class=>'date'}, 'Jan 1, 1970'], ' From: a'],
|
142
|
+
' b'],
|
143
|
+
'a {{mail(a,0)}} b')
|
144
|
+
end
|
145
|
+
|
146
|
+
def test_all_new
|
147
|
+
res = session
|
148
|
+
ok_wi([:p, 'a ',
|
149
|
+
[:h2, ' From: a'], ' b'],
|
150
|
+
'a {{mail(a)}} b')
|
151
|
+
ok_wi([:p, 'a ', [:span, {:class=>'date'}, 'Jan 1, 1970'], ' b'],
|
152
|
+
'a {{date(0)}} b')
|
153
|
+
ok_wi([:p, 'a ',
|
154
|
+
[:h2, [:span, {:class=>'date'}, 'Jan 1, 1970'], ' From: a'],
|
155
|
+
' b'],
|
156
|
+
'a {{mail(a,0)}} b')
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|