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,230 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2003-2006 Kouichirou Eto
|
3
|
+
# All rights reserved.
|
4
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
5
|
+
#
|
6
|
+
# You can redistribute it and/or modify it under the terms of
|
7
|
+
# the GNU General Public License version 2.
|
8
|
+
#
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
11
|
+
require 'qwik/wabisabi-template'
|
12
|
+
|
13
|
+
module Qwik
|
14
|
+
class Site
|
15
|
+
# Make index before call this method. Use parent.
|
16
|
+
def resolve_all_ref(wabisabi)
|
17
|
+
wabisabi.index_each_tag(:a) {|e|
|
18
|
+
resolve_ref(e)
|
19
|
+
}
|
20
|
+
return wabisabi
|
21
|
+
end
|
22
|
+
|
23
|
+
def resolve_ref(w)
|
24
|
+
attr = w.attr
|
25
|
+
return w if attr.nil?
|
26
|
+
|
27
|
+
href = attr[:href]
|
28
|
+
return w if href.nil? || href.empty?
|
29
|
+
|
30
|
+
# External link.
|
31
|
+
if /^(?:http|https|ftp|file):\/\// =~ href
|
32
|
+
w.set_attr(:class=>'external')
|
33
|
+
|
34
|
+
# Make it redirect link.
|
35
|
+
if self.siteconfig['redirect'] == 'true'
|
36
|
+
w.set_attr(:href=>".redirect?url=#{href}")
|
37
|
+
end
|
38
|
+
|
39
|
+
return w
|
40
|
+
end
|
41
|
+
|
42
|
+
# Error check.
|
43
|
+
return w if href.include?('?') # ignore command link
|
44
|
+
return w if href[0] == ?/ # already resolved
|
45
|
+
return w if /\.html\z/ !~ href # ignore not html file
|
46
|
+
|
47
|
+
linkbase = href.sub(/\.html\z/, '')
|
48
|
+
text = w[2]
|
49
|
+
|
50
|
+
t = linkbase
|
51
|
+
page = self.get_by_title(t)
|
52
|
+
if page && page.key != t
|
53
|
+
w.set_attr(:href=>page.key+'.html')
|
54
|
+
return w
|
55
|
+
end
|
56
|
+
|
57
|
+
# Create a new page link.
|
58
|
+
if ! self.exist?(linkbase)
|
59
|
+
newlinkbase = linkbase.escape
|
60
|
+
edithref = ".new?t=#{newlinkbase}"
|
61
|
+
|
62
|
+
return [:span, {:class=>'new'}, text,
|
63
|
+
[:a, {:href=>edithref},
|
64
|
+
[:img, {:src=>'.theme/i/new.png', :alt=>'create'}]]]
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
# Rewrite inside to the page title.
|
69
|
+
if linkbase == text
|
70
|
+
t = self[linkbase].get_title
|
71
|
+
return w if t == linkbase
|
72
|
+
w[2] = t
|
73
|
+
return w
|
74
|
+
end
|
75
|
+
|
76
|
+
return w
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
if $0 == __FILE__
|
82
|
+
require 'qwik/test-common'
|
83
|
+
$test = true
|
84
|
+
end
|
85
|
+
|
86
|
+
if defined?($test) && $test
|
87
|
+
class TestSiteResolve < Test::Unit::TestCase
|
88
|
+
include TestSession
|
89
|
+
|
90
|
+
def ok(e, w)
|
91
|
+
ok_eq(e, @site.resolve_ref(w))
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_all
|
95
|
+
res = session
|
96
|
+
|
97
|
+
ok([:a], [:a])
|
98
|
+
ok([:a, {:href=>''}, 't'], [:a, {:href=>''}, 't'])
|
99
|
+
|
100
|
+
# test_external
|
101
|
+
ok([:a, {:href=>'http://e/', :class=>'external'}, 't'],
|
102
|
+
[:a, {:href=>'http://e/'}, 't'])
|
103
|
+
|
104
|
+
# test_redirect
|
105
|
+
page = @site['_SiteConfig']
|
106
|
+
page.store(':redirect:true')
|
107
|
+
ok([:a, {:href=>'.redirect?url=http://e/', :class=>'external'}, 't'],
|
108
|
+
[:a, {:href=>'http://e/'}, 't'])
|
109
|
+
page.store('')
|
110
|
+
|
111
|
+
ok([:a, {:href=>'a?b'}, 't'],
|
112
|
+
[:a, {:href=>'a?b'}, 't'])
|
113
|
+
ok([:a, {:href=>'/t'}, 't'],
|
114
|
+
[:a, {:href=>'/t'}, 't'])
|
115
|
+
ok([:a, {:href=>'t'}, 't'],
|
116
|
+
[:a, {:href=>'t'}, 't'])
|
117
|
+
|
118
|
+
# test_new
|
119
|
+
ok([:span, {:class=>'new'}, 't',
|
120
|
+
[:a, {:href=>'.new?t=t'},
|
121
|
+
[:img, {:alt=>'create', :src=>'.theme/i/new.png'}]]],
|
122
|
+
[:a, {:href=>'t.html'}, 't'])
|
123
|
+
|
124
|
+
page = @site.create('t')
|
125
|
+
ok([:a, {:href=>'t.html'}, 't'], [:a, {:href=>'t.html'}, 't'])
|
126
|
+
page = @site.create_new
|
127
|
+
page.store('t')
|
128
|
+
ok([:a, {:href=>'1.html'}, '1'], [:a, {:href=>'1.html'}, '1'])
|
129
|
+
ok([:a, {:href=>'1.html'}, 't'], [:a, {:href=>'1.html'}, 't'])
|
130
|
+
page.store('*t')
|
131
|
+
ok([:a, {:href=>'1.html'}, 't'], [:a, {:href=>'1.html'}, '1'])
|
132
|
+
ok([:a, {:href=>'1.html'}, 't'], [:a, {:href=>'1.html'}, 't'])
|
133
|
+
ok([:a, {:href=>'1.html'}, 's'], [:a, {:href=>'1.html'}, 's'])
|
134
|
+
|
135
|
+
# test_error
|
136
|
+
ok([:a, {:href=>"\"D_R\", \"/v/w\""}, 't'],
|
137
|
+
[:a, {:href=>"\"D_R\", \"/v/w\""}, 't'])
|
138
|
+
|
139
|
+
# test_act
|
140
|
+
ok([:a, {:href=>'.attach'}, '.attach'],
|
141
|
+
[:a, {:href=>'.attach'}, '.attach'])
|
142
|
+
|
143
|
+
# test_plusplus
|
144
|
+
ok([:a, {:href=>'t.html'}, 't'],
|
145
|
+
[:a, {:href=>'t.html'}, 't'])
|
146
|
+
ok([:span, {:class=>'new'}, 'C++',
|
147
|
+
[:a, {:href=>'.new?t=C%2B%2B'},
|
148
|
+
[:img, {:alt=>'create', :src=>'.theme/i/new.png'}]]],
|
149
|
+
[:a, {:href=>'C++.html'}, 'C++'])
|
150
|
+
page.store('* C++')
|
151
|
+
ok([:a, {:href=>'1.html'}, 'C++'],
|
152
|
+
[:a, {:href=>'C++.html'}, 'C++'])
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_japanese
|
156
|
+
res = session
|
157
|
+
page = @site.create_new
|
158
|
+
page.store('*あ')
|
159
|
+
|
160
|
+
ok([:a, {:href=>'1.html'}, 'あ'],
|
161
|
+
[:a, {:href=>'あ.html'}, 'あ'])
|
162
|
+
|
163
|
+
ok([:span, {:class=>'new'}, 'い',
|
164
|
+
[:a, {:href=>'.new?t=%82%A2'},
|
165
|
+
[:img, {:alt=>'create', :src=>'.theme/i/new.png'}]]],
|
166
|
+
[:a, {:href=>'い.html'}, 'い'])
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
class TestSiteResolveAll < Test::Unit::TestCase
|
171
|
+
include TestSession
|
172
|
+
|
173
|
+
def ok_all(e, w)
|
174
|
+
ok_eq(e, @site.resolve_all_ref(w))
|
175
|
+
end
|
176
|
+
|
177
|
+
def test_all
|
178
|
+
res = session
|
179
|
+
# test_ref
|
180
|
+
ok_all([[:span, {:class=>'new'}, 't',
|
181
|
+
[:a, {:href=>'.new?t=t'},
|
182
|
+
[:img, {:alt=>'create', :src=>'.theme/i/new.png'}]]]],
|
183
|
+
[[:a, {:href=>'t.html'}, 't']])
|
184
|
+
page = @site.create('t')
|
185
|
+
ok_all([[:a, {:href=>'t.html'}, 't']],
|
186
|
+
[[:a, {:href=>'t.html'}, 't']])
|
187
|
+
page = @site.create_new
|
188
|
+
page.store('t')
|
189
|
+
ok_all([[:a, {:href=>'1.html'}, '1']],
|
190
|
+
[[:a, {:href=>'1.html'}, '1']])
|
191
|
+
page.store('*t')
|
192
|
+
ok_all([[:a, {:href=>'1.html'}, 't']],
|
193
|
+
[[:a, {:href=>'1.html'}, '1']])
|
194
|
+
ok_all([[:a, {:href=>'.attach'}, '.attach']],
|
195
|
+
[[:a, {:href=>'.attach'}, '.attach']])
|
196
|
+
end
|
197
|
+
|
198
|
+
def test_all1
|
199
|
+
res = session
|
200
|
+
|
201
|
+
# test_newpage
|
202
|
+
ok_wi([:p, [:span, {:class=>'new'}, 'test',
|
203
|
+
[:a, {:href=>'.new?t=test'},
|
204
|
+
[:img, {:alt=>'create', :src=>'.theme/i/new.png'}]]]],
|
205
|
+
'[[test]]')
|
206
|
+
ok_wi([:p, [:span, {:class=>'new'}, 'い',
|
207
|
+
[:a, {:href=>'.new?t=%82%A2'},
|
208
|
+
[:img, {:alt=>'create', :src=>'.theme/i/new.png'}]]]],
|
209
|
+
'[[い]]')
|
210
|
+
end
|
211
|
+
|
212
|
+
def test_all2
|
213
|
+
res = session
|
214
|
+
|
215
|
+
# test_act
|
216
|
+
ok_wi([:p, 't', [:a, {:href=>'.attach'}, '.attach']],
|
217
|
+
't[[.attach]]')
|
218
|
+
ok_wi([:p, [:a, {:href=>'.attach'}, '.attach']], '[[.attach]]')
|
219
|
+
ok_wi([:p, [:a, {:href=>'.attach'}, 'FileAttach']],
|
220
|
+
'[[FileAttach|.attach]]')
|
221
|
+
ok_wi([:p, [:a, {:href=>'.attach'}, 'ファイル添付']],
|
222
|
+
'[[ファイル添付|.attach]]')
|
223
|
+
|
224
|
+
# test_mojibake
|
225
|
+
ok_wi([:p, 't'], 't')
|
226
|
+
ok_wi([:p, '450円'], '450円')
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Copyright (C) 2009 AIST, 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/util-pathname'
|
7
|
+
require 'qwik/page-rrefs'
|
8
|
+
|
9
|
+
module Qwik
|
10
|
+
class Site
|
11
|
+
def rrefs(k = 'FronPage')
|
12
|
+
page = self[k]
|
13
|
+
return nil if page.nil?
|
14
|
+
page.rrefs = PageRRefs.new(@path.to_s, k) if page.rrefs.nil?
|
15
|
+
return page.rrefs
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,180 @@
|
|
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
|
+
require 'qwik/db-searchwords.rb'
|
8
|
+
|
9
|
+
module Qwik
|
10
|
+
class Site
|
11
|
+
COMMENT = /^#.*$/
|
12
|
+
|
13
|
+
=begin
|
14
|
+
def init_site_search
|
15
|
+
@search_words_db = SearchWordsDB.new(@path, @config)
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_search_words
|
19
|
+
@search_words_db.get_normalized
|
20
|
+
end
|
21
|
+
|
22
|
+
def delete_search_word(word)
|
23
|
+
@search_words_db.delete(word)
|
24
|
+
end
|
25
|
+
=end
|
26
|
+
|
27
|
+
def search(query, obfuscate = true)
|
28
|
+
queries = search_parse_query(query)
|
29
|
+
# @search_words_db.put(queries)
|
30
|
+
|
31
|
+
all_snippet_length = 120
|
32
|
+
pre_snippet_length = all_snippet_length / queries.size / 2
|
33
|
+
|
34
|
+
ar = []
|
35
|
+
self.each {|page|
|
36
|
+
str = page.load
|
37
|
+
str = str.gsub(COMMENT, '')
|
38
|
+
str = wiki_to_string(str)
|
39
|
+
matched = true
|
40
|
+
|
41
|
+
mds = []
|
42
|
+
snippet = ""
|
43
|
+
|
44
|
+
queries.each {|query|
|
45
|
+
regexp = Regexp.new(Regexp.escape(query),
|
46
|
+
Regexp::IGNORECASE|Regexp::MULTILINE)
|
47
|
+
md = regexp.match(str)
|
48
|
+
if ! md
|
49
|
+
matched = false
|
50
|
+
break
|
51
|
+
else
|
52
|
+
mds.push(md)
|
53
|
+
end
|
54
|
+
}
|
55
|
+
|
56
|
+
if matched
|
57
|
+
snippet = create_snippet(mds)
|
58
|
+
snippet = MailAddress.obfuscate_str(snippet) if obfuscate
|
59
|
+
ar << [page.key, snippet]
|
60
|
+
end
|
61
|
+
}
|
62
|
+
|
63
|
+
ar
|
64
|
+
end
|
65
|
+
|
66
|
+
def search_parse_query(query)
|
67
|
+
return query.strip.split.map{|e| e.downcase }.uniq
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
def wiki_to_string(wiki)
|
73
|
+
tokens = Qwik::TextTokenizer.tokenize(wiki, true)
|
74
|
+
wabisabi = Qwik::TextParser.make_tree(tokens)
|
75
|
+
return wabisabi.flatten.select{|a| a.class == String}.join(" ")
|
76
|
+
end
|
77
|
+
|
78
|
+
def create_snippet(mds)
|
79
|
+
#sort as first hit keyword goes first
|
80
|
+
mds = mds.sort {|i, j| i.begin(0) <=> j.begin(0) }
|
81
|
+
max_width = 400
|
82
|
+
|
83
|
+
# merge snippets of each search key
|
84
|
+
#
|
85
|
+
# snip[s, e]
|
86
|
+
#|============|1st key|=============|
|
87
|
+
snip = [mds[0].begin(0), mds[0].end(0)]
|
88
|
+
|
89
|
+
mds[1..-1].each {|md|
|
90
|
+
#|=====|1st key|==...==|last key|========|a key|===..===|
|
91
|
+
# snip[s, e] ^
|
92
|
+
# |md.begin(0)
|
93
|
+
# <-------------------------.......----->
|
94
|
+
# max_width
|
95
|
+
# this is the length of bytes, not characters
|
96
|
+
if md.begin(0) < snip[0] + max_width
|
97
|
+
# extends snip end
|
98
|
+
# snip[s, e]
|
99
|
+
#|====|1st key|==...==|last key|========|a key|===..===|
|
100
|
+
snip[1] = md.end(0)
|
101
|
+
end
|
102
|
+
}
|
103
|
+
|
104
|
+
#all md(MatchData) has same input string
|
105
|
+
all_string = mds[0].string
|
106
|
+
|
107
|
+
snippet = all_string[snip[0]...snip[1]]
|
108
|
+
len = snippet.mb_length # character length
|
109
|
+
rest = (max_width - len) / 2
|
110
|
+
if 0 < rest
|
111
|
+
# we have shot snippet, adding additional strings
|
112
|
+
pre = all_string[0...snip[0]]
|
113
|
+
post = all_string[snip[1]..-1]
|
114
|
+
|
115
|
+
if rest < pre.size
|
116
|
+
pre = pre.mb_substring(-rest, pre.length)
|
117
|
+
end
|
118
|
+
|
119
|
+
if rest < post.size
|
120
|
+
post = post.mb_substring(0, rest)
|
121
|
+
end
|
122
|
+
snippet = pre + snippet + post
|
123
|
+
end
|
124
|
+
|
125
|
+
return snippet
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
if $0 == __FILE__
|
131
|
+
require 'qwik/test-common'
|
132
|
+
$test = true
|
133
|
+
end
|
134
|
+
|
135
|
+
if defined?($test) && $test
|
136
|
+
class TestSiteSearch < Test::Unit::TestCase
|
137
|
+
include TestSession
|
138
|
+
|
139
|
+
def test_dummy
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_all
|
143
|
+
res = session
|
144
|
+
|
145
|
+
page = @site.create_new
|
146
|
+
page.store('This is a test.')
|
147
|
+
page = @site.create_new
|
148
|
+
page.store('This is a test, too.')
|
149
|
+
|
150
|
+
res = @site.search('test')
|
151
|
+
ok_eq([['1', 'This is a test.'],
|
152
|
+
['2', 'This is a test, too.']], res)
|
153
|
+
|
154
|
+
# test_obfuscate
|
155
|
+
page.store('user@example.com')
|
156
|
+
res = @site.search('@')
|
157
|
+
is [["2", "user@e..."]], res
|
158
|
+
|
159
|
+
res = @site.search('@', false)
|
160
|
+
is [["2", "user@example.com"]], res
|
161
|
+
end
|
162
|
+
|
163
|
+
def test_skip_sharp
|
164
|
+
page = @site.create_new
|
165
|
+
page.store('This is a test.')
|
166
|
+
page = @site.create_new
|
167
|
+
page.store('# This is a test start with sharp.')
|
168
|
+
page = @site.create_new
|
169
|
+
page.store("This is a test which have `#' in a middle of line.")
|
170
|
+
page = @site.create_new
|
171
|
+
page.store('This is a test, too.')
|
172
|
+
|
173
|
+
res = @site.search('test')
|
174
|
+
ok_eq([["1", "This is a test."],
|
175
|
+
["3", "This is a test which have `# ' in a middle of line."],
|
176
|
+
["4", "This is a test, too."]], res)
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
end
|
@@ -0,0 +1,153 @@
|
|
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 Site
|
9
|
+
def last_modified
|
10
|
+
return self.map {|page|
|
11
|
+
page.mtime
|
12
|
+
}.max
|
13
|
+
end
|
14
|
+
|
15
|
+
# called from act-chronology
|
16
|
+
def timeline
|
17
|
+
@timeline = SiteTimeLine.new(self) unless defined? @timeline
|
18
|
+
return @timeline
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class SiteTimeLine
|
23
|
+
def initialize(site)
|
24
|
+
@site = site
|
25
|
+
@times = nil
|
26
|
+
@days = nil
|
27
|
+
@site_min = nil
|
28
|
+
@site_max = nil
|
29
|
+
@page_min = nil
|
30
|
+
@page_max = nil
|
31
|
+
@pages_history = nil
|
32
|
+
@site_duration = nil
|
33
|
+
@site_last_modified = nil
|
34
|
+
end
|
35
|
+
attr_reader :times, :days
|
36
|
+
attr_reader :site_min, :site_max, :page_min, :page_max
|
37
|
+
attr_reader :pages_history, :site_duration
|
38
|
+
|
39
|
+
def calc_history
|
40
|
+
if_sites_update? {
|
41
|
+
@times, @days, @page_min, @page_max, @site_min, @site_max,
|
42
|
+
@pages_history, @site_duration = calc_history_internal(@site)
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
def if_sites_update?
|
47
|
+
# Check last update from pages
|
48
|
+
last_modified = @site.last_modified
|
49
|
+
return if last_modified.nil? # No page.
|
50
|
+
if @site_last_modified.nil? || @site_last_modified < last_modified
|
51
|
+
yield
|
52
|
+
end
|
53
|
+
@site_last_modified = last_modified
|
54
|
+
end
|
55
|
+
|
56
|
+
def calc_history_internal(site)
|
57
|
+
keys = site.map {|page| page.key }
|
58
|
+
return nil if keys.empty?
|
59
|
+
|
60
|
+
times = Hash.new {|h, k| h[k] = []}
|
61
|
+
days = Hash.new {|h, k| h[k] = []}
|
62
|
+
site_min = nil # FIXME: site_min should be cached.
|
63
|
+
site_max = nil
|
64
|
+
page_min = {} # FIXME: page_min should be cached.
|
65
|
+
page_max = {}
|
66
|
+
|
67
|
+
site.backupdb.each {|key, v, time|
|
68
|
+
next if times[key].nil? # Calc only for existing pages.
|
69
|
+
times[key] << time
|
70
|
+
days[time.ymd_s] << [key, time]
|
71
|
+
site_min = time if site_min.nil? || time < site_min
|
72
|
+
site_max = time if site_max.nil? || site_max < time
|
73
|
+
page_min[key] = time if page_min[key].nil? || time < page_min[key]
|
74
|
+
page_max[key] = time if page_max[key].nil? || page_max[key] < time
|
75
|
+
}
|
76
|
+
|
77
|
+
page_min_days = Hash.new {|h, k| h[k] = []}
|
78
|
+
page_min.each {|key, time|
|
79
|
+
page_min_days[time.ymd_s] << [key, time]
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
# Calc history from older to newer.
|
87
|
+
pages_history = page_min.to_a.sort {|a, b|
|
88
|
+
a[1] <=> b[1]
|
89
|
+
}.map {|a|
|
90
|
+
a[0]
|
91
|
+
}
|
92
|
+
|
93
|
+
# Count second when the page is created to the last update.
|
94
|
+
site_max = Time.at(1) if site_max.nil?
|
95
|
+
site_min = Time.at(0) if site_min.nil?
|
96
|
+
|
97
|
+
site_duration = site_max - site_min
|
98
|
+
|
99
|
+
return times, days, page_min, page_max, site_min, site_max, pages_history, site_duration
|
100
|
+
end
|
101
|
+
|
102
|
+
def get_keys_by_day(ymd)
|
103
|
+
day = @days[ymd]
|
104
|
+
return nil if day.empty?
|
105
|
+
day = day.sort_by {|key, time| time }
|
106
|
+
keys = day.map {|key, time| key }.uniq
|
107
|
+
return keys
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
if $0 == __FILE__
|
113
|
+
require 'qwik/test-common'
|
114
|
+
$test = true
|
115
|
+
end
|
116
|
+
|
117
|
+
if defined?($test) && $test
|
118
|
+
class TestSiteTimeLine < Test::Unit::TestCase
|
119
|
+
include TestSession
|
120
|
+
|
121
|
+
def test_all
|
122
|
+
page = @site.create_new
|
123
|
+
page.put_with_time('* t1', 0) # store the first
|
124
|
+
page.put_with_time('* t2', 1) # store the second
|
125
|
+
|
126
|
+
# test_last_modified
|
127
|
+
eq(1, @site.last_modified.to_i)
|
128
|
+
|
129
|
+
tl = @site.timeline
|
130
|
+
|
131
|
+
# test_calc_history
|
132
|
+
tl.calc_history
|
133
|
+
#pp tl
|
134
|
+
|
135
|
+
# test_times
|
136
|
+
times = tl.times
|
137
|
+
eq ['1'], times.keys
|
138
|
+
eq 0, times['1'][0].to_i
|
139
|
+
eq 1, times['1'][1].to_i
|
140
|
+
|
141
|
+
# test_days
|
142
|
+
days = tl.days
|
143
|
+
day = days['19700101']
|
144
|
+
eq [['1', Time.at(0)], ['1', Time.at(1)]], day
|
145
|
+
|
146
|
+
# test_site_min, page_min, pages_history, site_duration
|
147
|
+
eq Time.at(0), tl.site_min
|
148
|
+
eq({'1'=>Time.at(0)}, tl.page_min)
|
149
|
+
eq ['1'], tl.pages_history
|
150
|
+
assert(0 < tl.site_duration)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|