bloggit 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History +4 -0
- data/Manifest +422 -0
- data/Rakefile +64 -0
- data/ReadMe +69 -0
- data/Todo +26 -0
- data/bin/bloggit +5 -0
- data/docs/index.html +57 -0
- data/docs/specifications.html +100 -0
- data/docs/src/_layout.rhtml +53 -0
- data/docs/src/index.markdown +5 -0
- data/docs/src/specifications.markdown +48 -0
- data/lib/bloggit.rb +28 -0
- data/lib/bloggit/boilerplate/Rakefile +2 -0
- data/lib/bloggit/boilerplate/pages/about.page +5 -0
- data/lib/bloggit/boilerplate/plugins/haloscan/init.rb +5 -0
- data/lib/bloggit/boilerplate/settings.yml +28 -0
- data/lib/bloggit/boilerplate/themes/default/styles/main.css +145 -0
- data/lib/bloggit/boilerplate/themes/default/templates/archive.rhtml +20 -0
- data/lib/bloggit/boilerplate/themes/default/templates/home.rhtml +6 -0
- data/lib/bloggit/boilerplate/themes/default/templates/layouts/main.rhtml +15 -0
- data/lib/bloggit/boilerplate/themes/default/templates/layouts/two-columns.rhtml +21 -0
- data/lib/bloggit/boilerplate/themes/default/templates/page.rhtml +8 -0
- data/lib/bloggit/boilerplate/themes/default/templates/post.rhtml +3 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/blog_entry.rhtml +16 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/navigation.rhtml +12 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/tag_list.rhtml +9 -0
- data/lib/bloggit/boilerplate/themes/default/templates/tag_archive.rhtml +38 -0
- data/lib/bloggit/checksum.rb +39 -0
- data/lib/bloggit/client/index.html +2 -0
- data/lib/bloggit/client/scripts/adapter/jquery/ext-jquery-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/jquery/jquery-plugins.js +965 -0
- data/lib/bloggit/client/scripts/adapter/jquery/jquery.js +2201 -0
- data/lib/bloggit/client/scripts/adapter/prototype/effects.js +1098 -0
- data/lib/bloggit/client/scripts/adapter/prototype/ext-prototype-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/prototype/prototype.js +2523 -0
- data/lib/bloggit/client/scripts/adapter/prototype/scriptaculous.js +59 -0
- data/lib/bloggit/client/scripts/adapter/yui/ext-yui-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/yui/yui-utilities.js +18 -0
- data/lib/bloggit/client/scripts/app.js +121 -0
- data/lib/bloggit/client/scripts/ext-all.js +256 -0
- data/lib/bloggit/client/scripts/resources/css/README.txt +3 -0
- data/lib/bloggit/client/scripts/resources/css/basic-dialog.css +286 -0
- data/lib/bloggit/client/scripts/resources/css/box.css +111 -0
- data/lib/bloggit/client/scripts/resources/css/button.css +148 -0
- data/lib/bloggit/client/scripts/resources/css/combo.css +46 -0
- data/lib/bloggit/client/scripts/resources/css/core.css +290 -0
- data/lib/bloggit/client/scripts/resources/css/date-picker.css +155 -0
- data/lib/bloggit/client/scripts/resources/css/dd.css +61 -0
- data/lib/bloggit/client/scripts/resources/css/debug.css +55 -0
- data/lib/bloggit/client/scripts/resources/css/ext-all.css +3167 -0
- data/lib/bloggit/client/scripts/resources/css/form.css +359 -0
- data/lib/bloggit/client/scripts/resources/css/grid.css +295 -0
- data/lib/bloggit/client/scripts/resources/css/layout.css +252 -0
- data/lib/bloggit/client/scripts/resources/css/menu.css +116 -0
- data/lib/bloggit/client/scripts/resources/css/panel.css +258 -0
- data/lib/bloggit/client/scripts/resources/css/qtips.css +119 -0
- data/lib/bloggit/client/scripts/resources/css/reset-min.css +9 -0
- data/lib/bloggit/client/scripts/resources/css/resizable.css +143 -0
- data/lib/bloggit/client/scripts/resources/css/tabs.css +134 -0
- data/lib/bloggit/client/scripts/resources/css/toolbar.css +160 -0
- data/lib/bloggit/client/scripts/resources/css/tree.css +179 -0
- data/lib/bloggit/client/scripts/resources/css/window.css +155 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-aero.css +581 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-gray.css +438 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-vista.css +511 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-center.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-left.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-right.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/w-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-blue-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/pspbrwse.jbf +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort-col-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-btm-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/toolbar/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-arrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress2.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/corners-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/corners.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/l-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/l.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/r-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/r.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/tb-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/tb.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-add.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/date-trigger.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/error-tip-corners.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/exclamation.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/text-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/trigger.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/Thumbs.db +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-left-white.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-right-white.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-bottom.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-top.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/dirty.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/done.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/footer-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hd-pop.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/invalid_line.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/mso-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/nowait.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-first-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-first.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-last-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-last.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-next-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-next.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/pick-button.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/refresh.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/sort_asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/sort_desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/wait.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/stuck.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/group-checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/menu-parent.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/menu.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/unchecked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow-c.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow-lr.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/calendar.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/left-btn.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/right-btn.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/warning.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/square.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-over-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-add.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-between.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-under.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-line.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/folder-open.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/folder.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/leaf.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/dlg-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/group-checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/menu-parent.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/menu.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/unchecked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-center.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-left.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-right.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/dlg-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/w-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/license.txt +25 -0
- data/lib/bloggit/client/scripts/resources/raw-images/shadow.psd +0 -0
- data/lib/bloggit/client/scripts/resources/resources.jsb +522 -0
- data/lib/bloggit/client/templates/json.rhtml +5 -0
- data/lib/bloggit/client/templates/main.rhtml +109 -0
- data/lib/bloggit/commandline.rb +52 -0
- data/lib/bloggit/commands/page_cmd.rb +17 -0
- data/lib/bloggit/commands/plugin_cmd.rb +89 -0
- data/lib/bloggit/commands/post_cmd.rb +17 -0
- data/lib/bloggit/commands/site_cmd.rb +82 -0
- data/lib/bloggit/commands/theme_cmd.rb +16 -0
- data/lib/bloggit/etc/hash.rb +24 -0
- data/lib/bloggit/etc/string.rb +5 -0
- data/lib/bloggit/generator.rb +331 -0
- data/lib/bloggit/hooks.rb +21 -0
- data/lib/bloggit/media.rb +40 -0
- data/lib/bloggit/page.rb +98 -0
- data/lib/bloggit/plugin.rb +52 -0
- data/lib/bloggit/post.rb +169 -0
- data/lib/bloggit/publisher.rb +115 -0
- data/lib/bloggit/server.rb +102 -0
- data/lib/bloggit/site.rb +183 -0
- data/lib/bloggit/tag.rb +61 -0
- data/lib/bloggit/tasks/client.rb +9 -0
- data/lib/bloggit/tasks/publishing.rb +36 -0
- data/lib/bloggit/tasks/scm.rb +78 -0
- data/lib/bloggit/tasks/specs.rb +128 -0
- data/lib/bloggit/template.rb +334 -0
- data/lib/bloggit/text_formatter.rb +50 -0
- data/lib/util/fixed_hoe.rb +553 -0
- data/test/fixtures/test.blog/Rakefile +7 -0
- data/test/fixtures/test.blog/pages/about.page +7 -0
- data/test/fixtures/test.blog/pages/coming-soon.page +3 -0
- data/test/fixtures/test.blog/pages/todo.page +23 -0
- data/test/fixtures/test.blog/plugins/example/init.rb +69 -0
- data/test/fixtures/test.blog/plugins/haloscan/init.rb +25 -0
- data/test/fixtures/test.blog/plugins/js_search/init.rb +51 -0
- data/test/fixtures/test.blog/plugins/rdoc_formatter/init.rb +14 -0
- data/test/fixtures/test.blog/posts/2004.03.07_to-boldly-go.post +11 -0
- data/test/fixtures/test.blog/posts/2007.03.25_sure-whatever.post +10 -0
- data/test/fixtures/test.blog/posts/2007.03.27_rdoc-anyone.post +13 -0
- data/test/fixtures/test.blog/posts/2010.12.07_35-already.post +5 -0
- data/test/fixtures/test.blog/settings.yml +34 -0
- data/test/fixtures/test.blog/themes/default/styles/main.css +145 -0
- data/test/fixtures/test.blog/themes/default/templates/archive.rhtml +22 -0
- data/test/fixtures/test.blog/themes/default/templates/home.rhtml +9 -0
- data/test/fixtures/test.blog/themes/default/templates/layouts/main.rhtml +17 -0
- data/test/fixtures/test.blog/themes/default/templates/layouts/two-columns.rhtml +21 -0
- data/test/fixtures/test.blog/themes/default/templates/page.rhtml +8 -0
- data/test/fixtures/test.blog/themes/default/templates/post.rhtml +15 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/blog_entry.rhtml +10 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/navigation.rhtml +12 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/tag_list.rhtml +9 -0
- data/test/fixtures/test.blog/themes/default/templates/tag_archive.rhtml +41 -0
- data/test/helpers.rb +25 -0
- data/test/unit/bloggit_test.rb +9 -0
- data/test/unit/page_test.rb +28 -0
- data/test/unit/post_test.rb +36 -0
- data/test/unit/site_test.rb +27 -0
- data/test/unit/template_test.rb +21 -0
- data/test/unit/text_formatter_test.rb +43 -0
- metadata +520 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Bloggit
|
|
2
|
+
class << self
|
|
3
|
+
def listeners
|
|
4
|
+
@listeners ||= {}
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def on_event(event, &block)
|
|
8
|
+
listeners[event] ||= []
|
|
9
|
+
listeners[event] << block
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def fire_event(event, *args)
|
|
13
|
+
results = {}
|
|
14
|
+
listeners.fetch(event, []).each do |block|
|
|
15
|
+
res = block.call(*args)
|
|
16
|
+
results.merge!(res) if res.is_a?( Hash )
|
|
17
|
+
end
|
|
18
|
+
results
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# See Bloggit::Media
|
|
2
|
+
module Bloggit
|
|
3
|
+
|
|
4
|
+
# = Media
|
|
5
|
+
class Media
|
|
6
|
+
|
|
7
|
+
attr_reader :site, :filename, :ext, :full_path, :relative_path, :name, :size, :dimensions
|
|
8
|
+
|
|
9
|
+
def initialize(path, site)
|
|
10
|
+
@site = site
|
|
11
|
+
@full_path = path
|
|
12
|
+
@relative_path = path.gsub(File.join(site.base_path, 'media', ''), '')
|
|
13
|
+
# Read file info and set Media properties...
|
|
14
|
+
@filename = File.basename(path)
|
|
15
|
+
@ext = File.extname(path)
|
|
16
|
+
# TODO: name, size, dimensions
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def thumbnail_path(size=nil)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def create_thumbnail(size=nil)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def permalink
|
|
26
|
+
"media/#{@relative_path}"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class << self
|
|
30
|
+
private :new
|
|
31
|
+
|
|
32
|
+
# Creates a Media object from an image on the filesystem
|
|
33
|
+
def from_file(path, site)
|
|
34
|
+
path = File.expand_path(path)
|
|
35
|
+
raise "File must exist" unless File.exists?( path )
|
|
36
|
+
new( path, site )
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
data/lib/bloggit/page.rb
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# See Bloggit::Page
|
|
2
|
+
module Bloggit
|
|
3
|
+
|
|
4
|
+
# = Page
|
|
5
|
+
#
|
|
6
|
+
# A Page is much like a Post (Bloggit::Post)
|
|
7
|
+
class Page
|
|
8
|
+
attr_reader :filename, :source, :site
|
|
9
|
+
|
|
10
|
+
def initialize(site, filename, body, atts={})
|
|
11
|
+
@site = site unless site.nil?
|
|
12
|
+
@filename = filename
|
|
13
|
+
@data = atts.clone
|
|
14
|
+
@data.reverse_merge!(site.settings.pages) unless site.nil?
|
|
15
|
+
|
|
16
|
+
@source = body
|
|
17
|
+
|
|
18
|
+
@data.slug = @filename.split('_')[-1].gsub('.page', '') unless @data.has_key? 'slug'
|
|
19
|
+
@data.title = "#{@data.slug.gsub('-', ' ')}".titleize unless @data.has_key? 'title'
|
|
20
|
+
@data.status = 'publish' unless @data.has_key? 'status'
|
|
21
|
+
|
|
22
|
+
if @data.has_key? 'tags'
|
|
23
|
+
@data.tags.uniq!
|
|
24
|
+
@data.tags.each { |tag| Tag.register_page( tag, self ) if self.is_publishable? }
|
|
25
|
+
else
|
|
26
|
+
@data.tags = []
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def is_draft?
|
|
31
|
+
@data.status == 'draft'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def is_publishable?
|
|
35
|
+
!is_draft?
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def has_tags?
|
|
39
|
+
@data.has_key? 'tags'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def permalink
|
|
43
|
+
# Get base folder from settings...
|
|
44
|
+
"#{@data.slug}.html"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def render_content(template_binding=nil)
|
|
48
|
+
src = @source
|
|
49
|
+
src = Template.from_text(src).template.result(template_binding) unless template_binding.nil?
|
|
50
|
+
format = @data.has_key?('format') ? @data['format'].to_s.downcase.to_sym : :simple
|
|
51
|
+
TextFormatter.render(src, format)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def to_yaml
|
|
55
|
+
yml_s = @data.to_yaml
|
|
56
|
+
yml_s << @source.to_yaml
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def to_json
|
|
60
|
+
data_hsh = @data.clone
|
|
61
|
+
data_hsh['source'] = @source
|
|
62
|
+
data_hsh.to_json
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def method_missing(name,*args)
|
|
66
|
+
if @data.has_key? name.to_s
|
|
67
|
+
@data[name.to_s]
|
|
68
|
+
else
|
|
69
|
+
super(name, *args)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
class << self
|
|
74
|
+
private :new
|
|
75
|
+
|
|
76
|
+
def from_file(path, site=nil)
|
|
77
|
+
path = File.expand_path(path)
|
|
78
|
+
raise "File must exist" unless File.exists?( path )
|
|
79
|
+
yml_docs = YAML::load_stream( File.open(path, 'r') )
|
|
80
|
+
raise "page is missing a document part" if yml_docs.documents.length != 2
|
|
81
|
+
raise "page format is invalid" unless yml_docs[0].is_a?(Hash) and yml_docs[1].is_a?(String)
|
|
82
|
+
atts = yml_docs[0]
|
|
83
|
+
body = yml_docs[1]
|
|
84
|
+
new( site, File.basename(path), body, atts )
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def to_file(title, site=nil, options={})
|
|
88
|
+
slug = title.to_s.to_slug
|
|
89
|
+
|
|
90
|
+
path = "#{slug}.page"
|
|
91
|
+
page = new( site, path, "New Page\n\n", 'slug'=>slug, 'title'=>title )
|
|
92
|
+
File.open( File.join(Dir.getwd, 'pages', path), 'w' ) {|f| f.write page.to_yaml }
|
|
93
|
+
page
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# See Bloggit::Plugin
|
|
2
|
+
require 'test/unit/assertions'
|
|
3
|
+
|
|
4
|
+
module Bloggit
|
|
5
|
+
|
|
6
|
+
# = Plugin
|
|
7
|
+
#
|
|
8
|
+
# Plugin.define :my_plugin do |conf|
|
|
9
|
+
# # default plugin settings...
|
|
10
|
+
# end
|
|
11
|
+
class Plugin
|
|
12
|
+
include Test::Unit::Assertions
|
|
13
|
+
|
|
14
|
+
class << self
|
|
15
|
+
attr_reader :site
|
|
16
|
+
|
|
17
|
+
def init(site) #:nodoc:
|
|
18
|
+
@site = site
|
|
19
|
+
|
|
20
|
+
@plugins = {}
|
|
21
|
+
# Load/require plugins from plugins/ dir...
|
|
22
|
+
@plugin_path = File.join(site.base_path, 'plugins')
|
|
23
|
+
$: << @plugin_path
|
|
24
|
+
Dir[ File.join(@plugin_path, '*') ].each do |dir|
|
|
25
|
+
plugin_file = if FileTest.directory?(dir)
|
|
26
|
+
plugin_lib_dir = File.join(dir, 'lib')
|
|
27
|
+
$: << plugin_lib_dir if FileTest.directory?(plugin_lib_dir)
|
|
28
|
+
"#{File.basename(dir)}/init"
|
|
29
|
+
elsif dir.ends_with?('.rb') or dir.ends_with?('.plugin')
|
|
30
|
+
"#{File.basename(dir)}"
|
|
31
|
+
end
|
|
32
|
+
require(plugin_file)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def register(plugin_name, opts={}, &block)
|
|
37
|
+
# Yeah...
|
|
38
|
+
@plugins[plugin_name]
|
|
39
|
+
block.call( settings_for(plugin_name) )
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def settings_for(plugin_name)
|
|
43
|
+
@site.settings.plugins.fetch( plugin_name.to_s, {} )
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def active_site
|
|
47
|
+
@site
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
data/lib/bloggit/post.rb
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# See Bloggit::Post
|
|
2
|
+
module Bloggit
|
|
3
|
+
|
|
4
|
+
# = Post
|
|
5
|
+
#
|
|
6
|
+
# A blog post is a YAML file containing two documents. The first document should be
|
|
7
|
+
# a hash of attributes, the second a string document. The format looks a little like
|
|
8
|
+
# the following:
|
|
9
|
+
#
|
|
10
|
+
# title: To Boldly Go
|
|
11
|
+
# publish_date: 3/07/2004
|
|
12
|
+
# allow_comments: true
|
|
13
|
+
# format: Markdown
|
|
14
|
+
# tags: [one, two, three and four]
|
|
15
|
+
# slug: to-boldly-go
|
|
16
|
+
# --- |
|
|
17
|
+
# This is the post body... Fun, isn't it? Yes. Yes it is.
|
|
18
|
+
#
|
|
19
|
+
# And you know, I don't care if anybody knows! :D
|
|
20
|
+
#
|
|
21
|
+
# The filename is the date and slugline (YYYY.MM.DD_slug.post)
|
|
22
|
+
class Post
|
|
23
|
+
attr_accessor :filename, :source
|
|
24
|
+
|
|
25
|
+
def initialize(site, filename, body, atts={})
|
|
26
|
+
@site = site
|
|
27
|
+
@filename = filename
|
|
28
|
+
@data = atts.clone
|
|
29
|
+
@data.reverse_merge!(site.settings.posts) unless site.nil?
|
|
30
|
+
@source = body.to_s
|
|
31
|
+
|
|
32
|
+
date_str = if atts.has_key? 'publish_date'
|
|
33
|
+
atts.publish_date.to_s.gsub('.','-')
|
|
34
|
+
else
|
|
35
|
+
@filename.split('_').to_s.gsub('.','-')
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
begin
|
|
39
|
+
publish_date = Date.parse(date_str)
|
|
40
|
+
rescue
|
|
41
|
+
raise "Date format error for #{@filename}"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
@data.publish_date = publish_date
|
|
45
|
+
@data.post_year = publish_date.year
|
|
46
|
+
@data.post_month = publish_date.month
|
|
47
|
+
@data.post_date = publish_date.day
|
|
48
|
+
@data.slug = @filename.split('_')[-1].gsub('.post', '') unless @data.has_key? 'slug'
|
|
49
|
+
@data.status = 'publish' unless @data.has_key? 'status'
|
|
50
|
+
@data.tags = [] unless @data.has_key? 'tags'
|
|
51
|
+
@data.tags.uniq!
|
|
52
|
+
@data.tags.each {|tag| Tag.register_post( tag, self ) } if self.is_publishable?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def is_draft?
|
|
56
|
+
@data.status == 'draft'
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def is_publishable?
|
|
60
|
+
!is_draft? and @data.publish_date <= Date.today
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def has_tags?
|
|
64
|
+
@data.has_key? 'tags'
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def tags
|
|
68
|
+
@data.tags
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def permalink
|
|
72
|
+
@site.build_post_path("#{@data.post_year}/#{@data.post_month}/#{@data.slug}.html")
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Navigation
|
|
76
|
+
def has_next?
|
|
77
|
+
idx = @site.posts.index(self) +1
|
|
78
|
+
idx < @site.posts.length
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def has_previous?
|
|
82
|
+
idx = @site.posts.index(self)
|
|
83
|
+
idx > 0
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def first
|
|
87
|
+
@site.posts[0]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def previous
|
|
91
|
+
idx = @site.posts.index(self) -1
|
|
92
|
+
@site.posts[idx]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def next
|
|
96
|
+
idx = @site.posts.index(self) +1
|
|
97
|
+
@site.posts[idx]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def last
|
|
101
|
+
@site.posts[@site.posts.length() -1]
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def render_content(template_binding=nil)
|
|
105
|
+
src = @source
|
|
106
|
+
src = Template.from_text(src).template.result(template_binding) unless template_binding.nil?
|
|
107
|
+
TextFormatter.render(src, @data.fetch('format', 'simple'))
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def to_yaml
|
|
111
|
+
data_hash = prepare_data
|
|
112
|
+
yml_s = data_hsh.to_yaml
|
|
113
|
+
yml_s << @source.to_yaml
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def to_json
|
|
117
|
+
data_hash = prepare_data
|
|
118
|
+
data_hash['source'] = @source
|
|
119
|
+
data_hash.to_json
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def method_missing(name,*args)
|
|
123
|
+
if @data.has_key? name.to_s
|
|
124
|
+
@data[name.to_s]
|
|
125
|
+
else
|
|
126
|
+
super(*args)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
private
|
|
131
|
+
|
|
132
|
+
def prepare_data
|
|
133
|
+
data_hsh = @data.clone
|
|
134
|
+
data_hsh.delete 'post_year'
|
|
135
|
+
data_hsh.delete 'post_month'
|
|
136
|
+
data_hsh.delete 'post_date'
|
|
137
|
+
data_hsh.publish_date = data_hsh.publish_date.to_s
|
|
138
|
+
data_hsh
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class << self
|
|
143
|
+
private :new
|
|
144
|
+
|
|
145
|
+
def from_file(path, site=nil)
|
|
146
|
+
path = File.expand_path(path)
|
|
147
|
+
raise "File must exist" unless File.exists?( path )
|
|
148
|
+
yml_docs = YAML::load_stream( File.open(path, 'r') )
|
|
149
|
+
raise "Post is missing a document part" if yml_docs.documents.length != 2
|
|
150
|
+
raise "Post format is invalid" unless yml_docs[0].is_a?(Hash) and yml_docs[1].is_a?(String)
|
|
151
|
+
atts = yml_docs[0]
|
|
152
|
+
body = yml_docs[1]
|
|
153
|
+
|
|
154
|
+
new( site, File.basename(path), body, atts )
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def to_file(title, site=nil, options={})
|
|
158
|
+
slug = title.to_s.downcase.gsub( /[^-a-z0-9~\s\.:;+=_]/, '').gsub(/[\s\.:;=_+]+/, '-').gsub(/[\-]{2,}/, '-').to_s
|
|
159
|
+
raise "Slug can't be empty" if slug.empty?
|
|
160
|
+
path = "#{Date.today.strftime('%Y.%m.%d')}_#{slug}.post"
|
|
161
|
+
post = new( site, path, "New Post\n\n", 'slug'=>slug, 'title'=>title )
|
|
162
|
+
new_post_path = File.join(Dir.getwd, 'posts', path)
|
|
163
|
+
raise "Path Exception! #{new_post_path} already exists." if File.exists?(new_post_path)
|
|
164
|
+
File.open( new_post_path, 'w' ) {|f| f.write post.to_yaml }
|
|
165
|
+
post
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
require 'net/sftp'
|
|
2
|
+
|
|
3
|
+
# See Bloggit::Publisher
|
|
4
|
+
module Bloggit
|
|
5
|
+
# = Publisher
|
|
6
|
+
class Publisher
|
|
7
|
+
attr_reader :site, :verbose, :settings
|
|
8
|
+
|
|
9
|
+
def initialize(site, verbose=false)
|
|
10
|
+
@site = site
|
|
11
|
+
@verbose = verbose
|
|
12
|
+
@settings = site.settings.publish
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def upload
|
|
16
|
+
puts_if_verbose "Connecting to #{settings['host']}..."
|
|
17
|
+
|
|
18
|
+
Net::SFTP.start(settings['host'], settings['user'], settings['pass'], :timeout=>settings.fetch('timeout', 30)) do |sftp|
|
|
19
|
+
|
|
20
|
+
puts_if_verbose "Fetching checksums..."
|
|
21
|
+
local_checksums = YAML::load(File.open( local_path("checksum.yml") ))
|
|
22
|
+
remote_checksums = {}
|
|
23
|
+
begin
|
|
24
|
+
checksums_src = ''
|
|
25
|
+
sftp.open_handle( server_path('checksum.yml')) do |handle|
|
|
26
|
+
checksums_src = sftp.read(handle)
|
|
27
|
+
end
|
|
28
|
+
remote_checksums = YAML::load(checksums_src) unless checksums_src.nil? or checksums_src==''
|
|
29
|
+
rescue Net::SFTP::Operations::StatusException=>se
|
|
30
|
+
# server's checksum.yml is missing
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
puts_if_verbose "Comparing checksum data..."
|
|
34
|
+
to_upload, to_remove = Bloggit::Checksum.diff(local_checksums, remote_checksums)
|
|
35
|
+
|
|
36
|
+
if to_upload.length > 0 or to_remove.length > 0
|
|
37
|
+
puts_if_verbose "Differences found:"
|
|
38
|
+
to_upload.each {|f| puts_if_verbose " - (Upload) #{f}" }
|
|
39
|
+
to_remove.each {|f| puts_if_verbose " - (Delete) #{f}"}
|
|
40
|
+
puts_if_verbose "Beginning sync..."
|
|
41
|
+
|
|
42
|
+
to_upload.each do |filename|
|
|
43
|
+
begin
|
|
44
|
+
puts_if_verbose " - #{remote_path(filename)}"
|
|
45
|
+
|
|
46
|
+
dir_name = File.dirname(filename)
|
|
47
|
+
dir_segs = dir_name.split('/')
|
|
48
|
+
#puts "Checking path: #{dir_segs.join( '/' )}"
|
|
49
|
+
prog_path = []
|
|
50
|
+
dir_segs.each do |partial_dir|
|
|
51
|
+
begin
|
|
52
|
+
prog_path << partial_dir
|
|
53
|
+
sftp.mkdir( remote_path( prog_path ), :permissions=>0755 )
|
|
54
|
+
puts_if_verbose " + #{remote_path( prog_path )}"
|
|
55
|
+
rescue Net::SFTP::Operations::StatusException=>se
|
|
56
|
+
# don't worry about it
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
sftp.put_file local_path(filename), remote_path(filename)
|
|
61
|
+
sftp.open_handle( remote_path(filename) ) do |handle|
|
|
62
|
+
sftp.fsetstat( handle, :permissions=>0644 )
|
|
63
|
+
end
|
|
64
|
+
rescue Net::SFTP::Operations::StatusException=>se
|
|
65
|
+
puts_if_verbose " ! Error uploading '#{filename}': #{se}"
|
|
66
|
+
puts_if_verbose; puts_if_verbose "Halted execution of upload."
|
|
67
|
+
exit(1)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
to_remove.each do |filename|
|
|
72
|
+
begin
|
|
73
|
+
sftp.remove remote_path(filename)
|
|
74
|
+
puts_if_verbose " x #{remote_path(filename)}"
|
|
75
|
+
rescue
|
|
76
|
+
puts_if_verbose " ! Error removing '#{filename}': #{$!}"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
begin
|
|
81
|
+
sftp.put_file local_path('checksum.yml'), remote_path('checksum.yml')
|
|
82
|
+
sftp.open_handle( remote_path('checksum.yml') ) do |handle|
|
|
83
|
+
sftp.fsetstat( handle, :permissions=>0644 )
|
|
84
|
+
end
|
|
85
|
+
rescue
|
|
86
|
+
puts_if_verbose " ! Error uploading 'checksum.yml': #{$!}"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
summary = "#{to_upload.length} file(s) uploaded"
|
|
91
|
+
summary += ", #{to_remove.length} files(s) deleted" if to_remove.length > 0
|
|
92
|
+
|
|
93
|
+
puts summary
|
|
94
|
+
else
|
|
95
|
+
puts "No changes made. The server is up to date!"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
puts "Done."
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def server_path(path)
|
|
103
|
+
[settings['path'], path].flatten.join('/')
|
|
104
|
+
end
|
|
105
|
+
alias_method :remote_path, :server_path
|
|
106
|
+
|
|
107
|
+
def local_path(path)
|
|
108
|
+
File.join(site.base_path, 'cache', path)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def puts_if_verbose(msg='')
|
|
112
|
+
puts(msg) if @verbose
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|