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,207 @@
|
|
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/wabisabi-basic'
|
7
|
+
|
8
|
+
module WabisabiTraverseModule
|
9
|
+
def traverse_element(*tags, &b)
|
10
|
+
if tags.length == 0 || (self[0].is_a?(Symbol) && tags.include?(self[0]))
|
11
|
+
yield(self)
|
12
|
+
end
|
13
|
+
|
14
|
+
self.each {|s|
|
15
|
+
next unless s.is_a?(Array)
|
16
|
+
s.traverse_element(*tags, &b) # Recursive.
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_tag(tag)
|
21
|
+
tag = tag.to_s
|
22
|
+
tag, num = split_name_num(tag)
|
23
|
+
find_nth_element(num, tag.intern)
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_by_class(klass)
|
27
|
+
get_has_attr(:class, klass)
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_path(path)
|
31
|
+
xml = self
|
32
|
+
path.split('/').each {|pa|
|
33
|
+
next unless 0 < pa.length
|
34
|
+
return nil if xml.nil?
|
35
|
+
xml = xml.get_a_path(pa)
|
36
|
+
}
|
37
|
+
xml
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_a_path(path)
|
41
|
+
if /\A(.*)\[(.+)\]\z/ =~ path
|
42
|
+
tag = $1
|
43
|
+
select = $2
|
44
|
+
attr, value = parse_attr_selector(select)
|
45
|
+
if attr
|
46
|
+
return get_has_attr(attr, value)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
return get_tag(path)
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def parse_attr_selector(attr_selector)
|
55
|
+
unless attr_selector.include?("=")
|
56
|
+
return nil
|
57
|
+
end
|
58
|
+
|
59
|
+
left, right = attr_selector.split("=", 2)
|
60
|
+
|
61
|
+
if /\A@([a-z:]+)\z/ =~ left
|
62
|
+
attr_name = $1.intern
|
63
|
+
else
|
64
|
+
raise 'unknown attribute selector '+left
|
65
|
+
end
|
66
|
+
|
67
|
+
# FIXME: It's not right to this twice.
|
68
|
+
right = $1 if /\A'(.+)'\z/ =~ right
|
69
|
+
right = $1 if /\A"(.+)"\z/ =~ right
|
70
|
+
|
71
|
+
if /\A(.*)\z/ =~ right
|
72
|
+
value = $1
|
73
|
+
else
|
74
|
+
raise 'unknown attribute value '+right
|
75
|
+
end
|
76
|
+
|
77
|
+
return [attr_name, value]
|
78
|
+
end
|
79
|
+
|
80
|
+
def get_has_attr(attr, value)
|
81
|
+
each_has_attr(attr, value) {|l|
|
82
|
+
return l
|
83
|
+
}
|
84
|
+
return nil
|
85
|
+
end
|
86
|
+
|
87
|
+
def each_has_attr(key, value)
|
88
|
+
traverse_element {|e|
|
89
|
+
attr = e.attr
|
90
|
+
if attr && attr[key] == value
|
91
|
+
yield(e)
|
92
|
+
end
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
def split_name_num(name)
|
97
|
+
name = name.sub(%r|(^//)|, '')
|
98
|
+
if /^(\w+)\[(\d+)\]$/ =~ name
|
99
|
+
return [$1, $2.to_i]
|
100
|
+
end
|
101
|
+
return [name, 1]
|
102
|
+
end
|
103
|
+
|
104
|
+
def find_nth_element(num=1, *names)
|
105
|
+
i = 1
|
106
|
+
traverse_element(*names) {|e|
|
107
|
+
return e if i == num
|
108
|
+
i += 1
|
109
|
+
}
|
110
|
+
return nil
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
class Array
|
115
|
+
include WabisabiTraverseModule
|
116
|
+
end
|
117
|
+
|
118
|
+
if $0 == __FILE__
|
119
|
+
require 'test/unit'
|
120
|
+
$test = true
|
121
|
+
end
|
122
|
+
|
123
|
+
if defined?($test) && $test
|
124
|
+
require 'qwik/test-module-public'
|
125
|
+
|
126
|
+
class TestWabisabiTraverse < Test::Unit::TestCase
|
127
|
+
include TestModulePublic
|
128
|
+
|
129
|
+
def test_all
|
130
|
+
# test_get_path
|
131
|
+
h = [:html, [:div, {:class=>'main'},
|
132
|
+
[:div, {:class=>'day'}, [:h2, 'bh2']],
|
133
|
+
[:div, {:class=>'sidebar'}, [:h2, 'sh2', [:b, 'a'], 'sh2a']]]]
|
134
|
+
t_make_public(Array, :get_has_attr)
|
135
|
+
assert_equal [:div, {:class=>'sidebar'}, [:h2, 'sh2', [:b, 'a'], 'sh2a']],
|
136
|
+
h.get_has_attr(:class, 'sidebar')
|
137
|
+
assert_equal [:div, {:class=>'sidebar'}, [:h2, 'sh2', [:b, 'a'], 'sh2a']],
|
138
|
+
h.get_path("//div[@class='sidebar']")
|
139
|
+
assert_equal [:b, 'a'], h.get_path("//div[@class='sidebar']/b")
|
140
|
+
assert_equal [:div, {:class=>'sidebar'}, [:h2, 'sh2', [:b, 'a'], 'sh2a']],
|
141
|
+
h.get_a_path("div[@class='sidebar']")
|
142
|
+
assert_equal [:b, 'a'],
|
143
|
+
h.get_a_path("div[@class='sidebar']").get_a_path('b')
|
144
|
+
|
145
|
+
# test_get_tag1
|
146
|
+
h = [:a, {:href=>'t1', :alt=>'t2'}, 't3']
|
147
|
+
e = h.get_tag('a')
|
148
|
+
assert_equal [:a, {:href=>'t1', :alt=>'t2'}, 't3'], e
|
149
|
+
|
150
|
+
# test_get_tag2
|
151
|
+
h = [:a, [:b, [:c]]]
|
152
|
+
assert_equal [:c], h.get_tag('c')
|
153
|
+
assert_equal [:b, [:c]], h.get_tag('b')
|
154
|
+
|
155
|
+
# test_get_tag3
|
156
|
+
h = [:a, [:b, 'tb'], [:b, 'tb2'], [:c]]
|
157
|
+
assert_equal [:b, 'tb'], h.get_tag('b')
|
158
|
+
assert_equal nil, h.get_tag('nosuchtag')
|
159
|
+
assert_equal [:b, 'tb'], h.get_tag('b[1]')
|
160
|
+
assert_equal [:b, 'tb2'], h.get_tag('b[2]')
|
161
|
+
assert_equal [:b, 'tb'], h.get_tag('//b')
|
162
|
+
|
163
|
+
# test_get_path_with_space
|
164
|
+
h = [:html, [:div, {:class=>'main'},
|
165
|
+
[:div, {:class=>'day edit'}, [:h2, 'bh2']],
|
166
|
+
[:div, {:class=>'sidebar'}, [:h2, 'sh2', [:b, 'a'], 'sh2a']]]]
|
167
|
+
assert_equal [:div, {:class=>'sidebar'}, [:h2, 'sh2', [:b, 'a'], 'sh2a']],
|
168
|
+
h.get_path("//div[@class='sidebar']")
|
169
|
+
assert_equal [:div, {:class=>'day edit'}, [:h2, 'bh2']],
|
170
|
+
h.get_path("//div[@class='day edit']")
|
171
|
+
|
172
|
+
# test_get_has_attr
|
173
|
+
h = [:html,
|
174
|
+
[:div, {:class=>'main'},
|
175
|
+
[:div, {:id=>'menu'},
|
176
|
+
[:h2, 'menuh2']]]]
|
177
|
+
assert_equal [:div, {:id=>'menu'}, [:h2, 'menuh2']],
|
178
|
+
h.get_has_attr(:id, 'menu')
|
179
|
+
assert_equal [:div, {:id=>'menu'}, [:h2, 'menuh2']],
|
180
|
+
h.get_path("//div[@id='menu']")
|
181
|
+
end
|
182
|
+
|
183
|
+
|
184
|
+
def test_private
|
185
|
+
e = []
|
186
|
+
|
187
|
+
# test_parse_attr_selector
|
188
|
+
t_make_public(Array, :parse_attr_selector)
|
189
|
+
#assert_raise(RuntimeError){ e.parse_attr_selector('a') }
|
190
|
+
assert_raise(RuntimeError){ e.parse_attr_selector('a=b') }
|
191
|
+
assert_equal [:a, 'b'], e.parse_attr_selector('@a=b')
|
192
|
+
assert_equal [:a, 'b c'], e.parse_attr_selector("@a='b c'")
|
193
|
+
|
194
|
+
# test_get_has_attr
|
195
|
+
|
196
|
+
# test_each_has_attr
|
197
|
+
|
198
|
+
# test_split_name_num
|
199
|
+
t_make_public(Array, :split_name_num)
|
200
|
+
assert_equal ['sidebar', 1], e.split_name_num('sidebar')
|
201
|
+
assert_equal ['sidebar', 1], e.split_name_num('sidebar[1]')
|
202
|
+
assert_equal ['sidebar', 2], e.split_name_num('sidebar[2]')
|
203
|
+
|
204
|
+
# test_find_nth_element
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
@@ -0,0 +1,116 @@
|
|
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/wabisabi-basic'
|
7
|
+
require 'qwik/wabisabi-traverse'
|
8
|
+
require 'qwik/util-css'
|
9
|
+
|
10
|
+
module WabisabiValidator
|
11
|
+
VALID_TAGS = %w(
|
12
|
+
div
|
13
|
+
h2 h3 h4 h5 h6
|
14
|
+
p blockquote pre
|
15
|
+
ul ol li
|
16
|
+
dl dt dd
|
17
|
+
table tbody tr td
|
18
|
+
span
|
19
|
+
a
|
20
|
+
em strong del
|
21
|
+
b i
|
22
|
+
img
|
23
|
+
plugin
|
24
|
+
hr
|
25
|
+
sup sub
|
26
|
+
font
|
27
|
+
)
|
28
|
+
TAGS = VALID_TAGS.map {|t| t.intern }
|
29
|
+
|
30
|
+
VALID_ATTR = %w(
|
31
|
+
href
|
32
|
+
src alt
|
33
|
+
method
|
34
|
+
param
|
35
|
+
align border hspace vspace
|
36
|
+
style
|
37
|
+
color
|
38
|
+
size
|
39
|
+
)
|
40
|
+
ATTR = VALID_ATTR.map {|t| t.intern }
|
41
|
+
|
42
|
+
URL_ATTR = %w(
|
43
|
+
href
|
44
|
+
src
|
45
|
+
)
|
46
|
+
URL = URL_ATTR.map {|t| t.intern }
|
47
|
+
|
48
|
+
STYLE_ATTR = %w(
|
49
|
+
style
|
50
|
+
)
|
51
|
+
STYLE = STYLE_ATTR.map {|t| t.intern }
|
52
|
+
|
53
|
+
def valid?(w)
|
54
|
+
w.traverse_element {|e|
|
55
|
+
element_name = e[0]
|
56
|
+
next unless element_name.is_a?(Symbol)
|
57
|
+
unless TAGS.include?(element_name)
|
58
|
+
return element_name # Invalid
|
59
|
+
end
|
60
|
+
|
61
|
+
attr = e.attr
|
62
|
+
next if attr.nil?
|
63
|
+
attr.each {|k, v|
|
64
|
+
unless ATTR.include?(k)
|
65
|
+
return k # Invalid
|
66
|
+
end
|
67
|
+
|
68
|
+
if URL.include?(k) # k is URL
|
69
|
+
vs = v.to_s
|
70
|
+
if /\Ahttps?:\/\// =~ vs
|
71
|
+
# OK
|
72
|
+
elsif /\A[-\w\.]+\z/ =~ vs
|
73
|
+
# OK
|
74
|
+
else
|
75
|
+
#if /\Ajavascript/i =~ vs
|
76
|
+
return 'Invalid URL' # Invalid URL
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if STYLE.include?(k) # k is style
|
81
|
+
style = v.to_s
|
82
|
+
unless CSS.valid?(style)
|
83
|
+
return 'Invalid CSS' # Invalid CSS
|
84
|
+
end
|
85
|
+
end
|
86
|
+
}
|
87
|
+
}
|
88
|
+
return true
|
89
|
+
end
|
90
|
+
|
91
|
+
module_function :valid?
|
92
|
+
end
|
93
|
+
|
94
|
+
if $0 == __FILE__
|
95
|
+
require 'test/unit'
|
96
|
+
$test = true
|
97
|
+
end
|
98
|
+
|
99
|
+
if defined?($test) && $test
|
100
|
+
class TestWabisabiValid < Test::Unit::TestCase
|
101
|
+
def ok(e, w)
|
102
|
+
assert_equal e, WabisabiValidator.valid?(w)
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_valid
|
106
|
+
ok true, [:p, 't']
|
107
|
+
ok true, [:ul, 't']
|
108
|
+
ok :script, [:script, 't']
|
109
|
+
ok true, [:img, {:src=>'s', :alt=>'a'}, 't']
|
110
|
+
ok :onload, [:img, {:onload=>'o'}, 't']
|
111
|
+
ok 'Invalid URL', [:img, {:src=>'javascript:do something'}]
|
112
|
+
ok true, [:img, {:src=>'http://example.net/a.jpg'}]
|
113
|
+
ok true, [:img, {:src=>'https://example.net/a.jpg'}]
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|