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,231 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2002-2004 Satoru Takabayashi <satoru@namazu.org>
|
3
|
+
# Copyright (C) 2003-2006 Kouichirou Eto
|
4
|
+
# All rights reserved.
|
5
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
6
|
+
#
|
7
|
+
# You can redistribute it and/or modify it under the terms of
|
8
|
+
# the GNU General Public License version 2.
|
9
|
+
#
|
10
|
+
|
11
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
12
|
+
require 'qwik/group'
|
13
|
+
require 'qwik/util-sendmail'
|
14
|
+
require 'qwik/util-basic'
|
15
|
+
|
16
|
+
module QuickML
|
17
|
+
class Group
|
18
|
+
def report_ml_close_soon
|
19
|
+
return if @members.active_empty?
|
20
|
+
|
21
|
+
name = @name
|
22
|
+
|
23
|
+
subject = Mail.encode_field(_("[%s] ML will be closed soon", name))
|
24
|
+
|
25
|
+
header = [
|
26
|
+
['To', @address],
|
27
|
+
['From', @address],
|
28
|
+
['Subject', subject],
|
29
|
+
['Reply-To', @address],
|
30
|
+
['Content-Type', content_type]
|
31
|
+
]
|
32
|
+
header.concat(quickml_fields)
|
33
|
+
|
34
|
+
time_to_close = @db.last_article_time + @group_config[:ml_life_time]
|
35
|
+
ndays = ((time_to_close - Time.now) / 86400.0).ceil
|
36
|
+
datefmt = __('%Y-%m-%d %H:%M')
|
37
|
+
|
38
|
+
body = _("ML will be closed if no article is posted for %d days.\n\n",
|
39
|
+
ndays)
|
40
|
+
body << _("Time to close: %s.\n\n", time_to_close.strftime(datefmt))
|
41
|
+
body << generate_footer(true)
|
42
|
+
|
43
|
+
mail = {
|
44
|
+
:mail_from => '',
|
45
|
+
:recipient => get_active_members,
|
46
|
+
:header => header,
|
47
|
+
:body => body,
|
48
|
+
}
|
49
|
+
Sendmail(@config.smtp_host, @config.smtp_port, @logger, mail)
|
50
|
+
@logger.log "[#{@name}]: Alert: ML will be closed soon"
|
51
|
+
close_alertedp_file
|
52
|
+
end
|
53
|
+
|
54
|
+
def submit (mail)
|
55
|
+
#p 'ml.submit ' if $ml_debug
|
56
|
+
|
57
|
+
return if @members.active_empty?
|
58
|
+
|
59
|
+
if @group_config[:max_mail_length] < mail.body.length
|
60
|
+
report_too_large_mail(mail)
|
61
|
+
@logger.log "[#{@name}]: Too Large Mail: #{mail.from}"
|
62
|
+
return
|
63
|
+
end
|
64
|
+
|
65
|
+
reset_error_member(mail.from)
|
66
|
+
start_time = Time.now
|
67
|
+
_submit(mail)
|
68
|
+
elapsed = Time.now - start_time
|
69
|
+
msg = "[#{@name}:#{@count}]: Send:"
|
70
|
+
msg += " #{@config.smtp_host} #{elapsed} sec." if ! $test
|
71
|
+
@logger.log msg
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def _submit(mail)
|
77
|
+
site_post(mail)
|
78
|
+
_org_submit(mail)
|
79
|
+
end
|
80
|
+
|
81
|
+
def _org_submit (mail)
|
82
|
+
inc_count
|
83
|
+
save_charset(@message_charset)
|
84
|
+
remove_alertedp_file
|
85
|
+
|
86
|
+
subject = Mail.rewrite_subject(mail['Subject'], @name, @count)
|
87
|
+
|
88
|
+
body = rewrite_body(mail)
|
89
|
+
|
90
|
+
header = []
|
91
|
+
mail.each_field {|key, value|
|
92
|
+
k = key.downcase
|
93
|
+
next if k == 'subject' or k == 'reply-to'
|
94
|
+
header.push([key, value])
|
95
|
+
}
|
96
|
+
header.push(['Subject', subject],
|
97
|
+
['Reply-To', @address],
|
98
|
+
['X-Mail-Count',@count])
|
99
|
+
header.concat(quickml_fields)
|
100
|
+
|
101
|
+
mail = {
|
102
|
+
:mail_from => @return_address,
|
103
|
+
:recipient => get_active_members,
|
104
|
+
:header => header,
|
105
|
+
:body => body
|
106
|
+
}
|
107
|
+
Sendmail(@config.smtp_host, @config.smtp_port, @logger, mail)
|
108
|
+
end
|
109
|
+
|
110
|
+
def send_confirmation (creator_address)
|
111
|
+
header = []
|
112
|
+
subject = Mail.encode_field(_("[%s] Confirmation: %s", @name, @address))
|
113
|
+
header.push(['To', creator_address],
|
114
|
+
['From', confirmation_address],
|
115
|
+
['Subject', subject],
|
116
|
+
['Content-Type', content_type])
|
117
|
+
body = confirmation_message(@address)
|
118
|
+
mail = {
|
119
|
+
:mail_from => '',
|
120
|
+
:recipient => creator_address,
|
121
|
+
:header => header,
|
122
|
+
:body => body,
|
123
|
+
}
|
124
|
+
Sendmail(@config.smtp_host, @config.smtp_port, @logger, mail)
|
125
|
+
@logger.log "[#{@name}]: Send confirmation: #{confirmation_address} #{creator_address}"
|
126
|
+
end
|
127
|
+
|
128
|
+
# FIXME: too similar to report_too_large_mail in ml-session.rb
|
129
|
+
def report_too_large_mail (mail)
|
130
|
+
header = []
|
131
|
+
subject = Mail.encode_field(_("[QuickML] Error: %s", mail['Subject']))
|
132
|
+
header.push(['To', mail.from],
|
133
|
+
['From', @address],
|
134
|
+
['Subject', subject],
|
135
|
+
['Content-Type', content_type])
|
136
|
+
max = @group_config[:max_mail_length].commify
|
137
|
+
body = _("Sorry, your mail exceeds the length limitation.\n")
|
138
|
+
body << _("The max length is %s bytes.\n\n", max)
|
139
|
+
orig_subject = codeconv(Mail.decode_subject(mail['Subject']))
|
140
|
+
body << "Subject: #{orig_subject}\n"
|
141
|
+
body << "To: #{mail['To']}\n"
|
142
|
+
body << "From: #{mail['From']}\n"
|
143
|
+
body << "Date: #{mail['Date']}\n"
|
144
|
+
|
145
|
+
mail = {
|
146
|
+
:mail_from => '',
|
147
|
+
:recipient => mail.from,
|
148
|
+
:header => header,
|
149
|
+
:body => body,
|
150
|
+
}
|
151
|
+
Sendmail(@config.smtp_host, @config.smtp_port, @logger, mail)
|
152
|
+
end
|
153
|
+
|
154
|
+
def report_removed_member (error_address)
|
155
|
+
return if @members.active_empty?
|
156
|
+
subject = Mail.encode_field(_("[%s] Removed: <%s>",
|
157
|
+
@name, error_address))
|
158
|
+
header = [
|
159
|
+
['To', @address],
|
160
|
+
['From', @address],
|
161
|
+
['Subject', subject],
|
162
|
+
['Reply-To', @address],
|
163
|
+
['Content-Type', content_type]
|
164
|
+
]
|
165
|
+
header.concat(quickml_fields)
|
166
|
+
body = _("<%s> was removed from the mailing list:\n<%s>\n",
|
167
|
+
error_address, @address)
|
168
|
+
body << _("because the address was unreachable.\n")
|
169
|
+
body << generate_footer(true)
|
170
|
+
|
171
|
+
mail = {
|
172
|
+
:mail_from => '',
|
173
|
+
:recipient => get_active_members,
|
174
|
+
:header => header,
|
175
|
+
:body => body,
|
176
|
+
}
|
177
|
+
Sendmail(@config.smtp_host, @config.smtp_port, @logger, mail)
|
178
|
+
@logger.log "[#{@name}]: Notify: Remove #{error_address}"
|
179
|
+
end
|
180
|
+
|
181
|
+
def content_type
|
182
|
+
return Mail.content_type(@config.content_type, @message_charset)
|
183
|
+
end
|
184
|
+
|
185
|
+
def quickml_fields
|
186
|
+
return [
|
187
|
+
['Precedence', 'bulk'],
|
188
|
+
['X-ML-Address', @address],
|
189
|
+
['X-ML-Name', @name],
|
190
|
+
['X-ML-Info', @config.public_url],
|
191
|
+
['X-QuickML', 'true']
|
192
|
+
]
|
193
|
+
end
|
194
|
+
|
195
|
+
def confirmation_message(address)
|
196
|
+
body = ''
|
197
|
+
body += _("First, please read the agreement of this service.\n")
|
198
|
+
|
199
|
+
#body += _("http://example.com/qwikjpAgreementE.html\n")
|
200
|
+
body += _("http://qwik.jp/qwikjpAgreementE.html\n")
|
201
|
+
#body += "http://#{@cnfig.domain}/"+_('AgreementE.html')+"\n"
|
202
|
+
|
203
|
+
body += _("You must agree with this agreement to use the service.\n")
|
204
|
+
body += _("If you agree, then,\n")
|
205
|
+
body += _("Please simply reply to this mail to create ML <%s>.\n", address)
|
206
|
+
body
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
if $0 == __FILE__
|
212
|
+
require 'qwik/test-module-ml'
|
213
|
+
$test = true
|
214
|
+
end
|
215
|
+
|
216
|
+
if defined?($test) && $test
|
217
|
+
class TestGroupSendMail < Test::Unit::TestCase
|
218
|
+
include TestModuleML
|
219
|
+
|
220
|
+
def setup_qml
|
221
|
+
return QuickML::Group.new(@ml_config, 'test@example.com')
|
222
|
+
end
|
223
|
+
|
224
|
+
def test_class_method
|
225
|
+
c = QuickML::Group
|
226
|
+
end
|
227
|
+
|
228
|
+
def test_all
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
@@ -0,0 +1,374 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/config'
|
7
|
+
require 'qwik/server-memory'
|
8
|
+
require 'qwik/farm'
|
9
|
+
require 'qwik/site-plan'
|
10
|
+
require 'qwik/page-title'
|
11
|
+
require 'qwik/util-string'
|
12
|
+
require 'qwik/util-charset'
|
13
|
+
require 'qwik/util-filename'
|
14
|
+
require 'qwik/ml-gettext'
|
15
|
+
|
16
|
+
module QuickML
|
17
|
+
class Group
|
18
|
+
private
|
19
|
+
|
20
|
+
def init_site
|
21
|
+
@groupsite = GroupSite.new(@config, @name)
|
22
|
+
@site = @groupsite.site
|
23
|
+
end
|
24
|
+
|
25
|
+
def site_post(mail, test=false)
|
26
|
+
begin # Do not raise exception when posting a message.
|
27
|
+
@groupsite.post(mail)
|
28
|
+
@logger.log("[#{@name}]: QwikPost: #{@groupsite.key}")
|
29
|
+
rescue
|
30
|
+
@logger.log("[#{@name}]: QwikPostError: "+$!.to_s+$!.backtrace.to_s)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def page_url
|
35
|
+
key = @groupsite.key
|
36
|
+
base = ''
|
37
|
+
base = "#{key}.html" if key
|
38
|
+
#return "http://#{@config.ml_domain}/#{@name}/#{base}"
|
39
|
+
return "#{@config.public_url}#{@name}/#{base}"
|
40
|
+
end
|
41
|
+
|
42
|
+
def site_footer
|
43
|
+
# Do not raise exception when generating a footer.
|
44
|
+
begin
|
45
|
+
now = Time.now
|
46
|
+
now = Time.at(0) if defined?($test) && $test
|
47
|
+
return @groupsite.get_footer(now).set_page_charset.to_mail_charset
|
48
|
+
rescue
|
49
|
+
@logger.log("[#{@name}]: QwikFooterError: "+$!.to_s+$!.backtrace.to_s)
|
50
|
+
return '' # Do not raise error
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
def total_file_size_exceeded?
|
56
|
+
@groupsite.total_file_size_exceeded
|
57
|
+
end
|
58
|
+
|
59
|
+
def total_file_size_reaching?
|
60
|
+
@groupsite.total_file_size_reaching
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class GroupSite
|
65
|
+
include GetText
|
66
|
+
def initialize(ml_config, sitename, test=false)
|
67
|
+
@ml_config = ml_config
|
68
|
+
|
69
|
+
if test || defined?($test) && $test
|
70
|
+
@config = $test_config
|
71
|
+
@memory = $test_memory
|
72
|
+
else
|
73
|
+
|
74
|
+
=begin
|
75
|
+
hash = {:debug=>true}
|
76
|
+
|
77
|
+
# FIXME: Web Config should be inherited from the web server.
|
78
|
+
f = @ml_config[:config_file].path
|
79
|
+
if f.exist?
|
80
|
+
config = Qwik::Config.load_config_file(f.to_s)
|
81
|
+
hash.update(config)
|
82
|
+
end
|
83
|
+
|
84
|
+
@config = Qwik::Config.new
|
85
|
+
@config.update(hash)
|
86
|
+
=end
|
87
|
+
@config = @ml_config
|
88
|
+
@memory = Qwik::ServerMemory.new(@config)
|
89
|
+
end
|
90
|
+
|
91
|
+
@sitename = sitename
|
92
|
+
@site = @memory.farm.get_site(@sitename)
|
93
|
+
raise 'site does not exist' if @site.nil? # Check if the site is exist.
|
94
|
+
@key = nil
|
95
|
+
@total_file_size_exceeded = false
|
96
|
+
@total_file_size_reaching = false
|
97
|
+
end
|
98
|
+
attr_reader :key
|
99
|
+
attr_reader :site
|
100
|
+
attr_reader :total_file_size_exceeded
|
101
|
+
attr_reader :total_file_size_reaching
|
102
|
+
|
103
|
+
def post(mail)
|
104
|
+
# Parse page title.
|
105
|
+
title = mail.get_unified_subject(@sitename) # Get unified subject.
|
106
|
+
page_title, tags = Qwik::Page.parse_title(title)
|
107
|
+
|
108
|
+
page = @site.get_by_title(page_title)
|
109
|
+
if page.nil? # Create a new page.
|
110
|
+
if Qwik::Page.valid_as_pagekey?(page_title)
|
111
|
+
page = @site.create(page_title) # CREATE
|
112
|
+
else
|
113
|
+
page = @site.create_new # CREATE
|
114
|
+
end
|
115
|
+
page.store('* '+title+"\n") # Save title with tags.
|
116
|
+
end
|
117
|
+
@key = page.key # @key will be used at site_url
|
118
|
+
|
119
|
+
# Get body text.
|
120
|
+
now = $quickml_debug ? Time.at(0) : Time.now
|
121
|
+
content = make_content(@key, mail, now)
|
122
|
+
page.add(content)
|
123
|
+
end
|
124
|
+
|
125
|
+
def get_footer(now)
|
126
|
+
return '' if @site.nil?
|
127
|
+
footer = @site.get_footer(now)
|
128
|
+
return footer
|
129
|
+
end
|
130
|
+
|
131
|
+
private
|
132
|
+
def make_content(key, mail, now)
|
133
|
+
content = ''
|
134
|
+
mail_default_charset = 'ISO-2022-JP'
|
135
|
+
site_files_total = @site.files_total
|
136
|
+
max_total_file_size = @config[:max_total_file_size].to_i
|
137
|
+
max_total_warn_size = @config[:max_total_warn_size].to_i
|
138
|
+
|
139
|
+
mail.each_part {|sub_mail|
|
140
|
+
if sub_mail.plain_text_body?
|
141
|
+
c = sub_mail.decoded_body.normalize_eol
|
142
|
+
charset = c.guess_charset || mail_default_charset
|
143
|
+
c = c.set_charset(charset).to_page_charset
|
144
|
+
content << c
|
145
|
+
else
|
146
|
+
filename = sub_mail.filename
|
147
|
+
decoded_body = sub_mail.decoded_body
|
148
|
+
if filename && decoded_body
|
149
|
+
if max_total_file_size < site_files_total
|
150
|
+
#do not attach file
|
151
|
+
content << _("\nFile '%s' was not attached.\n",filename)
|
152
|
+
else
|
153
|
+
msg = GroupSite.attach(@site, key, filename, decoded_body)
|
154
|
+
content << msg
|
155
|
+
site_files_total += decoded_body.size
|
156
|
+
end
|
157
|
+
if max_total_file_size < site_files_total
|
158
|
+
@total_file_size_exceeded = true
|
159
|
+
elsif (max_total_file_size - max_total_warn_size) < site_files_total
|
160
|
+
@total_file_size_reaching = true
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
}
|
165
|
+
content.gsub!(/\n\n\z/, "\n") # FIXME: Why truncate newlines?
|
166
|
+
from = mail.mail_from
|
167
|
+
time = now.to_i
|
168
|
+
return "{{mail(#{from},#{time})
|
169
|
+
#{content}}}
|
170
|
+
"
|
171
|
+
end
|
172
|
+
|
173
|
+
def self.attach(site, key, filename, file_content)
|
174
|
+
files = site.files(key)
|
175
|
+
|
176
|
+
result_filename = files.fput(filename, file_content)
|
177
|
+
result_filename = result_filename.to_page_charset
|
178
|
+
|
179
|
+
addmessage = "\n{{file(#{filename})}}\n\n"
|
180
|
+
if result_filename != filename
|
181
|
+
addmessage = "\n{{file(#{result_filename})}}\n\n"
|
182
|
+
end
|
183
|
+
|
184
|
+
return addmessage
|
185
|
+
end
|
186
|
+
|
187
|
+
def self.file_with_num(filename, num)
|
188
|
+
return "#{num}-#{filename}"
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
if $0 == __FILE__
|
194
|
+
require 'qwik/test-module-ml'
|
195
|
+
require 'qwik/test-common'
|
196
|
+
$test = true
|
197
|
+
end
|
198
|
+
|
199
|
+
if defined?($test) && $test
|
200
|
+
require 'qwik/group'
|
201
|
+
|
202
|
+
class TestGroupSite < Test::Unit::TestCase
|
203
|
+
include TestModuleML
|
204
|
+
|
205
|
+
def setup_group
|
206
|
+
return QuickML::Group.new(@ml_config, 'test@example.com')
|
207
|
+
end
|
208
|
+
|
209
|
+
def test_class_method
|
210
|
+
c = QuickML::GroupSite
|
211
|
+
|
212
|
+
# test_file_with_num
|
213
|
+
eq '1-t', c.file_with_num('t', 1)
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_all
|
217
|
+
c = QuickML::GroupSite
|
218
|
+
|
219
|
+
group = setup_group
|
220
|
+
|
221
|
+
t_make_readable(QuickML::Group, :groupsite)
|
222
|
+
groupsite = group.groupsite
|
223
|
+
|
224
|
+
# test_key
|
225
|
+
eq nil, groupsite.key
|
226
|
+
|
227
|
+
# test_make_content
|
228
|
+
message =
|
229
|
+
'Date: Mon, 3 Feb 2001 12:34:56 +0900
|
230
|
+
From: user@e.com
|
231
|
+
To: test@example.com
|
232
|
+
Subject: test
|
233
|
+
|
234
|
+
test.
|
235
|
+
'
|
236
|
+
t_make_public(QuickML::GroupSite, :make_content)
|
237
|
+
mail = QuickML::Mail.generate { message }
|
238
|
+
eq "{{mail(user@e.com,0)\ntest.\n}}\n",
|
239
|
+
groupsite.make_content(nil, mail, Time.at(0))
|
240
|
+
|
241
|
+
# test_attach
|
242
|
+
eq '
|
243
|
+
{{file(t.txt)}}
|
244
|
+
|
245
|
+
',
|
246
|
+
c.attach(@site, 'FrontPage', 't.txt', 'test.')
|
247
|
+
files = @site.files('FrontPage')
|
248
|
+
eq true, files.exist?('t.txt')
|
249
|
+
eq ['t.txt'], files.list
|
250
|
+
|
251
|
+
# test_attach_again
|
252
|
+
eq '
|
253
|
+
{{file(1-t.txt)}}
|
254
|
+
|
255
|
+
',
|
256
|
+
c.attach(@site, 'FrontPage', 't.txt', 'test.')
|
257
|
+
eq true, files.exist?('1-t.txt')
|
258
|
+
eq ['1-t.txt', 't.txt'], files.list
|
259
|
+
|
260
|
+
# test_page_url
|
261
|
+
t_make_public(QuickML::Group, :page_url)
|
262
|
+
eq 'http://example.com/test/', group.page_url
|
263
|
+
groupsite.instance_eval {
|
264
|
+
@key = 't'
|
265
|
+
}
|
266
|
+
eq 'http://example.com/test/t.html', group.page_url
|
267
|
+
|
268
|
+
# test_attach
|
269
|
+
eq '
|
270
|
+
{{file(あ.txt)}}
|
271
|
+
|
272
|
+
',
|
273
|
+
c.attach(@site, 'FrontPage', 'あ.txt', 'test.')
|
274
|
+
eq true, files.exist?('t.txt')
|
275
|
+
#eq true, files.exist?('=82=A0.txt')
|
276
|
+
#eq ['1-t.txt', '=82=A0.txt', 't.txt'], files.list
|
277
|
+
end
|
278
|
+
|
279
|
+
def test_total_file_limit
|
280
|
+
c = QuickML::GroupSite
|
281
|
+
|
282
|
+
group = setup_group
|
283
|
+
|
284
|
+
t_make_readable(QuickML::Group, :groupsite)
|
285
|
+
groupsite = group.groupsite
|
286
|
+
|
287
|
+
#attach 712B file named 'ruby.png'
|
288
|
+
multi_part_message =
|
289
|
+
'Date: Tue, 13 Jan 2009 21:51:41 +0900
|
290
|
+
From: user@e.com
|
291
|
+
To: test@example.com
|
292
|
+
Subject: test
|
293
|
+
Content-Type: multipart/mixed;
|
294
|
+
boundary="Multipart_Tue_Jan_13_21:58:38_2009-1"
|
295
|
+
|
296
|
+
--Multipart_Tue_Jan_13_21:58:38_2009-1
|
297
|
+
Content-Type: text/plain; charset=US-ASCII
|
298
|
+
|
299
|
+
ruby
|
300
|
+
|
301
|
+
--Multipart_Tue_Jan_13_21:58:38_2009-1
|
302
|
+
Content-Type: image/png
|
303
|
+
Content-Disposition: inline; filename="ruby.png"
|
304
|
+
Content-Transfer-Encoding: base64
|
305
|
+
|
306
|
+
iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAIAAACp9tltAAAAAXNSR0IArs4c6QAAAoJJREFUKM8F
|
307
|
+
wUlPE1EAAOC3zXSWbtMylBbaAEUsEKlQIkSlogkxRm9eSLx78Z94NSR6MzEuF42JejUx0URNMFAo
|
308
|
+
RUJtEUqBCp1pO0unM+/5ffBxfum8XMaSbBsGkWSPUQqA03UoAIAQj1IAodE2cvfu4KU+Nf9gJdKv
|
309
|
+
Dgyn9GJRxhjqWvbmjWQq1S4UFMEXQhBalokwMXRdGRk53NoeXpg/2ipKStgxTCJJA5MTWu0QEeJZ
|
310
|
+
Fg6HWxjjqyFlLDcTHUsfbRQwxyWy06FEghN8Xq/Xn7mYXlyUlPB5rWZQhgDGsqoW3r1P5mbFcFgI
|
311
|
+
BXm/zChzTKu2vr726nU0PXr+p0o4jjCEvj5ZbVT3TU33q31G4xRh7FgWdT29dgQRKn74yDyPIESs
|
312
|
+
VrsF2MTt5cHhZGw8bRta8dNn5guKgaDV1Ox2+7j0GxMMAUPB5ODcyn3QqO++eL79dDW9fLdvPndQ
|
313
|
+
KNT/VuO5LLUsSD2CEIIQX4vF7NLmWWUfCgIRJUi7zW9fui4oN/7F4nF4ckwwRJ7LIlHUOv3XdRw+
|
314
|
+
qrSbWmBy+mCjdHLaCfqD2Xxejcc41xIJFDHjEEQMY8jzRrOpZi/NP3rYYsgR5UrjTFYiEYHDXlck
|
315
|
+
QCKAQ5B4jLV0LZGZmLyeq755ptfrtb09JEu0Y3WOagGZI4RxPLMJIE7PHbqVT4VDWy/fYp8ojWda
|
316
|
+
rjs1O+M2dey2RR5gjjKXmRigyFAiMze39/OX4490bNozrJGFK/rJMXJtwTVFHokEiBwQOYSnMN8q
|
317
|
+
7XQs2wTAJFhNj2KO7Hz/cXlmKqZVcM8UOSgxx/ZHSCSZKlf3BdHn2QaDQF/bQJQCKbS5W6lblNCA
|
318
|
+
ADFPoXIh8x8NLS3ZvcTDhQAAAABJRU5ErkJggg==
|
319
|
+
|
320
|
+
--Multipart_Tue_Jan_13_21:58:38_2009-1--
|
321
|
+
'
|
322
|
+
|
323
|
+
default_max_total_file_size = @config[:max_total_file_size]
|
324
|
+
default_max_total_warn_size = @config[:max_total_warn_size]
|
325
|
+
|
326
|
+
@config[:max_total_file_size] = 800 #total file size limit
|
327
|
+
@config[:max_total_warn_size] = 100 #warn if remaining is less than this
|
328
|
+
|
329
|
+
t_make_writable(QuickML::GroupSite, :total_file_size_exceeded)
|
330
|
+
t_make_writable(QuickML::GroupSite, :total_file_size_reaching)
|
331
|
+
|
332
|
+
mail = QuickML::Mail.generate { multi_part_message }
|
333
|
+
|
334
|
+
|
335
|
+
##post first mail
|
336
|
+
groupsite.post(mail)
|
337
|
+
files = @site.files('test')
|
338
|
+
|
339
|
+
#check if attached file is saved on the web
|
340
|
+
eq ['ruby.png'], files.list
|
341
|
+
|
342
|
+
#check if warning is on
|
343
|
+
eq true, groupsite.total_file_size_reaching
|
344
|
+
|
345
|
+
##post second mail
|
346
|
+
groupsite.total_file_size_reaching = false
|
347
|
+
groupsite.post(mail)
|
348
|
+
|
349
|
+
# check if attached file is save on the web
|
350
|
+
eq ['1-ruby.png','ruby.png'], files.list
|
351
|
+
|
352
|
+
#check if total file size is exceeded the limit(800)
|
353
|
+
eq true, groupsite.total_file_size_exceeded
|
354
|
+
|
355
|
+
##post second mail
|
356
|
+
groupsite.total_file_size_exceeded = false
|
357
|
+
groupsite.post(mail)
|
358
|
+
|
359
|
+
#check if file is not attached
|
360
|
+
eq ['1-ruby.png','ruby.png'], files.list
|
361
|
+
|
362
|
+
#check if total file size is exceeded the limit(800)
|
363
|
+
eq true, groupsite.total_file_size_exceeded
|
364
|
+
|
365
|
+
|
366
|
+
#check if the warning message is inserted on the web
|
367
|
+
eq "{{mail(user@e.com,0)\nruby\n\n\n{{file(ruby.png)}}\n}}\n{{mail(user@e.com,0)\nruby\n\n\n{{file(1-ruby.png)}}\n}}\n{{mail(user@e.com,0)\nruby\n\n\nFile 'ruby.png' was not attached.\n}}\n", @site['test'].get_body
|
368
|
+
|
369
|
+
|
370
|
+
@config[:max_total_file_size] = default_max_total_file_size
|
371
|
+
@config[:max_total_warn_size] = default_max_total_warn_size
|
372
|
+
end
|
373
|
+
end
|
374
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2002-2004 Satoru Takabayashi <satoru@namazu.org>
|
3
|
+
# Copyright (C) 2003-2006 Kouichirou Eto
|
4
|
+
# All rights reserved.
|
5
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
6
|
+
#
|
7
|
+
# You can redistribute it and/or modify it under the terms of
|
8
|
+
# the GNU General Public License version 2.
|
9
|
+
#
|
10
|
+
|
11
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
12
|
+
require 'qwik/group'
|
13
|
+
|
14
|
+
module QuickML
|
15
|
+
class Group
|
16
|
+
def need_alert?(now = Time.now)
|
17
|
+
return false if forward? || @group_config.permanent? || alerted?
|
18
|
+
return @db.last_article_time + @group_config[:ml_alert_time] <= now
|
19
|
+
end
|
20
|
+
|
21
|
+
def inactive?(now = Time.now)
|
22
|
+
return false if forward? || @group_config.permanent?
|
23
|
+
return @db.last_article_time + @group_config[:ml_life_time] < now
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
if $0 == __FILE__
|
29
|
+
require 'qwik/group'
|
30
|
+
require 'qwik/test-module-ml'
|
31
|
+
$test = true
|
32
|
+
end
|
33
|
+
|
34
|
+
if defined?($test) && $test
|
35
|
+
class TestGroupSweep < Test::Unit::TestCase
|
36
|
+
include TestModuleML
|
37
|
+
|
38
|
+
def setup_group
|
39
|
+
return QuickML::Group.new(@ml_config, 'test@example.com')
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_all
|
43
|
+
group = setup_group
|
44
|
+
|
45
|
+
ok_eq(false, group.forward?)
|
46
|
+
|
47
|
+
# t_make_public(QuickML::Group, :permanent?)
|
48
|
+
# ok_eq(false, group.permanent?)
|
49
|
+
|
50
|
+
t_make_readable(QuickML::Group, :db)
|
51
|
+
assert_instance_of(Time, group.db.last_article_time)
|
52
|
+
|
53
|
+
t_make_readable(QuickML::Group, :group_config)
|
54
|
+
ok_eq(2678400, group.group_config[:ml_life_time])
|
55
|
+
|
56
|
+
t_make_public(QuickML::Group, :alerted?)
|
57
|
+
ok_eq(false, group.alerted?)
|
58
|
+
|
59
|
+
ok_eq(false, group.need_alert?(Time.at(0)))
|
60
|
+
ok_eq(false, group.need_alert?(Time.at(1000000000)))
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|