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,341 @@
|
|
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
|
+
require 'optparse'
|
6
|
+
|
7
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
8
|
+
require 'qwik/config'
|
9
|
+
require 'qwik/version'
|
10
|
+
require 'qwik/util-pathname'
|
11
|
+
require 'qwik/mailaddress'
|
12
|
+
require 'pp'
|
13
|
+
require 'qwik/qp'
|
14
|
+
|
15
|
+
module Qwik
|
16
|
+
class QwikService
|
17
|
+
QWIKWEB_SERVER = '/usr/bin/qwikweb-server'
|
18
|
+
QWIKWEB_PID = '/var/run/qwik/qwikweb.pid'
|
19
|
+
QUICKML_SERVER = '/usr/bin/quickml-server'
|
20
|
+
QUICKML_PID = '/var/run/qwik/quickml.pid'
|
21
|
+
|
22
|
+
def self.main(args)
|
23
|
+
self.new.run(args)
|
24
|
+
end
|
25
|
+
|
26
|
+
def run(args)
|
27
|
+
@config = Config.new
|
28
|
+
args_conf, cmd = QwikService.parse_args('qwik-service', args)
|
29
|
+
@config.update(args_conf) # config file is specified by args
|
30
|
+
file_conf = Config.load_config_file(@config[:config_file])
|
31
|
+
@config.update(file_conf)
|
32
|
+
@config.update(args_conf) # Set args again to override.
|
33
|
+
|
34
|
+
cmd, cmd_args = cmd
|
35
|
+
|
36
|
+
if self.respond_to?(cmd)
|
37
|
+
return self.send(cmd) if cmd_args.nil?
|
38
|
+
return self.send(cmd, cmd_args)
|
39
|
+
end
|
40
|
+
warn "Error: unknown cmd [#{cmd}]"
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.parse_args(myprog, args)
|
44
|
+
config = {}
|
45
|
+
cmd = []
|
46
|
+
optionparser = OptionParser.new {|opts|
|
47
|
+
opts.banner = "Usage: #{myprog} [options]"
|
48
|
+
opts.separator ''
|
49
|
+
opts.separator 'Specific options:'
|
50
|
+
opts.on('-c', '--config file', 'Specify config file.') {|a|
|
51
|
+
config[:config_file] = a
|
52
|
+
}
|
53
|
+
opts.on('-d', '--[no-]debug', 'Run in debug mode.') {|a|
|
54
|
+
config[:debug] = a
|
55
|
+
}
|
56
|
+
opts.on('--start', 'Start qwikWeb and QuickML services.') {|a|
|
57
|
+
cmd = [:start]
|
58
|
+
}
|
59
|
+
opts.on('--stop', 'Stop qwikWeb and QuickML services.') {|a|
|
60
|
+
cmd = [:stop]
|
61
|
+
}
|
62
|
+
opts.on('--restart', 'Restart qwikWeb and QuickML services.') {|a|
|
63
|
+
cmd = [:restart]
|
64
|
+
}
|
65
|
+
opts.on('--web-start', 'Start qwikWeb services.') {|a|
|
66
|
+
cmd = [:web_start]
|
67
|
+
}
|
68
|
+
opts.on('--web-stop', 'Stop qwikWeb services.') {|a|
|
69
|
+
cmd = [:web_stop]
|
70
|
+
}
|
71
|
+
opts.on('--web-restart', 'Restart qwikWeb services.') {|a|
|
72
|
+
cmd = [:web_restart]
|
73
|
+
}
|
74
|
+
opts.on('--ml-start', 'Start QuickML services.') {|a|
|
75
|
+
cmd = [:ml_start]
|
76
|
+
}
|
77
|
+
opts.on('--ml-stop', 'Stop QuickML services.') {|a|
|
78
|
+
cmd = [:ml_stop]
|
79
|
+
}
|
80
|
+
opts.on('--ml-restart', 'Restart QuickML services.') {|a|
|
81
|
+
cmd = [:ml_restart]
|
82
|
+
}
|
83
|
+
opts.on('--watchlog', 'Watch log continuously.') {|a|
|
84
|
+
cmd = [:watchlog]
|
85
|
+
}
|
86
|
+
opts.on('--makesite sitename,mailaddr', 'Make a new site.') {|a|
|
87
|
+
cmd = [:makesite, a]
|
88
|
+
}
|
89
|
+
opts.on('--adduser sitename,mailaddr', 'Add a user.') {|a|
|
90
|
+
cmd = [:adduser, a]
|
91
|
+
}
|
92
|
+
opts.on('--showpassword mailaddress', 'Show password.') {|a|
|
93
|
+
cmd = [:showpassword, a]
|
94
|
+
}
|
95
|
+
opts.on('--incgen mailaddress', 'Increment a generation.') {|a|
|
96
|
+
cmd = [:incgen, a]
|
97
|
+
}
|
98
|
+
opts.separator ''
|
99
|
+
opts.separator 'Debug options:'
|
100
|
+
opts.on('--showinactive', 'Show inactive sites.') {|a|
|
101
|
+
cmd = [:showinactive, a]
|
102
|
+
}
|
103
|
+
opts.separator ''
|
104
|
+
opts.separator 'Common options:'
|
105
|
+
opts.on_tail('-h', '--help', 'Show this message.') {
|
106
|
+
puts opts
|
107
|
+
exit
|
108
|
+
}
|
109
|
+
opts.on_tail('-v', '--version', 'Show version.') {
|
110
|
+
puts VERSION
|
111
|
+
exit
|
112
|
+
}
|
113
|
+
|
114
|
+
}
|
115
|
+
|
116
|
+
begin
|
117
|
+
optionparser.parse!(args)
|
118
|
+
rescue OptionParser::ParseError => err
|
119
|
+
puts err.message
|
120
|
+
puts optionparser.to_s
|
121
|
+
exit
|
122
|
+
end
|
123
|
+
if cmd.empty?
|
124
|
+
puts optionparser.to_s
|
125
|
+
exit
|
126
|
+
end
|
127
|
+
return config, cmd
|
128
|
+
end
|
129
|
+
|
130
|
+
def start
|
131
|
+
web_start
|
132
|
+
ml_start
|
133
|
+
end
|
134
|
+
|
135
|
+
def stop
|
136
|
+
web_stop
|
137
|
+
ml_stop
|
138
|
+
end
|
139
|
+
|
140
|
+
def restart
|
141
|
+
stop
|
142
|
+
sleep 1
|
143
|
+
start
|
144
|
+
end
|
145
|
+
|
146
|
+
def web_start
|
147
|
+
start_cmd('Starting qwikWeb services: ',
|
148
|
+
"#{QWIKWEB_SERVER} -c #{@config[:config_file]}")
|
149
|
+
end
|
150
|
+
|
151
|
+
def web_stop
|
152
|
+
pidfile = @config[:web_pid_file] || QWIKWEB_PID
|
153
|
+
pidfile += '-d' if @config[:debug]
|
154
|
+
stop_cmd('Stopping qwikWeb services: ', pidfile)
|
155
|
+
end
|
156
|
+
|
157
|
+
def web_restart
|
158
|
+
web_stop
|
159
|
+
sleep 1
|
160
|
+
web_start
|
161
|
+
end
|
162
|
+
|
163
|
+
def ml_start
|
164
|
+
start_cmd('Starting QuickML services: ',
|
165
|
+
"#{QUICKML_SERVER} -c #{@config[:config_file]}")
|
166
|
+
end
|
167
|
+
|
168
|
+
def ml_stop
|
169
|
+
pidfile = @config[:ml_pid_file] || QUICKML_PID
|
170
|
+
stop_cmd('Stopping QuickML services: ', pidfile)
|
171
|
+
end
|
172
|
+
|
173
|
+
def ml_restart
|
174
|
+
ml_stop
|
175
|
+
sleep 1
|
176
|
+
ml_start
|
177
|
+
end
|
178
|
+
|
179
|
+
def watchlog
|
180
|
+
require 'qwik/qwikweb-watchlog'
|
181
|
+
WatchLog.new(@config).run
|
182
|
+
end
|
183
|
+
|
184
|
+
def makesite(args)
|
185
|
+
require 'qwik/farm'
|
186
|
+
require 'qwik/mailaddress'
|
187
|
+
|
188
|
+
def usage
|
189
|
+
warn 'Usage: qwik-service --makesite sitename,yourmailaddress'
|
190
|
+
exit
|
191
|
+
end
|
192
|
+
|
193
|
+
sitename, mail = args.split(/,/, 2)
|
194
|
+
return usage if sitename.nil? || sitename.empty?
|
195
|
+
return usage if mail.nil? || mail.empty?
|
196
|
+
if ! MailAddress.valid?(mail)
|
197
|
+
warn "Error: invalid mail form [#{mail}]"
|
198
|
+
return usage
|
199
|
+
end
|
200
|
+
|
201
|
+
memory = ServerMemory.new(@config)
|
202
|
+
farm = Farm.new(@config, memory)
|
203
|
+
|
204
|
+
site = nil
|
205
|
+
begin
|
206
|
+
site = farm.make_site(sitename)
|
207
|
+
rescue Errno::EACCES => e
|
208
|
+
error e.to_s
|
209
|
+
rescue => e
|
210
|
+
error "The site [#{sitename}] is already exist."
|
211
|
+
end
|
212
|
+
|
213
|
+
site = farm.get_site(sitename)
|
214
|
+
site.member.add(mail)
|
215
|
+
|
216
|
+
puts "Creating a new site [#{sitename}] and
|
217
|
+
adding an initial user [#{mail}] is completed."
|
218
|
+
end
|
219
|
+
|
220
|
+
def adduser(args)
|
221
|
+
require 'qwik/farm'
|
222
|
+
require 'qwik/mailaddress'
|
223
|
+
|
224
|
+
def usage
|
225
|
+
die 'Usage: qwik-service --adduser sitename,mailaddress'
|
226
|
+
end
|
227
|
+
|
228
|
+
sitename, mail = args.split(/,/, 2)
|
229
|
+
return usage if sitename.nil? || sitename.empty?
|
230
|
+
return usage if mail.nil? || mail.empty?
|
231
|
+
if ! MailAddress.valid?(mail)
|
232
|
+
warn "Error: invalid mail form [#{mail}]"
|
233
|
+
return usage
|
234
|
+
end
|
235
|
+
|
236
|
+
memory = ServerMemory.new(@config)
|
237
|
+
farm = Farm.new(@config, memory)
|
238
|
+
|
239
|
+
site = farm.get_site(sitename)
|
240
|
+
if site.nil?
|
241
|
+
error "The site [#{sitename}] does not exist."
|
242
|
+
end
|
243
|
+
|
244
|
+
if site.member.exist?(mail)
|
245
|
+
error "A user [#{mail}] is already exist."
|
246
|
+
end
|
247
|
+
|
248
|
+
site.member.add(mail)
|
249
|
+
puts "Adding a new user [#{mail}] to site [#{sitename}] is completed."
|
250
|
+
end
|
251
|
+
|
252
|
+
def showpassword(mail)
|
253
|
+
require 'qwik/password'
|
254
|
+
require 'qwik/mailaddress'
|
255
|
+
|
256
|
+
def usage
|
257
|
+
die 'Usage: qwik-service --showpassword mailaddress'
|
258
|
+
end
|
259
|
+
|
260
|
+
return usage if mail.nil? || mail.empty?
|
261
|
+
if ! MailAddress.valid?(mail)
|
262
|
+
warn "Error: invalid mail form [#{mail}]"
|
263
|
+
return usage
|
264
|
+
end
|
265
|
+
|
266
|
+
gen = PasswordGenerator.new(@config)
|
267
|
+
puts "mail: #{mail}"
|
268
|
+
puts "pass: #{gen.generate(mail)}"
|
269
|
+
end
|
270
|
+
|
271
|
+
def incgen(mail)
|
272
|
+
require 'qwik/password'
|
273
|
+
|
274
|
+
def usage
|
275
|
+
die 'Usage: qwik-service --showpassword mailaddress'
|
276
|
+
end
|
277
|
+
|
278
|
+
return usage if mail.nil? || mail.empty?
|
279
|
+
if ! MailAddress.valid?(mail)
|
280
|
+
warn "Error: invalid mail form [#{mail}]"
|
281
|
+
return usage
|
282
|
+
end
|
283
|
+
|
284
|
+
gen = PasswordGenerator.new(@config)
|
285
|
+
g = gen.generation_inc(mail)
|
286
|
+
puts "mail: #{mail}"
|
287
|
+
puts "generation: #{g}"
|
288
|
+
puts "increment generation done."
|
289
|
+
end
|
290
|
+
|
291
|
+
def showinactive(*a)
|
292
|
+
require 'qwik/farm'
|
293
|
+
|
294
|
+
memory = ServerMemory.new(@config)
|
295
|
+
farm = Farm.new(@config, memory)
|
296
|
+
inactive_sites = farm.check_inactive_sites
|
297
|
+
p inactive_sites
|
298
|
+
end
|
299
|
+
|
300
|
+
private
|
301
|
+
|
302
|
+
def die(msg)
|
303
|
+
warn msg
|
304
|
+
exit
|
305
|
+
end
|
306
|
+
|
307
|
+
def error(msg)
|
308
|
+
warn "Error: " + msg
|
309
|
+
exit 1
|
310
|
+
end
|
311
|
+
|
312
|
+
def start_cmd(msg, cmd)
|
313
|
+
print msg
|
314
|
+
system cmd
|
315
|
+
puts
|
316
|
+
end
|
317
|
+
|
318
|
+
def stop_cmd(msg, pid_file)
|
319
|
+
print msg
|
320
|
+
pid = pid_file.path.read.to_i
|
321
|
+
Process.kill(:KILL, pid)
|
322
|
+
puts
|
323
|
+
|
324
|
+
# pid = `cat /usr/local/qwik/log/qwikweb.pid`
|
325
|
+
# pid = `cat /var/run/qwik/qwikweb.pid`
|
326
|
+
# process = `ps ho%c -p $pid`
|
327
|
+
# if [ $process = "qwikweb-server" ] ; then
|
328
|
+
# kill $pid
|
329
|
+
# echo
|
330
|
+
# else
|
331
|
+
# echo "Stopping failed."
|
332
|
+
# fi
|
333
|
+
end
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
if $0 == __FILE__
|
338
|
+
args = ARGV
|
339
|
+
#args << '-d' # force debug mode
|
340
|
+
Qwik::QwikService.main(args)
|
341
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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
|
+
=begin
|
6
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
7
|
+
require 'qwik/config'
|
8
|
+
require 'qwik/farm'
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class AddUser
|
12
|
+
def self.main(argv)
|
13
|
+
if argv.length != 2
|
14
|
+
puts "Usage: qwikweb-adduser [sitename] [mail address]"
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
config = Config.new
|
19
|
+
memory = ServerMemory.new(config)
|
20
|
+
farm = Farm.new(config, memory)
|
21
|
+
sitename = argv.shift
|
22
|
+
mail = argv.shift
|
23
|
+
begin
|
24
|
+
site = farm.get_site(sitename)
|
25
|
+
site.member.add(mail)
|
26
|
+
rescue
|
27
|
+
puts 'Error: The site does not exist.'
|
28
|
+
exit 1
|
29
|
+
end
|
30
|
+
puts 'Adding a new user completed.'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
=end
|
@@ -0,0 +1,110 @@
|
|
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/gettext'
|
7
|
+
include Qwik
|
8
|
+
include Qwik::GetText
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class CatalogValidator
|
12
|
+
def self.main(argv)
|
13
|
+
if argv.length < 2
|
14
|
+
puts "usage: ruby catalog-validator.rb <catalog> <source...>"
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
catalog_file = argv.shift
|
19
|
+
catalog = load_catalog(catalog_file)
|
20
|
+
set_catalog(catalog)
|
21
|
+
|
22
|
+
ok = true
|
23
|
+
argv.each {|source_file|
|
24
|
+
validator = self.new(source_file, catalog)
|
25
|
+
validator.validate
|
26
|
+
validator.error_messages.each {|message|
|
27
|
+
puts message
|
28
|
+
}
|
29
|
+
ok = (ok and validator.ok?)
|
30
|
+
}
|
31
|
+
if ok then exit else exit(1) end
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize (source_file_name, messages)
|
35
|
+
@source_file_name = source_file_name
|
36
|
+
@gettext_catalog = messages
|
37
|
+
@error_messages = []
|
38
|
+
end
|
39
|
+
attr_reader :error_messages
|
40
|
+
|
41
|
+
def read_file_with_numbering (file_name)
|
42
|
+
content = ''
|
43
|
+
File.open(file_name).each_with_index {|line, idx|
|
44
|
+
lineno = idx + 1
|
45
|
+
content << line.gsub(/\b_\(/, "_[#{lineno}](")
|
46
|
+
}
|
47
|
+
content
|
48
|
+
end
|
49
|
+
|
50
|
+
def collect_messages (content)
|
51
|
+
messages = []
|
52
|
+
while content.sub!(/\b_\[(\d+)\]\(("(?:\\"|.)*?").*?\)/m, "")
|
53
|
+
lineno = $1.to_i
|
54
|
+
message = eval($2)
|
55
|
+
messages.push([lineno, message])
|
56
|
+
end
|
57
|
+
messages
|
58
|
+
end
|
59
|
+
|
60
|
+
def validate
|
61
|
+
@gettext_catalog or return
|
62
|
+
content = read_file_with_numbering(@source_file_name)
|
63
|
+
messages = collect_messages(content)
|
64
|
+
messages.each {|lineno, message|
|
65
|
+
translated_message = @gettext_catalog[message]
|
66
|
+
if not translated_message
|
67
|
+
message =
|
68
|
+
sprintf('%s:%d: %s', @source_file_name, lineno, message.inspect)
|
69
|
+
@error_messages.push(message)
|
70
|
+
elsif message.count('%') != translated_message.count('%')
|
71
|
+
message = sprintf("%s:%d: %s => # of %% mismatch.",
|
72
|
+
@source_file_name,
|
73
|
+
lineno, message.inspect, translated_message)
|
74
|
+
@error_messages.push(message)
|
75
|
+
end
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
def ok?
|
80
|
+
@error_messages.empty?
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
if $0 == __FILE__
|
86
|
+
Qwik::CatalogValidator.main(ARGV)
|
87
|
+
end
|
88
|
+
|
89
|
+
if defined?($test) && $test
|
90
|
+
require 'qwik/testunit'
|
91
|
+
|
92
|
+
class TestCatalogValidator < Test::Unit::TestCase
|
93
|
+
include Qwik::GetText
|
94
|
+
|
95
|
+
def test_dummy
|
96
|
+
end
|
97
|
+
|
98
|
+
def nutest_validator
|
99
|
+
#validator = CatalogValidator.new($0, CATALOG)
|
100
|
+
validator = Qwik::CatalogValidator.new($0, CATALOG)
|
101
|
+
validator.validate
|
102
|
+
ok_eq(true, validator.ok?)
|
103
|
+
|
104
|
+
#validator = CatalogValidator.new($0, {})
|
105
|
+
validator = Qwik::CatalogValidator.new($0, {})
|
106
|
+
validator.validate
|
107
|
+
ok_eq(false, validator.ok?)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,28 @@
|
|
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
|
+
=begin
|
6
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
7
|
+
require 'qwik/config'
|
8
|
+
require 'qwik/password'
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class IncrementGeneration
|
12
|
+
def self.main(argv)
|
13
|
+
if argv.length == 0
|
14
|
+
puts 'usage: qwikweb-incgen [mailaddress]'
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
config = Config.new
|
19
|
+
gen = PasswordGenerator.new(config)
|
20
|
+
mail = argv.shift
|
21
|
+
g = gen.generation_inc(mail)
|
22
|
+
puts 'mail: '+mail
|
23
|
+
puts 'generation: '+g.to_s
|
24
|
+
puts 'increment generation done.'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
=end
|
@@ -0,0 +1,41 @@
|
|
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
|
+
=begin
|
6
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
7
|
+
require 'qwik/config'
|
8
|
+
require 'qwik/farm'
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class MakeSite
|
12
|
+
def self.main(argv)
|
13
|
+
return usage if argv.length != 2
|
14
|
+
|
15
|
+
config = Config.new
|
16
|
+
memory = ServerMemory.new(config)
|
17
|
+
farm = Farm.new(config, memory)
|
18
|
+
|
19
|
+
sitename = argv.shift
|
20
|
+
mail = argv.shift
|
21
|
+
return usage if sitename.nil? || sitename.empty?
|
22
|
+
return usage if mail.nil? || mail.empty?
|
23
|
+
|
24
|
+
begin
|
25
|
+
site = farm.make_site(sitename)
|
26
|
+
site = farm.get_site(sitename)
|
27
|
+
site.member.add(mail)
|
28
|
+
rescue => e
|
29
|
+
puts 'Error: The site is already exist.'
|
30
|
+
exit 1
|
31
|
+
end
|
32
|
+
puts 'Creating a new site completed.'
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.usage
|
36
|
+
puts 'usage: qwikweb-makesite [sitename] [your mail address]'
|
37
|
+
exit
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
=end
|
@@ -0,0 +1,44 @@
|
|
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/loadlib'
|
8
|
+
require 'qwik/server'
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class QwikWebServer
|
12
|
+
def self.main(args)
|
13
|
+
return if defined?($qwikweb_server_running) && $qwikweb_server_running
|
14
|
+
|
15
|
+
File.umask(0)
|
16
|
+
|
17
|
+
config = Config.new
|
18
|
+
Config.load_args_and_config(config, $0, args)
|
19
|
+
|
20
|
+
# Load all actions here.
|
21
|
+
LoadLibrary.load_libs_here('qwik/act-*.rb')
|
22
|
+
LoadLibrary.load_libs_here('qwik/plugin/act-*.rb')
|
23
|
+
|
24
|
+
if config[:server_type] == 'webrick'
|
25
|
+
server = Server.new(config)
|
26
|
+
elsif config[:server_type] == 'mongrel'
|
27
|
+
require 'qwik/mongrel-server'
|
28
|
+
server = MongrelServer.new(config)
|
29
|
+
else
|
30
|
+
puts 'Error'
|
31
|
+
exit
|
32
|
+
end
|
33
|
+
|
34
|
+
$qwikweb_server_running = true
|
35
|
+
server.start
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
if $0 == __FILE__
|
41
|
+
args = ARGV
|
42
|
+
args << '-d' # force debug mode
|
43
|
+
Qwik::QwikWebServer.main(args)
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
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
|
+
=begin
|
6
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
7
|
+
require 'qwik/config'
|
8
|
+
require 'qwik/password'
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class ShowPassword
|
12
|
+
def self.main(argv)
|
13
|
+
if argv.length == 0
|
14
|
+
puts 'usage: qwikweb-showpassword [mailaddress]'
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
config = Config.new
|
19
|
+
gen = PasswordGenerator.new(config)
|
20
|
+
mail = argv.shift
|
21
|
+
puts 'mail: '+mail
|
22
|
+
puts 'pass: '+gen.generate(mail)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
=end
|
@@ -0,0 +1,67 @@
|
|
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/util-pathname'
|
8
|
+
require 'qwik/logger'
|
9
|
+
|
10
|
+
module Qwik
|
11
|
+
class WatchLog
|
12
|
+
def self.main(args)
|
13
|
+
config = Config.new
|
14
|
+
Config.load_args_and_config(config, 'qwikweb-watchlog', args)
|
15
|
+
self.new(config).run
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(config)
|
19
|
+
@config = config
|
20
|
+
end
|
21
|
+
|
22
|
+
# http://colinux:9190/qtest/
|
23
|
+
def run
|
24
|
+
pid_path = @config.web_pid_file.path
|
25
|
+
if pid_path.exist?
|
26
|
+
str = pid_path.read
|
27
|
+
puts 'Process id: '+str
|
28
|
+
end
|
29
|
+
|
30
|
+
p error_log = @config.log_dir.path + Logger::WEB_ERROR_LOG
|
31
|
+
p access_log = @config.log_dir.path + Logger::ACCESS_LOG
|
32
|
+
p web_access_log = @config.log_dir.path + Logger::WEB_ACCESS_LOG
|
33
|
+
|
34
|
+
t1 = start_tail_f(error_log.to_s)
|
35
|
+
t2 = start_tail_f(web_access_log.to_s)
|
36
|
+
loop { sleep 1 }
|
37
|
+
end
|
38
|
+
|
39
|
+
def start_tail_f(file)
|
40
|
+
return Thread.new {
|
41
|
+
open(file) {|log|
|
42
|
+
log.seek(0, IO::SEEK_END)
|
43
|
+
tail_f(log) {|line| puts line }
|
44
|
+
}
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def tail_f(input)
|
49
|
+
loop {
|
50
|
+
line = input.gets
|
51
|
+
yield line if line
|
52
|
+
if input.eof?
|
53
|
+
sleep 1
|
54
|
+
input.seek(input.tell)
|
55
|
+
end
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if $0 == __FILE__
|
62
|
+
argv = ARGV
|
63
|
+
# argv << '-d'
|
64
|
+
# argv << '-c'
|
65
|
+
# argv << 'config-debug.txt'
|
66
|
+
Qwik::WatchLog.main(argv)
|
67
|
+
end
|