rottenegg 1.2.5.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.rvmrc +1 -0
- data/Gemfile +14 -0
- data/README.rdoc +47 -0
- data/Rakefile +2 -0
- data/bin/rottenegg +4 -0
- data/bin/rottenegg_gen +55 -0
- data/lib/rotten_egg.rb +14 -0
- data/lib/rotten_egg/app_setting.rb +76 -0
- data/lib/rotten_egg/application.rb +299 -0
- data/lib/rotten_egg/message_logger.rb +36 -0
- data/lib/rotten_egg/scm.rb +229 -0
- data/lib/rotten_egg/server.rb +238 -0
- data/lib/rotten_egg/user.rb +30 -0
- data/lib/rotten_egg/util.rb +381 -0
- data/lib/rotten_egg/version.rb +4 -0
- data/public/javascripts/extjs4/bootstrap.js +58 -0
- data/public/javascripts/extjs4/ext-all.js +7 -0
- data/public/javascripts/extjs4/ext.js +7 -0
- data/public/javascripts/extjs4/resources/css/ext-all.css +1 -0
- data/public/javascripts/extjs4/resources/themes/images/default/boundlist/trigger-arrow.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-notitle-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-notitle-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-disabled-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-focus-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-focus-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-focus-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-pressed-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-pressed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-pressed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-disabled-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-focus-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-focus-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-focus-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-pressed-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-pressed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-pressed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-disabled-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-focus-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-focus-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-focus-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-pressed-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-pressed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-pressed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-focus-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-focus-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-focus-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/arrow.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/btn.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/group-cs.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/group-lr.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/group-tb.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-b-noline.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-b.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-bo.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-light.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-noline.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-o.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-footer-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-footer-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-header-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-header-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/dd/drop-add.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/dd/drop-no.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/dd/drop-yes.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/editor/tb-sprite.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/checkbox.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/clear-trigger.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/date-trigger.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/error-tip-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/exclamation.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/radio.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/search-trigger.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/spinner-small.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/spinner.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/text-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/trigger-square.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/trigger-tpl.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/form/trigger.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/arrow-left-white.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/arrow-right-white.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-selected-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-selected-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/checked.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/col-move-bottom.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/col-move-top.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-over-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/columns.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-left.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-left.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-right.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-right.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/dirty.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/done.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/drop-no.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/drop-yes.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/footer-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-blue-hd.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-blue-split.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-hrow.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-loading.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-split.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-vista-hd.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-hd-btn.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-hrow-over.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-hrow.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-rowheader.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/group-by.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/group-collapse.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/group-expand-sprite.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/group-expand.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hd-pop.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-asc.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-desc.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-lock.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-lock.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-unlock.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-unlock.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/invalid_line.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/loading.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/mso-hd.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/nowait.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-first-disabled.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-first.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-last-disabled.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-last.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-next-disabled.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-next.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-prev-disabled.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/page-prev.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/pick-button.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/property-cell-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/property-cell-selected-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/refresh-disabled.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/refresh.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/row-check-sprite.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/row-expand-sprite.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/row-over.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/row-sel.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/sort-hd.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/sort_asc.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/sort_desc.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/unchecked.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/grid/wait.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-bottom.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-left.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-right.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-top.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/menu/checked.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/menu/group-checked.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/menu/item-over.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/menu/menu-parent.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/menu/menu.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/menu/unchecked.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-bottom-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-left-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-left-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-left-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-right-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-right-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-right-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-top-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-top-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-top-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-left-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-right-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-top-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel/panel-default-framed-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/panel/panel-default-framed-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/progress/progress-default-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/blue-loading.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/calendar.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/glass-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/hd-sprite.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-error.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-info.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-question.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-warning.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/large-loading.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/left-btn.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/loading-balls.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/right-btn.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/shadow-c.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/shadow-lr.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/shadow.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/shared/warning.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/e-handle-dark.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/e-handle.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/ne-handle-dark.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/ne-handle.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/nw-handle-dark.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/nw-handle.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/s-handle-dark.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/s-handle.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/se-handle-dark.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/se-handle.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/square.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/sw-handle-dark.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/sizer/sw-handle.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-thumb.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-thumb.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-bg.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-thumb.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-thumb.png +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab-bar/scroll-left.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab-bar/scroll-right.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab-bar/tab-bar-default-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-active-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-active-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-active-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-disabled-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-close.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-active-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-active-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-active-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-disabled-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-disabled-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-disabled-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-over-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-over-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-over-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tip/tip-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tip/tip-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/toolbar/more.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/toolbar/scroll-left.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/toolbar/scroll-right.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/toolbar/toolbar-default-bg.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tools/tool-sprite-tpl.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tools/tool-sprites.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tools/tools-sprites-trans.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/arrows.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-above.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-add.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-append.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-below.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-between.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-no.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-over.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-under.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-yes.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-minus-nl.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-minus.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-plus-nl.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-plus.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-line.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-minus-nl.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-minus.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-plus-nl.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-plus.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/folder-open.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/folder.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/leaf.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/loading.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/tree/s.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-bottom.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-left.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-right.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-top.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-bottom-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-bottom-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-left-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-left-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-right-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-right-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-top-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-top-sides.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window/window-default-corners.gif +0 -0
- data/public/javascripts/extjs4/resources/themes/images/default/window/window-default-sides.gif +0 -0
- data/rotten_egg.gemspec +36 -0
- data/views/index.haml +490 -0
- data/views/layout.haml +8 -0
- data/views/session/login.haml +108 -0
- metadata +537 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.2
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
source "http://rubygems.org"
|
3
|
+
|
4
|
+
gem 'thin'
|
5
|
+
gem 'sinatra', '~> 1.2.6'
|
6
|
+
gem 'tmail'
|
7
|
+
gem 'i18n'
|
8
|
+
gem 'activesupport', '3.0.9'
|
9
|
+
gem 'sinatra_more', "~> 0.3.43"
|
10
|
+
gem 'haml', "~> 3.1.1"
|
11
|
+
gem 'net-sftp', "~> 2.0.5"
|
12
|
+
gem 'warden', "~> 1.0.4"
|
13
|
+
gem 'nokogiri'
|
14
|
+
gem 'yajl-ruby'
|
data/README.rdoc
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
== RottenEgg
|
2
|
+
|
3
|
+
RottenEgg is a tool to upload SCM(svn|git) files via FTP.
|
4
|
+
|
5
|
+
== Required ruby version
|
6
|
+
|
7
|
+
~>= 1.8.7
|
8
|
+
|
9
|
+
== Installation
|
10
|
+
For <b>Non-Windows</b> install
|
11
|
+
gem install rottenegg
|
12
|
+
|
13
|
+
For <b>Windows</b> install,maybe need DevelopmentKit[https://github.com/oneclick/rubyinstaller/wiki/Development-Kit], follow the instructions.
|
14
|
+
install thin:
|
15
|
+
gem install rack
|
16
|
+
gem install eventmachine
|
17
|
+
gem install thin --platform=mswin32
|
18
|
+
install tmail:
|
19
|
+
gem install tmail
|
20
|
+
finally:
|
21
|
+
gem install rottenegg
|
22
|
+
|
23
|
+
== Getting Started
|
24
|
+
|
25
|
+
First, make sure you can use <b>git</b> or <b>svn</b> command under the console.
|
26
|
+
|
27
|
+
=== 1. Generate the config file
|
28
|
+
|
29
|
+
rottenegg_gen git
|
30
|
+
+or+
|
31
|
+
rottenegg_gen svn
|
32
|
+
|
33
|
+
Then update the configuration you want.
|
34
|
+
|
35
|
+
=== 2. Generate the auth file for login user
|
36
|
+
|
37
|
+
rottenegg_gen auth
|
38
|
+
|
39
|
+
If skip this step, will default 'rotten' and 'egg' as login user and password.
|
40
|
+
|
41
|
+
=== 3. Start & Scroll
|
42
|
+
|
43
|
+
rottenegg -h for help.
|
44
|
+
|
45
|
+
rottenegg -C path/to/config.yml -A path/to/auth.yml -W path/to/working_directory
|
46
|
+
|
47
|
+
http://localhost:14720/login
|
data/Rakefile
ADDED
data/bin/rottenegg
ADDED
data/bin/rottenegg_gen
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
INTRO =<<_PLAIN_
|
3
|
+
# name is unique!
|
4
|
+
# scm(svn).sanitize_path_prefix split with '|'
|
5
|
+
_PLAIN_
|
6
|
+
|
7
|
+
SVN =<<_YAML_
|
8
|
+
scm:
|
9
|
+
tool: svn
|
10
|
+
repository: /path/to/repository
|
11
|
+
sanitize_path_prefix: /repos/projects/release/|/some/path/projects/trunk/
|
12
|
+
remote_version_file: ftproot/path/to/version.txt
|
13
|
+
# username: svn_account
|
14
|
+
# password: svn_password
|
15
|
+
_YAML_
|
16
|
+
|
17
|
+
GIT =<<_YAML_
|
18
|
+
scm:
|
19
|
+
tool: git
|
20
|
+
branch: master
|
21
|
+
repository: /path/to/repository
|
22
|
+
remote_version_file: ftproot/path/to/version.txt
|
23
|
+
_YAML_
|
24
|
+
|
25
|
+
FTP =<<_YAML_
|
26
|
+
ftp:
|
27
|
+
host: www.examples.com
|
28
|
+
port: 21
|
29
|
+
user: username
|
30
|
+
password: password
|
31
|
+
passive: false
|
32
|
+
verbose: true
|
33
|
+
name: rottenegg
|
34
|
+
_YAML_
|
35
|
+
|
36
|
+
AUTH =<<_AUTH_
|
37
|
+
user: name
|
38
|
+
password: password
|
39
|
+
_AUTH_
|
40
|
+
|
41
|
+
case ARGV.join
|
42
|
+
when "svn"
|
43
|
+
section = "config"
|
44
|
+
File.open("#{ENV["PWD"]}/#{section}.yml", "w") { |f| f.write(INTRO + SVN + FTP) }
|
45
|
+
when "git"
|
46
|
+
section = "config"
|
47
|
+
File.open("#{ENV["PWD"]}/#{section}.yml", "w") { |f| f.write(INTRO + GIT + FTP) }
|
48
|
+
when "auth"
|
49
|
+
section = "auth"
|
50
|
+
File.open("#{ENV["PWD"]}/#{section}.yml", "w") { |f| f.write AUTH }
|
51
|
+
else
|
52
|
+
abort "'#{__FILE__}' need one of [git|svn|auth]"
|
53
|
+
end
|
54
|
+
|
55
|
+
puts "#{ENV["PWD"]}/#{section}.yml generated!"
|
data/lib/rotten_egg.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems' unless defined? Gem
|
3
|
+
|
4
|
+
module RottenEgg
|
5
|
+
|
6
|
+
autoload :AppSetting, File.expand_path('../rotten_egg/app_setting', __FILE__)
|
7
|
+
autoload :MessageLogger, File.expand_path('../rotten_egg/message_logger', __FILE__)
|
8
|
+
autoload :Scm, File.expand_path('../rotten_egg/scm', __FILE__)
|
9
|
+
autoload :Util, File.expand_path('../rotten_egg/util', __FILE__)
|
10
|
+
autoload :User, File.expand_path('../rotten_egg/user', __FILE__)
|
11
|
+
autoload :Application, File.expand_path('../rotten_egg/application', __FILE__)
|
12
|
+
autoload :Server, File.expand_path('../rotten_egg/server', __FILE__)
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
class Hash
|
6
|
+
#take keys of hash and transform those to a symbols
|
7
|
+
def self.transform_keys_to_symbols(value)
|
8
|
+
return value if not value.is_a?(Hash)
|
9
|
+
hash = value.inject({}) { |memo, (k, v)| memo[k.to_sym] = Hash.transform_keys_to_symbols(v); memo }
|
10
|
+
return hash
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module RottenEgg
|
15
|
+
class AppSetting
|
16
|
+
|
17
|
+
def self.parse!(config, is_file = false)
|
18
|
+
|
19
|
+
setting_hash = is_file ? YAML::load_file(config) : YAML::load(config)
|
20
|
+
setting = Hash.transform_keys_to_symbols(setting_hash)
|
21
|
+
|
22
|
+
setting.update(:name => "rotten_egg") unless setting[:name]
|
23
|
+
|
24
|
+
raise "Scm is not in set." unless setting[:scm]
|
25
|
+
# only support git and svn
|
26
|
+
raise "Scm tools support [#{Scm::TOOLS.join("|")}]" unless Scm::TOOLS.include? setting[:scm][:tool]
|
27
|
+
|
28
|
+
# Locate scm tool bin path
|
29
|
+
scm_bin_path = Util.check_scm setting[:scm][:tool]
|
30
|
+
setting[:scm].update(scm_bin_path)
|
31
|
+
|
32
|
+
# Git repos branch default(master)
|
33
|
+
setting[:scm].update(:branch => "master") unless setting[:scm][:branch] if setting[:scm][:tool] == "git"
|
34
|
+
|
35
|
+
# Svn user and password
|
36
|
+
if setting[:scm][:user] and setting[:scm][:password]
|
37
|
+
setting[:scm].update(:authorize => true)
|
38
|
+
else
|
39
|
+
setting[:scm].update(:authorize => false)
|
40
|
+
end if setting[:scm][:tool] == "svn"
|
41
|
+
|
42
|
+
raise "Scm svn sanitize path prefix is missing" unless setting[:scm][:sanitize_path_prefix] if setting[:scm][:tool] == "svn"
|
43
|
+
|
44
|
+
raise "Scm repository path is not in set." unless setting[:scm][:repository]
|
45
|
+
|
46
|
+
setting[:scm][:repository] = Util.format_path(setting[:scm][:repository])
|
47
|
+
|
48
|
+
# Although 'svn' commands support REPOS_URL, but in this case we need local repos
|
49
|
+
raise "Scm repository path('#{setting[:scm][:repository]}') not exist, please check the given path exist." unless File.directory? setting[:scm][:repository]
|
50
|
+
|
51
|
+
raise "Remote scm version file missing." unless setting[:scm][:remote_version_file]
|
52
|
+
|
53
|
+
# FTP setting check
|
54
|
+
raise "Ftp is not in set." unless setting[:ftp]
|
55
|
+
|
56
|
+
#setting[:ftp].update(:use_sftp => %w(yes true).include?(setting[:ftp][:use_sftp]))
|
57
|
+
setting[:ftp].update(:passive => %w(yes true).include?(setting[:ftp][:passive]))
|
58
|
+
|
59
|
+
raise "Ftp host is not in set." unless setting[:ftp][:host]
|
60
|
+
|
61
|
+
# Ftp default port 21
|
62
|
+
setting[:ftp].update(:port => 21) unless setting[:ftp][:port]
|
63
|
+
raise "Ftp user is not in set." unless setting[:ftp][:user]
|
64
|
+
|
65
|
+
if setting[:ftp][:user] == "anonymous"
|
66
|
+
setting[:ftp].update(:password => nil)
|
67
|
+
else
|
68
|
+
raise "Ftp password is not in set." unless setting[:ftp][:password]
|
69
|
+
end
|
70
|
+
|
71
|
+
setting
|
72
|
+
end # - parse!
|
73
|
+
|
74
|
+
end # - AppSetting
|
75
|
+
|
76
|
+
end # - RottenEgg
|
@@ -0,0 +1,299 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'sinatra'
|
5
|
+
gem 'activesupport', '3.0.9'
|
6
|
+
require "active_support"
|
7
|
+
require 'sinatra_more'
|
8
|
+
require 'haml'
|
9
|
+
require 'yajl/json_gem'
|
10
|
+
|
11
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '../..'))
|
12
|
+
|
13
|
+
module RottenEgg
|
14
|
+
class Application < Sinatra::Base
|
15
|
+
|
16
|
+
set :root, APP_ROOT
|
17
|
+
set :app_name, "Rotten egg"
|
18
|
+
set :changed_entries, []
|
19
|
+
set :ftp_utils, {}
|
20
|
+
set :msg_logger, MessageLogger.new
|
21
|
+
set :running_status, false
|
22
|
+
|
23
|
+
if development?
|
24
|
+
reset!
|
25
|
+
# use Rack::Lint
|
26
|
+
use Rack::Reloader, 0
|
27
|
+
use Rack::CommonLogger
|
28
|
+
end
|
29
|
+
|
30
|
+
# secret => rand(16**64).to_s(16)
|
31
|
+
use Rack::Session::Cookie, :key => 'rotten.egg.session',
|
32
|
+
:path => '/',
|
33
|
+
:expire_after => 30 * 24 * 3600,
|
34
|
+
:secret => '6e4b1a7b6328a6175b93b7c95ea75b8356f4f30e37b9d06c23d72d1244a5a9aa'
|
35
|
+
|
36
|
+
#cregister Sinatra::RespondTo
|
37
|
+
|
38
|
+
register SinatraMore::MarkupPlugin
|
39
|
+
register SinatraMore::RenderPlugin
|
40
|
+
register SinatraMore::WardenPlugin
|
41
|
+
SinatraMore::WardenPlugin::PasswordStrategy.user_class = User
|
42
|
+
|
43
|
+
configure do;end
|
44
|
+
|
45
|
+
helpers do
|
46
|
+
def hash_to_tree_store(value)
|
47
|
+
return value unless value.is_a?(Hash)
|
48
|
+
result = value.inject([]) do |memo, (k,v)|
|
49
|
+
if v.is_a?(Hash)
|
50
|
+
memo << { :text => k, :cls => "folder", :children => hash_to_tree_store(v) }
|
51
|
+
else
|
52
|
+
memo << { :text => "#{k}: #{(k == :password) ? '******' : v}", :leaf => true, :cls => "file" }
|
53
|
+
end
|
54
|
+
memo
|
55
|
+
end
|
56
|
+
result
|
57
|
+
end
|
58
|
+
|
59
|
+
def who_is_running()
|
60
|
+
who = ''
|
61
|
+
settings.apps_setting.each do |key, setting|
|
62
|
+
if setting[:running] == true
|
63
|
+
who = key.to_s
|
64
|
+
break
|
65
|
+
end
|
66
|
+
end
|
67
|
+
who
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
before do
|
72
|
+
routes = %w(/login /authenticate /logout)
|
73
|
+
reg_exps = routes.collect { |route| %r(\A#{route}) }
|
74
|
+
filters = reg_exps.reject { |exp| (exp =~ request.path).nil? ? true : false }
|
75
|
+
if filters.empty?
|
76
|
+
redirect '/login' unless authenticated?
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
get '/' do
|
81
|
+
haml :index
|
82
|
+
end
|
83
|
+
|
84
|
+
get '/login/?' do
|
85
|
+
haml_template 'session/login'
|
86
|
+
end
|
87
|
+
|
88
|
+
# post '/unauthenticated' do
|
89
|
+
# respond_to do |format|
|
90
|
+
# format.html {}
|
91
|
+
# format.json {}
|
92
|
+
# end
|
93
|
+
# end
|
94
|
+
|
95
|
+
post '/authenticate/?' do
|
96
|
+
content_type :json, :charset => 'utf-8'
|
97
|
+
if User.auth?(params[:username], params[:password])
|
98
|
+
authenticate_user!
|
99
|
+
{:success => true, :msg => "logged in"}.to_json
|
100
|
+
else
|
101
|
+
{:msg => "login failed"}.to_json
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
get '/logout/?' do
|
106
|
+
logout_user!
|
107
|
+
redirect '/login'
|
108
|
+
end
|
109
|
+
|
110
|
+
get '/apps_list/?' do
|
111
|
+
content_type :json, :charset => 'utf-8'
|
112
|
+
hash_to_tree_store(settings.apps_setting).to_json
|
113
|
+
end
|
114
|
+
|
115
|
+
get '/files/?' do
|
116
|
+
mode, status = params[:action_mode], params[:status]
|
117
|
+
changes = if settings.changed_entries.empty?
|
118
|
+
[]
|
119
|
+
else
|
120
|
+
case mode
|
121
|
+
when "M", "A", "D"
|
122
|
+
settings.changed_entries.collect { |item| item[:action] == mode ? item : nil }.compact
|
123
|
+
else
|
124
|
+
settings.changed_entries
|
125
|
+
end
|
126
|
+
end
|
127
|
+
changes = if changes.empty?# unless
|
128
|
+
[]
|
129
|
+
else
|
130
|
+
case status
|
131
|
+
when "pending", "success", "failed"
|
132
|
+
changes.collect { |item| item[:status] == status.to_sym ? item : nil }.compact
|
133
|
+
else
|
134
|
+
changes
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
paging_column = changes.each_slice(settings.paging_size).collect { |files| files }
|
139
|
+
page = params[:page].to_i
|
140
|
+
if page <= 1
|
141
|
+
page = 1
|
142
|
+
elsif page >= paging_column.size
|
143
|
+
page = paging_column.size
|
144
|
+
end
|
145
|
+
page = page - 1
|
146
|
+
content_type :json, :charset => 'utf-8'
|
147
|
+
{ :success => true, :files => paging_column[page], :total => changes.size }.to_json
|
148
|
+
end
|
149
|
+
|
150
|
+
get '/logs?' do
|
151
|
+
#content_type :html, :charset => 'utf-8'
|
152
|
+
haml settings.msg_logger.pop_all.reverse.join("\n"), :layout => false
|
153
|
+
end
|
154
|
+
|
155
|
+
get '/running_status?' do
|
156
|
+
haml settings.running_status.to_s, :layout => false
|
157
|
+
end
|
158
|
+
|
159
|
+
get '/turnoff' do
|
160
|
+
settings.running_status = false
|
161
|
+
settings.apps_setting.each do |key, setting|
|
162
|
+
setting.update(:running => false)
|
163
|
+
settings.ftp_utils[key] = nil
|
164
|
+
end
|
165
|
+
settings.changed_entries.clear
|
166
|
+
settings.msg_logger.clear!
|
167
|
+
haml 'ok', :layout => false
|
168
|
+
end
|
169
|
+
|
170
|
+
# http://www.sencha.com/forum/archive/index.php/t-120201.html
|
171
|
+
# http://stackoverflow.com/questions/4859502/upload-files-by-extjs-ajax-request-and-asp-net-mvc-without-reload-page-ajax-styl
|
172
|
+
post '/cfg_upload/?' do
|
173
|
+
# specify content_type to 'text/html' , resolved ''<pre style="word-wrap: break-word; white-space: pre-wrap;">{"success":false,"msg":"Failed to add request"}</pre>' error message.
|
174
|
+
content_type :html, :charset => 'utf-8'
|
175
|
+
result = begin
|
176
|
+
yml_file = params["file_path"][:tempfile].read
|
177
|
+
setting = AppSetting.parse!(yml_file)
|
178
|
+
name = setting.delete(:name)
|
179
|
+
if settings.apps_setting[name] && settings.apps_setting[name][:running] == true
|
180
|
+
{ :success => true, :egg => 0, :msg => "The app [#{name}] is running, please try upload later." }
|
181
|
+
else
|
182
|
+
settings.apps_setting[name] = setting
|
183
|
+
{ :success => true, :egg => 1, :msg => "ok" }
|
184
|
+
end
|
185
|
+
rescue Exception => e
|
186
|
+
{ :success => true, :egg => 2, :msg => e.message }
|
187
|
+
end
|
188
|
+
|
189
|
+
haml result.to_json
|
190
|
+
end
|
191
|
+
|
192
|
+
get '/rm_app/?' do
|
193
|
+
content_type :html, :charset => 'utf-8'
|
194
|
+
result = begin
|
195
|
+
if settings.apps_setting[params[:name]] && settings.apps_setting[params[:name]][:running] == true
|
196
|
+
{ :egg => "running", :msg => "#{params[:name]} is running, please try later." }
|
197
|
+
else
|
198
|
+
settings.apps_setting.delete params[:name]
|
199
|
+
{ :egg => "ok", :msg => "#{params[:name]} remove successfully." }
|
200
|
+
end
|
201
|
+
rescue Exception => e
|
202
|
+
{ :egg => "error", :msg => e.message }
|
203
|
+
end
|
204
|
+
haml result.to_json, :layout => false
|
205
|
+
end
|
206
|
+
|
207
|
+
get '/run_app' do
|
208
|
+
content_type :html, :charset => 'utf-8'
|
209
|
+
if settings.running_status == true
|
210
|
+
result = {:egg => "running", :msg => "That's a thread[#{who_is_running}] is running, please try later."}
|
211
|
+
else
|
212
|
+
result = begin
|
213
|
+
app_setting = settings.apps_setting[params[:name]]
|
214
|
+
if app_setting
|
215
|
+
if app_setting[:running] == true
|
216
|
+
{:egg => "running", :msg => "#{params[:name]} is running, please try later."}
|
217
|
+
else
|
218
|
+
|
219
|
+
settings.changed_entries.clear
|
220
|
+
settings.ftp_utils.delete params[:name]
|
221
|
+
|
222
|
+
ftp_util = settings.ftp_utils[params[:name]] = Util::FtpTool.new(
|
223
|
+
app_setting[:ftp][:host],
|
224
|
+
app_setting[:ftp][:port],
|
225
|
+
app_setting[:ftp][:user],
|
226
|
+
app_setting[:ftp][:password],
|
227
|
+
:msg_logger => settings.msg_logger,
|
228
|
+
:passive => app_setting[:ftp][:passive],
|
229
|
+
:verbose => production?
|
230
|
+
)
|
231
|
+
settings.msg_logger.clear!
|
232
|
+
|
233
|
+
# begin running
|
234
|
+
app_setting.update(:running => true)
|
235
|
+
settings.running_status = true
|
236
|
+
|
237
|
+
dld_ver_status = ftp_util.download_version_file(settings.working_directory, app_setting[:scm][:remote_version_file])
|
238
|
+
status = case dld_ver_status
|
239
|
+
when :initial
|
240
|
+
app_setting[:scm].update(:remote_commit => nil)
|
241
|
+
when :success
|
242
|
+
if File.exist?(settings.working_directory + app_setting[:scm][:remote_version_file])
|
243
|
+
app_setting[:scm].update(:remote_commit => File.read(settings.working_directory + app_setting[:scm][:remote_version_file]).chomp)
|
244
|
+
true
|
245
|
+
else
|
246
|
+
false
|
247
|
+
end
|
248
|
+
else # :failure, :ftp_connect_failure
|
249
|
+
false
|
250
|
+
end
|
251
|
+
if status
|
252
|
+
settings.changed_entries = Scm.get_changes(app_setting[:scm])
|
253
|
+
puts "goes here"
|
254
|
+
if settings.changed_entries.empty?
|
255
|
+
app_setting.update(:running => false)
|
256
|
+
settings.running_status = false
|
257
|
+
{:egg => "empty", :msg => "no files has been changed"}
|
258
|
+
else
|
259
|
+
# fork {}
|
260
|
+
Thread.fork {
|
261
|
+
result = ftp_util.apply_changes(app_setting[:scm][:repository], settings.changed_entries)
|
262
|
+
if result
|
263
|
+
File.open(settings.working_directory + app_setting[:name] + "_latest_version.txt", "w") { |f| f.write(app_setting[:scm][:latest_commit]) }
|
264
|
+
upload_version_file_status = ftp_util.update_version_file settings.working_directory + app_setting[:name] + "_latest_version.txt", app_setting[:scm][:remote_version_file]
|
265
|
+
end
|
266
|
+
if upload_version_file_status
|
267
|
+
settings.changed_entries.clear
|
268
|
+
settings.msg_logger.clear!
|
269
|
+
end
|
270
|
+
app_setting.update(:running => false)
|
271
|
+
settings.running_status = false
|
272
|
+
|
273
|
+
}
|
274
|
+
puts "goes rotten"
|
275
|
+
{:egg => "rotten", :msg => "running..."}
|
276
|
+
end
|
277
|
+
else
|
278
|
+
app_setting.update(:running => false)
|
279
|
+
settings.running_status = false
|
280
|
+
{:egg => 'failure', :msg => "download remove version file failed"}
|
281
|
+
end
|
282
|
+
end
|
283
|
+
else
|
284
|
+
app_setting.update(:running => false)
|
285
|
+
settings.running_status = false
|
286
|
+
{:egg => "missing", :msg => "#{params[:name]} not exist"}
|
287
|
+
end # config setting exist
|
288
|
+
rescue Exception => e
|
289
|
+
app_setting.update(:running => false)
|
290
|
+
settings.running_status = false
|
291
|
+
{:egg => "error", :msg => e.message}
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
haml result.to_json, :layout => false
|
296
|
+
end
|
297
|
+
|
298
|
+
end
|
299
|
+
end
|