spiderfw 0.5.13 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -0
- data/Rakefile +7 -4
- data/VERSION +1 -1
- data/apps/admin/_init.rb +9 -0
- data/apps/admin/controllers/admin_controller.rb +12 -0
- data/apps/admin/widgets/dashboard_widget/dashboard_widget.rb +8 -0
- data/apps/app_server/app_server.rb +11 -1
- data/apps/app_server/config/options.rb +4 -0
- data/apps/app_server/controllers/app_server_controller.rb +47 -9
- data/apps/app_server/lib/app.rb +3 -1
- data/apps/app_server/lib/git_app.rb +16 -0
- data/apps/app_server/views/app_list.shtml +1 -1
- data/apps/cas_server/config/options.rb +4 -0
- data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +192 -31
- data/apps/cas_server/lib/cas.rb +31 -9
- data/apps/core/auth/_init.rb +2 -2
- data/apps/core/auth/config/options.rb +6 -0
- data/apps/core/auth/controllers/login_controller.rb +1 -1
- data/apps/core/auth/controllers/mixins/auth_helper.rb +6 -1
- data/apps/core/auth/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
- data/apps/core/auth/lib/login_authenticator.rb +12 -1
- data/apps/core/auth/lib/rbac.rb +25 -0
- data/apps/core/auth/models/group.rb +3 -8
- data/apps/core/auth/models/login_user.rb +11 -1
- data/apps/core/auth/models/mixins/rbac_provider.rb +60 -0
- data/apps/core/auth/po/it/spider_auth.po +19 -3
- data/apps/core/auth/po/spider_auth.pot +18 -2
- data/apps/core/auth/views/login.shtml +1 -0
- data/apps/core/components/_init.rb +2 -0
- data/apps/core/components/assets.rb +112 -0
- data/apps/core/components/po/it/spider_components.po +20 -6
- data/apps/core/components/po/spider_components.pot +16 -4
- data/apps/core/components/public/css/grid/1140.css +80 -0
- data/apps/core/components/public/css/grid/ie.css +43 -0
- data/apps/core/components/public/css/grid/layout.css +32 -0
- data/apps/core/components/public/css/grid/mobile.css +26 -0
- data/apps/core/components/public/css/grid/smallerscreen.css +3 -0
- data/apps/core/components/public/css/grid/typeimg.css +72 -0
- data/apps/core/components/public/js/jquery/{jquery-1.4.2.js → jquery-1.4.3.js} +1524 -881
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/button_bg.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/datepicker.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/icon_sprite.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/progress_bar.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/slider_h_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/slider_handles.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/slider_v_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/tab_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/the_gradient.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/smoothness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css → jquery-ui-1.8.4/css/Aristo/jquery-ui.custom.css} +249 -135
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/AUTHORS.txt +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/GPL-LICENSE.txt +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/MIT-LICENSE.txt +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/ui/i18n/jquery-ui-i18n.js +516 -111
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-af.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ar.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ar.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-az.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-bg.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-bg.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-bs.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ca.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ca.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-cs.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-cs.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-da.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-da.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-de.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-de.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-el.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-el.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-en-GB.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-eo.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-eo.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-es.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-es.js} +7 -3
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-et.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-eu.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-fa.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fa.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-fi.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fi.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fo.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fr-CH.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-fr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-he.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-he.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-hr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-hr.js} +8 -4
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-hu.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-hu.js} +8 -4
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-hy.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-hy.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-id.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-id.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-is.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-is.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-it.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-it.js} +10 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ja.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ja.js} +5 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ko.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ko.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-lt.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-lt.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-lv.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-lv.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ms.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ms.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-nl.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-nl.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-no.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-no.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-pl.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-pl.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-pt-BR.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-pt-BR.js} +9 -5
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ro.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ro.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ru.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ru.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sk.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sk.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sl.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sl.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sq.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sq.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr-SR.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sr-SR.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sr.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sv.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sv.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ta.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-th.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-th.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-tr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-tr.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-uk.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-uk.js} +10 -12
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-vi.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-CN.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-zh-CN.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-zh-HK.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-TW.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-zh-TW.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.blind.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.blind.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.bounce.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.bounce.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.clip.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.clip.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.core.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.core.js} +390 -221
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.drop.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.drop.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.explode.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.explode.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.fold.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.fold.js} +6 -6
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.effects.highlight.js +50 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.effects.pulsate.js +51 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.scale.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.scale.js} +29 -31
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.shake.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.shake.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.slide.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.slide.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.transfer.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.transfer.js} +6 -6
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.accordion.js +598 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.autocomplete.js +550 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.button.js +365 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.core.js +281 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.datepicker.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.datepicker.js} +343 -247
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.dialog.js +827 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.draggable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.draggable.js} +107 -76
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.droppable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.droppable.js} +48 -45
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.mouse.js +151 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.position.js +233 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.progressbar.js +94 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.resizable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.resizable.js} +73 -61
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.selectable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.selectable.js} +42 -33
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.slider.js +680 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.sortable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.sortable.js} +136 -84
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.tabs.js +757 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.widget.js +237 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/version.txt +1 -0
- data/apps/core/components/public/js/jquery/patches/jquery-ui/jquery.ui.autocomplete-001.patch +17 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.datalink.js +258 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.json.js +178 -0
- data/apps/core/components/public/js/plugins/sortable.js +96 -72
- data/apps/core/components/public/js/spider.js +108 -50
- data/apps/core/components/public/js/utils.i18n.json +1 -0
- data/apps/core/components/public/js/utils.js +27 -0
- data/apps/core/components/widgets/admin/admin.rb +1 -1
- data/apps/core/components/widgets/admin/admin.shtml +1 -0
- data/apps/core/components/widgets/crud/crud.rb +6 -2
- data/apps/core/components/widgets/crud/crud.shtml +1 -0
- data/apps/core/components/widgets/list/list.rb +1 -1
- data/apps/core/components/widgets/list/list.shtml +2 -2
- data/apps/core/components/widgets/search_table/search_table.shtml +1 -1
- data/apps/core/components/widgets/switcher/switcher.rb +5 -1
- data/apps/core/components/widgets/table/table.rb +18 -3
- data/apps/core/components/widgets/table/table.shtml +1 -1
- data/apps/core/components/widgets/tabs/tabs.rb +0 -1
- data/apps/core/forms/_init.rb +3 -1
- data/apps/core/forms/public/ckeditor/adapters/jquery.js +6 -0
- data/apps/core/forms/public/ckeditor/ckeditor.js +137 -0
- data/apps/core/forms/public/ckeditor/images/spacer.gif +0 -0
- data/apps/core/forms/public/ckeditor/lang/_languages.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/_translationstatus.txt +60 -0
- data/apps/core/forms/public/ckeditor/lang/af.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ar.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/bg.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/bn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/bs.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ca.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/cs.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/cy.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/da.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/de.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/el.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en-au.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en-ca.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en-gb.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/eo.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/es.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/et.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/eu.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fa.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fi.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fo.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fr-ca.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/gl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/gu.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/hi.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/hr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/hu.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/is.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/it.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ja.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/km.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ko.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/lt.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/lv.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/mn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ms.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/nb.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/nl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/no.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/pl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/pt-br.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/pt.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ro.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ru.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sk.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sr-latn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sv.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/th.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/tr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/uk.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/vi.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/zh-cn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/zh.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/about/dialogs/about.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/autogrow/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/colordialog/dialogs/colordialog.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/apps/core/forms/public/ckeditor/plugins/div/dialogs/div.js +8 -0
- data/apps/core/forms/public/ckeditor/plugins/find/dialogs/find.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/flash/dialogs/flash.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/button.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/checkbox.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/form.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/radio.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/select.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textarea.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textfield.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/iframedialog/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/image/dialogs/image.js +13 -0
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/anchor.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/link.js +11 -0
- data/apps/core/forms/public/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/liststyle/dialogs/liststyle.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/pastefromword/filter/default.js +10 -0
- data/apps/core/forms/public/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/options.js +8 -0
- data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/toolbar.css +6 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/dialogs/smiley.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/specialchar/dialogs/specialchar.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/styles/styles/default.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/table/dialogs/table.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/tableresize/plugin.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/tabletools/dialogs/tableCell.js +8 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/dialogs/templates.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/default.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/dialogs/uicolor.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/yui.css +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/yui.js +76 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.css +6 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.js +7 -0
- data/apps/core/forms/public/ckeditor/skins/kama/dialog.css +9 -0
- data/apps/core/forms/public/ckeditor/skins/kama/editor.css +12 -0
- data/apps/core/forms/public/ckeditor/skins/kama/icons.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/mini.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/noimage.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/sprites.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/skin.js +7 -0
- data/apps/core/forms/public/ckeditor/skins/kama/templates.css +6 -0
- data/apps/core/forms/public/ckeditor/themes/default/theme.js +8 -0
- data/apps/core/forms/public/css/form.css +3 -0
- data/apps/core/forms/public/file_input.js +1 -1
- data/apps/core/forms/public/html_area.js +55 -0
- data/apps/core/forms/public/search_select.js +46 -19
- data/apps/core/forms/public/select.js +11 -5
- data/apps/core/forms/widgets/form/form.rb +22 -6
- data/apps/core/forms/widgets/form/form.shtml +2 -0
- data/apps/core/forms/widgets/inputs/date_time/date_time.rb +6 -1
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -0
- data/apps/core/forms/widgets/inputs/html_area/html_area.rb +51 -0
- data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +13 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.rb +8 -10
- data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +7 -7
- data/apps/core/forms/widgets/inputs/select/select.rb +15 -9
- data/apps/core/forms/widgets/inputs/select/select.shtml +1 -1
- data/apps/core/forms/widgets/inputs/time_span/time_span.rb +42 -0
- data/apps/core/forms/widgets/inputs/time_span/time_span.shtml +8 -0
- data/apps/master/_init.rb +18 -0
- data/apps/master/cmd.rb +57 -0
- data/apps/master/config/options.rb +6 -0
- data/apps/master/controllers/login_controller.rb +22 -0
- data/apps/master/controllers/master_controller.rb +261 -10
- data/apps/master/controllers/scout_controller.rb +121 -0
- data/apps/master/controllers/servant_controller.rb +16 -0
- data/apps/master/data/locale/it/LC_MESSAGES/spider_master.mo +0 -0
- data/apps/master/lib/resource.rb +7 -0
- data/apps/master/lib/resources/db_resource.rb +7 -0
- data/apps/master/lib/scout_plugin.rb +89 -0
- data/apps/master/lib/site_type.rb +24 -0
- data/apps/master/master.rb +40 -0
- data/apps/master/models/admin.rb +35 -0
- data/apps/master/models/command.rb +17 -0
- data/apps/master/models/customer.rb +20 -1
- data/apps/master/models/resource.rb +1 -0
- data/apps/master/models/scout_alert.rb +30 -0
- data/apps/master/models/scout_average.rb +23 -0
- data/apps/master/models/scout_error.rb +30 -0
- data/apps/master/models/scout_plugin_info.rb +11 -0
- data/apps/master/models/scout_plugin_instance.rb +303 -0
- data/apps/master/models/scout_plugin_trigger.rb +285 -0
- data/apps/master/models/scout_report.rb +31 -0
- data/apps/master/models/scout_report_field.rb +26 -0
- data/apps/master/models/servant.rb +82 -6
- data/apps/master/plugins/resources/apache/apache.rb +9 -0
- data/apps/master/plugins/resources/mysql/mysql.rb +45 -0
- data/apps/master/plugins/site_types/spider/spider.rb +11 -0
- data/apps/master/po/it/spider_master.po +352 -0
- data/apps/master/po/spider_master.pot +331 -0
- data/apps/master/public/css/img/web.png +0 -0
- data/apps/master/public/css/login.css +51 -0
- data/apps/master/public/css/master.css +290 -0
- data/apps/master/public/css/reset.css +23 -0
- data/apps/master/public/js/charts.js +84 -0
- data/apps/master/public/js/master.js +3 -0
- data/apps/master/templates/email/alert.html.erb +14 -0
- data/apps/master/templates/email/alert.text.erb +4 -0
- data/apps/master/views/admin.layout.shtml +14 -0
- data/apps/master/views/admin.shtml +5 -0
- data/apps/master/views/customer.shtml +37 -14
- data/apps/master/views/customers.shtml +9 -7
- data/apps/master/views/login.layout.shtml +13 -0
- data/apps/master/views/master.layout.shtml +26 -3
- data/apps/master/views/plugin_data.shtml +30 -0
- data/apps/master/views/plugin_edit.shtml +41 -0
- data/apps/master/views/plugin_instance.shtml +43 -0
- data/apps/master/views/servant.shtml +74 -0
- data/apps/master/views/servants.shtml +4 -0
- data/apps/master/views/site.shtml +3 -0
- data/apps/master/views/site_edit.shtml +17 -0
- data/apps/master/views/trigger_edit.shtml +100 -0
- data/apps/messenger/_init.rb +27 -1
- data/apps/messenger/backends/email/smtp.rb +76 -0
- data/apps/messenger/backends/sms/smstools.rb +46 -0
- data/apps/messenger/config/options.rb +28 -2
- data/apps/messenger/controllers/mixins/messenger_helper.rb +9 -5
- data/apps/messenger/lib/email_backend.rb +14 -0
- data/apps/messenger/lib/sms_backend.rb +14 -0
- data/apps/messenger/messenger.rb +32 -41
- data/apps/messenger/models/email.rb +2 -0
- data/apps/messenger/models/message.rb +37 -15
- data/apps/messenger/models/sms.rb +15 -0
- data/apps/servant/bin/spider-servant.rb +2 -1
- data/apps/servant/cmd.rb +62 -0
- data/apps/servant/controllers/servant_controller.rb +12 -0
- data/apps/servant/lib/resource.rb +3 -0
- data/apps/servant/lib/resources/db/mysql.rb +4 -0
- data/apps/servant/lib/resources/db.rb +1 -0
- data/apps/servant/lib/servant.rb +9 -3
- data/apps/worker/cmd.rb +1 -1
- data/apps/worker/models/job.rb +5 -2
- data/apps/worker/worker.rb +7 -5
- data/blueprints/install/config.ru +0 -1
- data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
- data/lib/spiderfw/app.rb +77 -5
- data/lib/spiderfw/cache/template_cache.rb +15 -5
- data/lib/spiderfw/cmd/cmd.rb +2 -0
- data/lib/spiderfw/cmd/commands/app.rb +159 -0
- data/lib/spiderfw/cmd/commands/config.rb +16 -0
- data/lib/spiderfw/cmd/commands/content.rb +1 -1
- data/lib/spiderfw/cmd/commands/create.rb +13 -0
- data/lib/spiderfw/cmd/commands/model.rb +5 -1
- data/lib/spiderfw/cmd/commands/setup.rb +44 -10
- data/lib/spiderfw/cmd/commands/webserver.rb +15 -1
- data/lib/spiderfw/config/configuration.rb +19 -2
- data/lib/spiderfw/config/configuration_editor.rb +197 -0
- data/lib/spiderfw/config/options/spider.rb +48 -22
- data/lib/spiderfw/{static_content.rb → content_utils.rb} +23 -1
- data/lib/spiderfw/controller/controller.rb +8 -5
- data/lib/spiderfw/controller/controller_mixin.rb +39 -3
- data/lib/spiderfw/controller/cookies.rb +0 -3
- data/lib/spiderfw/controller/dispatcher.rb +1 -1
- data/lib/spiderfw/controller/first_responder.rb +1 -0
- data/lib/spiderfw/controller/home_controller.rb +10 -1
- data/lib/spiderfw/controller/http_controller.rb +105 -6
- data/lib/spiderfw/controller/mixins/http_mixin.rb +0 -1
- data/lib/spiderfw/controller/mixins/static_content.rb +35 -12
- data/lib/spiderfw/controller/mixins/visual.rb +125 -72
- data/lib/spiderfw/controller/request.rb +13 -1
- data/lib/spiderfw/controller/response.rb +14 -8
- data/lib/spiderfw/controller/scene.rb +5 -0
- data/lib/spiderfw/controller/session/file_session.rb +1 -1
- data/lib/spiderfw/create.rb +17 -0
- data/lib/spiderfw/home.rb +20 -8
- data/lib/spiderfw/http/adapters/mongrel.rb +24 -15
- data/lib/spiderfw/http/adapters/rack.rb +8 -3
- data/lib/spiderfw/http/adapters/webrick.rb +1 -0
- data/lib/spiderfw/http/server.rb +1 -0
- data/lib/spiderfw/i18n/cldr.rb +8 -1
- data/lib/spiderfw/i18n/i18n.rb +3 -4
- data/lib/spiderfw/i18n/javascript_parser.rb +54 -0
- data/lib/spiderfw/model/base_model.rb +550 -120
- data/lib/spiderfw/model/condition.rb +11 -2
- data/lib/spiderfw/model/data_type.rb +1 -1
- data/lib/spiderfw/model/datatypes/bool.rb +3 -1
- data/lib/spiderfw/model/datatypes/decimal.rb +4 -0
- data/lib/spiderfw/model/datatypes/password.rb +1 -0
- data/lib/spiderfw/model/datatypes/time_span.rb +26 -0
- data/lib/spiderfw/model/datatypes.rb +1 -0
- data/lib/spiderfw/model/element.rb +29 -28
- data/lib/spiderfw/model/extended_models/managed.rb +15 -0
- data/lib/spiderfw/model/identity_mapper.rb +89 -10
- data/lib/spiderfw/model/inline_model.rb +20 -2
- data/lib/spiderfw/model/integrated_element.rb +41 -0
- data/lib/spiderfw/model/mappers/db_mapper.rb +31 -27
- data/lib/spiderfw/model/mappers/hash_mapper.rb +9 -2
- data/lib/spiderfw/model/mappers/mapper.rb +105 -50
- data/lib/spiderfw/model/mappers/vfs/flat_file.rb +1 -1
- data/lib/spiderfw/model/mixins/state_machine.rb +6 -0
- data/lib/spiderfw/model/mixins/tree.rb +20 -4
- data/lib/spiderfw/model/mixins/versioned.rb +440 -67
- data/lib/spiderfw/model/model.rb +78 -17
- data/lib/spiderfw/model/model_hash.rb +2 -2
- data/lib/spiderfw/model/query.rb +17 -0
- data/lib/spiderfw/model/query_set.rb +86 -14
- data/lib/spiderfw/model/storage/base_storage.rb +1 -0
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +44 -15
- data/lib/spiderfw/model/storage/db/adapters/oracle.rb +8 -7
- data/lib/spiderfw/model/storage/db/connectors/oci8.rb +7 -1
- data/lib/spiderfw/model/storage/db/db_schema.rb +13 -0
- data/lib/spiderfw/model/storage/db/db_storage.rb +25 -5
- data/lib/spiderfw/model/unit_of_work.rb +96 -15
- data/lib/spiderfw/requires.rb +9 -1
- data/lib/spiderfw/setup/app_manager.rb +81 -0
- data/lib/spiderfw/setup/app_server_client.rb +59 -0
- data/lib/spiderfw/setup/setup_task.rb +68 -6
- data/lib/spiderfw/setup/spider_setup_wizard.rb +375 -0
- data/lib/spiderfw/site.rb +53 -0
- data/lib/spiderfw/templates/blocks/attr_if.rb +2 -2
- data/lib/spiderfw/templates/blocks/comment.rb +7 -2
- data/lib/spiderfw/templates/blocks/each.rb +1 -1
- data/lib/spiderfw/templates/blocks/html.rb +7 -0
- data/lib/spiderfw/templates/blocks/layout_assets.rb +20 -0
- data/lib/spiderfw/templates/blocks/output.rb +18 -0
- data/lib/spiderfw/templates/blocks/text.rb +17 -19
- data/lib/spiderfw/templates/blocks/widget.rb +4 -2
- data/lib/spiderfw/templates/layout.rb +269 -2
- data/lib/spiderfw/templates/template.rb +279 -46
- data/lib/spiderfw/templates/template_blocks.rb +31 -37
- data/lib/spiderfw/utils/events/event_source.rb +54 -0
- data/lib/spiderfw/utils/json.rb +39 -0
- data/lib/spiderfw/utils/logger.rb +186 -23
- data/lib/spiderfw/utils/memory.rb +30 -0
- data/lib/spiderfw/utils/monkey/date_time.rb +32 -2
- data/lib/spiderfw/utils/monkey/module.rb +16 -0
- data/lib/spiderfw/utils/monkey/object.rb +8 -0
- data/lib/spiderfw/utils/ordered_hash.rb +148 -0
- data/lib/spiderfw/utils/profiling.rb +36 -0
- data/lib/spiderfw/utils/secure_random.rb +223 -0
- data/lib/spiderfw/version.rb +1 -1
- data/lib/spiderfw/widget/widget.rb +143 -51
- data/lib/spiderfw/widget/widget_plugin.rb +13 -2
- data/lib/spiderfw.rb +117 -35
- data/spider.gemspec +1 -1
- metadata +506 -255
- data/apps/core/components/public/js/jquery/jquery-1.3.2.js +0 -4376
- data/apps/core/components/public/js/jquery/jquery-1.4.2-min.js +0 -154
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css +0 -406
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/ChangeLog.txt +0 -20
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/META.json +0 -32
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.js +0 -100
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.min.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.pack.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/test/index.html +0 -197
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.js +0 -97
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.min.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.pack.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.zip +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/jsdiff/jsdiff.js +0 -159
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testrunner.js +0 -780
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testsuite.css +0 -120
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/simulate/jquery.simulate.js +0 -152
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/jquery-1.3.2.js +0 -4376
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.accordion.css +0 -9
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.all.css +0 -2
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.base.css +0 -8
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.core.css +0 -37
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.datepicker.css +0 -62
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.dialog.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.progressbar.css +0 -4
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.resizable.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.slider.css +0 -17
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.tabs.css +0 -11
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.theme.css +0 -245
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/jquery-ui-1.7.2.custom.css +0 -406
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.accordion.css +0 -9
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.all.css +0 -2
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.base.css +0 -8
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.core.css +0 -37
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.datepicker.css +0 -62
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.dialog.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.progressbar.css +0 -4
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.resizable.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.slider.css +0 -17
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.tabs.css +0 -11
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.theme.css +0 -247
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.highlight.js +0 -48
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.pulsate.js +0 -56
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js +0 -9133
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.accordion.js +0 -477
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.core.js +0 -519
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.dialog.js +0 -671
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.progressbar.js +0 -116
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.slider.js +0 -558
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.tabs.js +0 -685
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/version.txt +0 -1
- data/apps/core/components/public/js/jquery/jquery-ui/index.html +0 -367
- data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-1.3.2.min.js +0 -19
- data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-ui-1.7.2.custom.min.js +0 -298
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/changelog.txt +0 -27
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.css +0 -48
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js +0 -808
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.min.js +0 -13
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.pack.js +0 -12
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.ajaxQueue.js +0 -116
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.bgiframe.min.js +0 -10
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.js +0 -3558
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox-compressed.js +0 -10
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox.css +0 -163
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/todo +0 -166
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +0 -187
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +0 -1
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +0 -193
- data/apps/core/forms/widgets/inputs/subform/subform.rb +0 -10
- data/apps/core/forms/widgets/inputs/subform/subform.shtml +0 -5
- data/apps/hippo/_init.rb +0 -10
- data/apps/hippo/models/mixins/hippo_struct.rb +0 -226
- data/apps/hippo/models/security_group.rb +0 -21
- data/apps/hippo/models/security_user.rb +0 -29
- data/apps/hippo/script/converti_strutture.rb +0 -335
- data/data/locale/it/LC_MESSAGES/cms.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_files.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_images.mo +0 -0
- data/lib/spiderfw/utils/monkey/hpricot_compat.rb +0 -0
- data/lib/spiderfw/utils/setup_task.rb +0 -35
- data/lib/spiderfw/utils/test_case.rb +0 -24
- /data/apps/core/components/public/js/jquery/{jquery-ui/css/smoothness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- /data/apps/{messenger/lib/backends/email/smtp.rb → servant/lib/commands/discovery.rb} +0 -0
data/lib/spiderfw/app.rb
CHANGED
@@ -15,6 +15,7 @@ module Spider
|
|
15
15
|
attr_accessor :short_prefix
|
16
16
|
attr_reader :command
|
17
17
|
attr_reader :spec
|
18
|
+
attr_reader :gettext_dirs, :gettext_extensions, :gettext_parsers
|
18
19
|
|
19
20
|
def init
|
20
21
|
unless @path
|
@@ -23,6 +24,7 @@ module Spider
|
|
23
24
|
@path = dir
|
24
25
|
end
|
25
26
|
@short_name ||= Inflector.underscore(self.name).gsub('/', '_')
|
27
|
+
@dotted_name = Inflector.underscore(self.name).gsub('/', '.')
|
26
28
|
@pub_path ||= @path+'/public'
|
27
29
|
@test_path ||= @path+'/test'
|
28
30
|
@setup_path ||= @path+'/setup'
|
@@ -35,15 +37,46 @@ module Spider
|
|
35
37
|
load_spec(spec_path) if File.exists?(spec_path)
|
36
38
|
@route_url ||= Inflector.underscore(self.name)
|
37
39
|
@label ||= @short_name.split('_').each{ |p| p[0] = p[0].chr.upcase }.join(' ')
|
40
|
+
@gettext_parsers ||= []
|
41
|
+
@gettext_dirs ||= ['lib','bin','controllers','models','views','widgets','public']
|
42
|
+
@gettext_extensions ||= ['rb','rhtml','shtml','js']
|
38
43
|
|
39
44
|
find_tags
|
40
45
|
end
|
41
46
|
|
42
47
|
def request_url
|
48
|
+
if u = Spider.conf.get("#{@dotted_name}.url")
|
49
|
+
return u
|
50
|
+
end
|
43
51
|
Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping('/'+@route_url)
|
44
52
|
end
|
45
53
|
alias :url :request_url
|
46
54
|
|
55
|
+
def http_url(action=nil)
|
56
|
+
if u = Spider.conf.get("#{@dotted_name}.http_url")
|
57
|
+
return u
|
58
|
+
end
|
59
|
+
return nil unless Spider.site
|
60
|
+
u = "http://#{Spider.site.domain}"
|
61
|
+
u += ":#{Spider.site.port}" unless Spider.site.port == 80
|
62
|
+
u += url
|
63
|
+
u += "/"+action.to_s if action
|
64
|
+
u
|
65
|
+
end
|
66
|
+
|
67
|
+
def https_url
|
68
|
+
return nil unless Spider.site && Spider.site.ssl?
|
69
|
+
u = "https://#{Spider.site.domain}"
|
70
|
+
u += ":#{Spider.site.ssl_port}" unless Spider.site.ssl_port == 443
|
71
|
+
u += url
|
72
|
+
u
|
73
|
+
end
|
74
|
+
|
75
|
+
def http_s_url
|
76
|
+
return https_url if Spider.site && Spider.site.ssl?
|
77
|
+
return http_url
|
78
|
+
end
|
79
|
+
|
47
80
|
def pub_url
|
48
81
|
if Spider.conf.get('static_content.mode') == 'publish'
|
49
82
|
Spider::HomeController.pub_url+'/apps/'+self.short_name
|
@@ -99,6 +132,16 @@ module Spider
|
|
99
132
|
self.constants.map{ |m| const_get(m) }.select{ |m| m.subclass_of? Spider::Controller }
|
100
133
|
end
|
101
134
|
|
135
|
+
def find_resource(type, name, cur_path=nil)
|
136
|
+
Spider.find_resource(type, name, cur_path, self)
|
137
|
+
end
|
138
|
+
|
139
|
+
def find_resource_path(type, name, cur_path=nil)
|
140
|
+
res = Spider.find_resource(type, name, cur_path, self)
|
141
|
+
return res ? res.path : nil
|
142
|
+
end
|
143
|
+
|
144
|
+
|
102
145
|
def register_tag(tag, obj)
|
103
146
|
@tags ||= {}
|
104
147
|
@tags[tag] = obj
|
@@ -172,6 +215,11 @@ module Spider
|
|
172
215
|
@version = @spec.version if @spec.version
|
173
216
|
end
|
174
217
|
|
218
|
+
def gettext_parsers
|
219
|
+
@gettext_parsers ||[]
|
220
|
+
end
|
221
|
+
|
222
|
+
|
175
223
|
|
176
224
|
end
|
177
225
|
|
@@ -183,11 +231,24 @@ module Spider
|
|
183
231
|
class AppSpec
|
184
232
|
@@attributes = []
|
185
233
|
|
186
|
-
def self.attribute(name)
|
234
|
+
def self.attribute(name, options={})
|
187
235
|
@@attributes << name
|
188
236
|
str = <<END_OF_EVAL
|
189
237
|
def #{name}(val=nil)
|
190
238
|
@#{name} = val if val
|
239
|
+
@#{name} ||= #{options[:default].inspect}
|
240
|
+
@#{name}
|
241
|
+
end
|
242
|
+
END_OF_EVAL
|
243
|
+
class_eval(str)
|
244
|
+
end
|
245
|
+
|
246
|
+
def self.array_attribute(name, options={})
|
247
|
+
@@attributes << name
|
248
|
+
str = <<END_OF_EVAL
|
249
|
+
def #{name}(*vals)
|
250
|
+
@#{name} = vals unless vals.empty?
|
251
|
+
@#{name} ||= []
|
191
252
|
@#{name}
|
192
253
|
end
|
193
254
|
END_OF_EVAL
|
@@ -197,13 +258,16 @@ END_OF_EVAL
|
|
197
258
|
attribute :app_id
|
198
259
|
attribute :name
|
199
260
|
attribute :description
|
200
|
-
attribute :authors
|
201
261
|
attribute :git_repo
|
202
|
-
attribute :git_repo_ro
|
203
262
|
attribute :git_repo_rw
|
204
|
-
|
205
|
-
|
263
|
+
array_attribute :authors
|
264
|
+
array_attribute :depends
|
265
|
+
array_attribute :depends_optional
|
266
|
+
array_attribute :can_use
|
267
|
+
array_attribute :gems
|
268
|
+
array_attribute :gems_optional
|
206
269
|
attribute :version
|
270
|
+
attribute :app_server
|
207
271
|
|
208
272
|
def id(val=nil)
|
209
273
|
self.app_id(val)
|
@@ -249,6 +313,14 @@ END_OF_EVAL
|
|
249
313
|
def to_json
|
250
314
|
to_h.to_json
|
251
315
|
end
|
316
|
+
|
317
|
+
def self.parse_hash(h)
|
318
|
+
spec = self.new
|
319
|
+
h.each do |key, value|
|
320
|
+
spec.send(:"#{key}", value)
|
321
|
+
end
|
322
|
+
spec
|
323
|
+
end
|
252
324
|
|
253
325
|
end
|
254
326
|
|
@@ -24,11 +24,13 @@ module Spider
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def fresh?(path)
|
27
|
+
full_path = get_location(path)
|
27
28
|
if Spider.config.get('template.cache.disable')
|
28
|
-
|
29
|
+
Spider::Request.current[:compiled_templates] ||= {}
|
30
|
+
return true if Spider::Request.current[:compiled_templates][full_path]
|
31
|
+
#debug("Cache disabled, recreating #{full_path}")
|
29
32
|
return false
|
30
33
|
end
|
31
|
-
full_path = get_location(path)
|
32
34
|
exists = File.exist?(full_path)
|
33
35
|
if (Spider.config.get('template.cache.no_check') && exists)
|
34
36
|
return true
|
@@ -47,7 +49,7 @@ module Spider
|
|
47
49
|
# TODO: maybe insert here an (optional) tamper check
|
48
50
|
# that looks if the cache mtime is later then the saved time
|
49
51
|
Marshal.load(IO.read(check_file)).each do |check, time|
|
50
|
-
debug("Template file #{check} changed, refreshing cache")
|
52
|
+
#debug("Template file #{check} changed, refreshing cache")
|
51
53
|
return false if File.mtime(check) > time
|
52
54
|
end
|
53
55
|
lock_file.flock(File::LOCK_UN)
|
@@ -59,7 +61,7 @@ module Spider
|
|
59
61
|
end
|
60
62
|
|
61
63
|
def refresh(path, &block)
|
62
|
-
debug("Refreshing cache for #{path}")
|
64
|
+
#debug("Refreshing cache for #{path}")
|
63
65
|
res = block.call()
|
64
66
|
write_cache(path, res)
|
65
67
|
return res
|
@@ -70,6 +72,7 @@ module Spider
|
|
70
72
|
compiled.cache_path = path
|
71
73
|
init_code = IO.read(path+'/init.rb')
|
72
74
|
run_code = IO.read(path+'/run.rb')
|
75
|
+
compiled.assets = Marshal.load(IO.read(path+'/assets'))
|
73
76
|
block = Spider::TemplateBlocks::CompiledBlock.new(init_code, run_code)
|
74
77
|
compiled.block = block
|
75
78
|
Dir.new(path).each do |entry|
|
@@ -83,7 +86,7 @@ module Spider
|
|
83
86
|
end
|
84
87
|
|
85
88
|
def load_cache(template_path)
|
86
|
-
debug("Using cached #{template_path}")
|
89
|
+
# debug("Using cached #{template_path}")
|
87
90
|
full_path = get_location(template_path)
|
88
91
|
lock_file = File.new(full_path)
|
89
92
|
lock_file.flock(File::LOCK_SH)
|
@@ -100,6 +103,9 @@ module Spider
|
|
100
103
|
File.open(path+'/run.rb', 'w') do |file|
|
101
104
|
file.puts(compiled.block.run_code)
|
102
105
|
end
|
106
|
+
File.open(path+'/assets', 'w') do |file|
|
107
|
+
file.puts(Marshal.dump(compiled.assets))
|
108
|
+
end
|
103
109
|
compiled.subtemplates.each do |id, sub|
|
104
110
|
sub_path = "#{path}/#{id}"
|
105
111
|
FileUtils.mkpath(sub_path)
|
@@ -112,6 +118,10 @@ module Spider
|
|
112
118
|
f.puts(val)
|
113
119
|
end
|
114
120
|
end
|
121
|
+
if Spider.config.get('template.cache.disable')
|
122
|
+
Spider::Request.current[:compiled_templates] ||= {}
|
123
|
+
Spider::Request.current[:compiled_templates][path] = true
|
124
|
+
end
|
115
125
|
end
|
116
126
|
|
117
127
|
def write_cache(template_path, compiled_template)
|
data/lib/spiderfw/cmd/cmd.rb
CHANGED
@@ -9,6 +9,7 @@ require 'spiderfw/cmd/commands/setup'
|
|
9
9
|
require 'spiderfw/cmd/commands/model'
|
10
10
|
require 'spiderfw/cmd/commands/config'
|
11
11
|
require 'spiderfw/cmd/commands/content'
|
12
|
+
require 'spiderfw/cmd/commands/app'
|
12
13
|
|
13
14
|
module Spider; module CommandLine
|
14
15
|
|
@@ -49,6 +50,7 @@ module Spider; module CommandLine
|
|
49
50
|
@cmd.add_command(ModelCommand.new)
|
50
51
|
@cmd.add_command(ConfigCommand.new)
|
51
52
|
@cmd.add_command(ContentCommand.new)
|
53
|
+
@cmd.add_command(AppCommand.new)
|
52
54
|
# @cmd.add_command(ScaffoldCommand.new)
|
53
55
|
end
|
54
56
|
|
@@ -0,0 +1,159 @@
|
|
1
|
+
class AppCommand < CmdParse::Command
|
2
|
+
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
super('app', true, true )
|
6
|
+
@short_desc = _("Manage apps")
|
7
|
+
|
8
|
+
@server_url = 'http://www.soluzionipa.it/euroservizi/spider/app_server'
|
9
|
+
|
10
|
+
self.options = CmdParse::OptionParserWrapper.new do |opt|
|
11
|
+
opt.on("--proxy", _("Proxy server to use (http://user:pass@host:port)"), "-p"){ |p|
|
12
|
+
ENV['http_proxy'] = p
|
13
|
+
}
|
14
|
+
opt.on("--server", _("App server"), "-s") { |s|
|
15
|
+
@server_url = s
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
@installed = true
|
20
|
+
|
21
|
+
list = CmdParse::Command.new( 'list', false )
|
22
|
+
list.short_desc = _("List installed and available apps")
|
23
|
+
list.options = CmdParse::OptionParserWrapper.new do |opt|
|
24
|
+
opt.on("--installed", _("List installed apps (the default)")) { |installed|
|
25
|
+
@remote = false
|
26
|
+
}
|
27
|
+
opt.on("--remote", _("List only remote apps"), "-r"){ |r|
|
28
|
+
@installed = false
|
29
|
+
@remote = true
|
30
|
+
}
|
31
|
+
opt.on("--all", _("List both local and remote apps"), "-a"){ |a|
|
32
|
+
@installed = true
|
33
|
+
@remote = true
|
34
|
+
@all = true
|
35
|
+
}
|
36
|
+
opt.on("--core", _("Include apps that come with spider"), "-c"){ |c|
|
37
|
+
@core = true
|
38
|
+
}
|
39
|
+
end
|
40
|
+
list.set_execution_block do |args|
|
41
|
+
if @installed
|
42
|
+
require 'spiderfw'
|
43
|
+
installed = {}
|
44
|
+
Spider.home.list_apps.each do |app|
|
45
|
+
installed[app] = {
|
46
|
+
:active => Spider.apps_by_path[app] ? true : false
|
47
|
+
}
|
48
|
+
if appspec = Dir.glob("#{Spider.paths[:apps]}/#{app}/*.appspec")[0]
|
49
|
+
info = Spider::App::AppSpec.load(appspec)
|
50
|
+
installed[app].merge!({
|
51
|
+
:version => info.version
|
52
|
+
})
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
if @remote
|
57
|
+
require 'spiderfw/setup/app_server_client'
|
58
|
+
client = Spider::AppServerClient.new(@server_url)
|
59
|
+
remote = {}
|
60
|
+
client.specs.each do |app|
|
61
|
+
remote[app.app_id] = {
|
62
|
+
:version => app.version
|
63
|
+
}
|
64
|
+
if installed && installed[app] && installed[app][:version]
|
65
|
+
v = Gem::Version.new(installed[app][:version])
|
66
|
+
if v < app.version
|
67
|
+
installed[app][:available] = app.version
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
if @installed
|
73
|
+
puts
|
74
|
+
puts "*** INSTALLED APPS ***"
|
75
|
+
puts
|
76
|
+
installed.keys.sort.each do |app|
|
77
|
+
details = installed[app]
|
78
|
+
str = app
|
79
|
+
str += " #{details[:version]}" if details[:version]
|
80
|
+
str += " (#{_('active')})" if details[:active]
|
81
|
+
puts str
|
82
|
+
end
|
83
|
+
end
|
84
|
+
if @remote
|
85
|
+
puts
|
86
|
+
puts "*** REMOTE APPS ***"
|
87
|
+
puts
|
88
|
+
remote.keys.sort.each do |app|
|
89
|
+
details = remote[app]
|
90
|
+
str = app
|
91
|
+
str += " #{details[:version]}" if details[:version]
|
92
|
+
puts str
|
93
|
+
end
|
94
|
+
end
|
95
|
+
puts
|
96
|
+
end
|
97
|
+
self.add_command( list )
|
98
|
+
|
99
|
+
|
100
|
+
install = CmdParse::Command.new( 'install', false )
|
101
|
+
install.short_desc = _("Install an app")
|
102
|
+
install.options = CmdParse::OptionParserWrapper.new do |opt|
|
103
|
+
opt.on("--no-git", _("Don't use git for installing apps"), "-g"){ |r| @no_git = true }
|
104
|
+
opt.on("--no-dependencies", _("Don't install other apps this one depends on"), "-d"){ |d|
|
105
|
+
@no_deps = true
|
106
|
+
}
|
107
|
+
opt.on("--no-gems", _("Don't install ruby gems this app depends on"), "-g"){ |g| @no_gems = true }
|
108
|
+
opt.on("--no-optional", _("Don't install optional app dependencies"), "-D"){ |o| @no_optional = true }
|
109
|
+
opt.on("--no-optional-gems", _("Don't install optional gem dependencies"), "-G"){ |g|
|
110
|
+
@no_optional_gems = true
|
111
|
+
}
|
112
|
+
end
|
113
|
+
install.set_execution_block do |args|
|
114
|
+
unless File.exist?('init.rb') && File.directory?('apps')
|
115
|
+
puts _("Please execute this command from the home folder")
|
116
|
+
exit
|
117
|
+
end
|
118
|
+
require 'spiderfw/setup/app_server_client'
|
119
|
+
use_git = false
|
120
|
+
unless @no_git
|
121
|
+
begin
|
122
|
+
require 'grit'
|
123
|
+
use_git = true
|
124
|
+
rescue
|
125
|
+
puts "Grit not available; install Grit for Git support"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
apps = args
|
129
|
+
existent = []
|
130
|
+
apps.each do |app|
|
131
|
+
if File.exist?("apps/#{app}")
|
132
|
+
puts _("%s already exists, skipping") % app
|
133
|
+
existent << app
|
134
|
+
end
|
135
|
+
end
|
136
|
+
apps -= existent
|
137
|
+
require 'spiderfw/setup/app_manager'
|
138
|
+
specs = []
|
139
|
+
client = Spider::AppServerClient.new(@server_url)
|
140
|
+
if @no_deps
|
141
|
+
specs = client.get_specs(apps)
|
142
|
+
else
|
143
|
+
specs = client.get_deps(apps, :no_optional => @no_optional)
|
144
|
+
end
|
145
|
+
deps = specs.map{ |s| s.app_id }
|
146
|
+
unless (deps - apps).empty?
|
147
|
+
puts _("The following apps will be installed as a dependency:")
|
148
|
+
puts (deps - apps).inspect
|
149
|
+
end
|
150
|
+
Spider::AppManager.install(specs, Dir.pwd, {
|
151
|
+
:use_git => use_git,
|
152
|
+
:no_gems => @no_gems,
|
153
|
+
:no_optional_gems => @no_optional_gems
|
154
|
+
})
|
155
|
+
end
|
156
|
+
self.add_command(install)
|
157
|
+
|
158
|
+
end
|
159
|
+
end
|
@@ -48,6 +48,22 @@ class ConfigCommand < CmdParse::Command
|
|
48
48
|
end
|
49
49
|
|
50
50
|
self.add_command(get)
|
51
|
+
|
52
|
+
set = CmdParse::Command.new('set', false)
|
53
|
+
set.short_desc = _("Set the value of a configuration option")
|
54
|
+
set.set_execution_block do |args|
|
55
|
+
require 'spiderfw'
|
56
|
+
require 'lib/spiderfw/config/configuration_editor'
|
57
|
+
editor = Spider::ConfigurationEditor.new
|
58
|
+
Spider.config.loaded_files.each do |f|
|
59
|
+
editor.load(f)
|
60
|
+
end
|
61
|
+
editor.set(*args)
|
62
|
+
editor.save
|
63
|
+
end
|
64
|
+
|
65
|
+
self.add_command(set)
|
66
|
+
|
51
67
|
end
|
52
68
|
|
53
69
|
end
|
@@ -23,7 +23,7 @@ class ContentCommand < CmdParse::Command
|
|
23
23
|
compress.short_desc = _("Compress Javascript files")
|
24
24
|
compress.set_execution_block do |args|
|
25
25
|
require 'spiderfw'
|
26
|
-
Spider::
|
26
|
+
Spider::ContentUtils.compress(*args)
|
27
27
|
end
|
28
28
|
|
29
29
|
self.add_command(compress)
|
@@ -37,11 +37,24 @@ class CreateCommand < CmdParse::Command
|
|
37
37
|
"-p"){ |path|
|
38
38
|
@path = path
|
39
39
|
}
|
40
|
+
opt.on("--no-wizard", _("Don't launch wizard"), "-W"){ |w| @no_wizard }
|
40
41
|
end
|
41
42
|
install.set_execution_block do |installs|
|
42
43
|
@path ||= Dir.pwd
|
43
44
|
installs.each do |inst|
|
44
45
|
Spider::Create.home(inst, @path)
|
46
|
+
unless @no_wizard
|
47
|
+
Dir.chdir(inst) do
|
48
|
+
$SPIDER_RUN_PATH = Dir.pwd
|
49
|
+
$:.push($SPIDER_RUN_PATH)
|
50
|
+
require 'spiderfw'
|
51
|
+
require 'lib/spiderfw/setup/spider_setup_wizard'
|
52
|
+
wizard = Spider::SpiderSetupWizard.new
|
53
|
+
wizard.first_run = true
|
54
|
+
wizard.implementation(Spider::ConsoleWizard)
|
55
|
+
wizard.run
|
56
|
+
end
|
57
|
+
end
|
45
58
|
end
|
46
59
|
end
|
47
60
|
self.add_command(install, false)
|
@@ -6,6 +6,7 @@ class ModelCommand < CmdParse::Command
|
|
6
6
|
@short_desc = _("Manage models")
|
7
7
|
@apps = []
|
8
8
|
@force = false
|
9
|
+
@no_fkc = true
|
9
10
|
|
10
11
|
sync_cmd = CmdParse::Command.new( 'sync', false )
|
11
12
|
sync_cmd.short_desc = _("Sync models")
|
@@ -23,6 +24,7 @@ class ModelCommand < CmdParse::Command
|
|
23
24
|
}
|
24
25
|
opt.on("--non-managed", _("Process also non managed models"), "-m"){ |m| @non_managed = true}
|
25
26
|
opt.on("--no-fk-constraints", _("Don't create foreign key constraints"), "-c"){ |c| @no_fkc = true }
|
27
|
+
opt.on("--fk-constraints", _("Create foreign key constraints"), "-C" ){ |c| @no_fkc = false }
|
26
28
|
end
|
27
29
|
|
28
30
|
sync_cmd.set_execution_block do |req_models|
|
@@ -37,7 +39,9 @@ class ModelCommand < CmdParse::Command
|
|
37
39
|
if (mod.is_a?(Module) && mod.include?(Spider::App))
|
38
40
|
mod.models.each do |m|
|
39
41
|
unless @non_managed || m < Spider::Model::Managed
|
40
|
-
|
42
|
+
unless m < Spider::Model::InlineModel || m.attributes[:sub_model]
|
43
|
+
Spider.logger.warn("Skipping #{m} because it's non managed (use -m to override)")
|
44
|
+
end
|
41
45
|
next
|
42
46
|
end
|
43
47
|
models << m
|
@@ -17,6 +17,9 @@ class SetupCommand < CmdParse::Command
|
|
17
17
|
opt.on("--to [VERSION]", _("Setup to a specific version"), "-t"){ |to|
|
18
18
|
@to = Gem::Version.new(to)
|
19
19
|
}
|
20
|
+
opt.on("--version [VERSION]", _("Only run the setup script for the given version"), "-v"){ |v|
|
21
|
+
@version = Gem::Version.new(v)
|
22
|
+
}
|
20
23
|
opt.on("--all", _("Setup all active apps")){ |all|
|
21
24
|
@all = true
|
22
25
|
}
|
@@ -25,8 +28,15 @@ class SetupCommand < CmdParse::Command
|
|
25
28
|
set_execution_block do |apps|
|
26
29
|
require 'spiderfw'
|
27
30
|
apps = Spider.apps.keys if @all
|
28
|
-
if (apps.length > 1) && (@to || @from)
|
29
|
-
raise "Can't use --from or --
|
31
|
+
if (apps.length > 1) && (@to || @from || @version)
|
32
|
+
raise "Can't use --from, --to or --version with multiple apps"
|
33
|
+
end
|
34
|
+
if apps.length == 0
|
35
|
+
require 'lib/spiderfw/setup/spider_setup_wizard'
|
36
|
+
wizard = Spider::SpiderSetupWizard.new
|
37
|
+
wizard.implementation(Spider::ConsoleWizard)
|
38
|
+
wizard.run
|
39
|
+
|
30
40
|
end
|
31
41
|
apps.each do |name|
|
32
42
|
Spider.load_app(name) unless Spider.apps[name]
|
@@ -35,15 +45,39 @@ class SetupCommand < CmdParse::Command
|
|
35
45
|
current = @from || app.installed_version
|
36
46
|
new_version = @to || app.version
|
37
47
|
next unless File.exist?(path)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
48
|
+
tasks = []
|
49
|
+
if @version
|
50
|
+
tasks = ["#{@version}.rb"]
|
51
|
+
else
|
52
|
+
tasks = Dir.entries(path).reject{ |p| p[0].chr == '.'}.sort{ |a, b|
|
53
|
+
va = Gem::Version.new(File.basename(a, '.rb'))
|
54
|
+
vb = Gem::Version.new(File.basename(b, '.rb'))
|
55
|
+
va <=> vb
|
56
|
+
}
|
57
|
+
if @from || @to
|
58
|
+
tasks.reject!{ |t|
|
59
|
+
v = Gem::Version.new(File.basename(t, '.rb'))
|
60
|
+
true if @from && v < @from
|
61
|
+
true if @to && v > @to
|
62
|
+
false
|
63
|
+
}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
done_tasks = []
|
67
|
+
Spider::Model::Managed.no_set_dates = true
|
68
|
+
tasks.each do |task|
|
69
|
+
Spider.logger.info("Running setup task #{path+'/'+task}")
|
70
|
+
t = Spider::SetupTask.load("#{path}/#{task}")
|
71
|
+
t.app = app
|
72
|
+
begin
|
73
|
+
done_tasks << t
|
74
|
+
t.do_up
|
75
|
+
rescue => exc
|
76
|
+
done_tasks.each{ |dt| dt.do_down } # FIXME: rescue and log errors in down
|
77
|
+
raise
|
78
|
+
end
|
46
79
|
end
|
80
|
+
Spider::Model::Managed.no_set_dates = false
|
47
81
|
app.installed_version = app.version
|
48
82
|
end
|
49
83
|
end
|
@@ -38,6 +38,10 @@ class WebServerCommand < CmdParse::Command
|
|
38
38
|
start.set_execution_block do |args|
|
39
39
|
require 'spiderfw'
|
40
40
|
raise "Can't use cgi mode with SSL" if @ssl && @cgi
|
41
|
+
if @ssl && @server_name != 'webrick'
|
42
|
+
puts _("Note: Using WEBrick as a webserver, since SSL was requested")
|
43
|
+
@server_name = 'webrick'
|
44
|
+
end
|
41
45
|
@port ||= Spider.conf.get('webserver.port')
|
42
46
|
@server_name ||= Spider.conf.get('http.server')
|
43
47
|
@pid_file = Spider.paths[:var]+'/run/server.pid'
|
@@ -47,6 +51,12 @@ class WebServerCommand < CmdParse::Command
|
|
47
51
|
ssl_server = nil
|
48
52
|
start = lambda{
|
49
53
|
Spider.startup
|
54
|
+
if Spider.conf.get('devel.trace.extended')
|
55
|
+
require 'ruby-debug'
|
56
|
+
require 'spiderfw/utils/monkey/debugger'
|
57
|
+
Debugger.start
|
58
|
+
Debugger.post_mortem
|
59
|
+
end
|
50
60
|
|
51
61
|
thread = Thread.new do
|
52
62
|
server.start(:port => @port, :cgi => @cgi)
|
@@ -54,12 +64,16 @@ class WebServerCommand < CmdParse::Command
|
|
54
64
|
if (@ssl)
|
55
65
|
@ssl_cert ||= Spider.conf.get('orgs.default.cert')
|
56
66
|
@ssl_key ||= Spider.conf.get('orgs.default.private_key')
|
67
|
+
raise "SSL Certificate not set" unless @ssl_cert
|
68
|
+
raise "SSL Key not set" unless @ssl_key
|
69
|
+
raise "SSL Certificate (#{@ssl_cert}) not found" unless File.file?(@ssl_cert)
|
70
|
+
raise "SSL Key (#{@ssl_key}) not found" unless File.file?(@ssl_key)
|
57
71
|
ssl_thread = Thread.new do
|
58
72
|
ssl_server = Spider::HTTP.const_get(servers[@server_name]).new
|
59
73
|
ssl_server.start(:port => @ssl, :ssl => true, :ssl_cert => @ssl_cert, :ssl_private_key => @ssl_key)
|
60
74
|
end
|
61
75
|
end
|
62
|
-
do_shutdown = lambda{
|
76
|
+
do_shutdown = lambda{ |arg|
|
63
77
|
server.shutdown
|
64
78
|
ssl_server.shutdown if ssl_server
|
65
79
|
Spider.shutdown
|
@@ -5,6 +5,7 @@ module Spider
|
|
5
5
|
|
6
6
|
class Configuration
|
7
7
|
attr_accessor :options, :current_set, :hash_key
|
8
|
+
attr_reader :loaded_files
|
8
9
|
@@options = {}
|
9
10
|
@@lang_aliases = {}
|
10
11
|
|
@@ -26,6 +27,7 @@ module Spider
|
|
26
27
|
@sets['default'] = self
|
27
28
|
@values = {}
|
28
29
|
@hash_key = nil
|
30
|
+
@loaded_files = []
|
29
31
|
end
|
30
32
|
|
31
33
|
def global_options
|
@@ -103,6 +105,7 @@ module Spider
|
|
103
105
|
end
|
104
106
|
else
|
105
107
|
val = convert_val(@options[key][:params][:type], val) if (@options[key][:params][:type])
|
108
|
+
@options[key][:params][:do].call(val) if @options[key][:params][:do]
|
106
109
|
self[key] = val
|
107
110
|
end
|
108
111
|
end
|
@@ -175,7 +178,7 @@ module Spider
|
|
175
178
|
# -:default the default value for the option; if it is a proc, it will be called
|
176
179
|
# -:choiches an array of allowed values
|
177
180
|
# -:type parameter type; can be one of int, string, bool
|
178
|
-
def config_option(name, description, params={}, &proc)
|
181
|
+
def config_option(name, description=nil, params={}, &proc)
|
179
182
|
name = name.to_s
|
180
183
|
if (params.empty? && description.is_a?(Hash))
|
181
184
|
params = description
|
@@ -183,12 +186,16 @@ module Spider
|
|
183
186
|
end
|
184
187
|
o = @options
|
185
188
|
params[:action] ||= proc if proc
|
189
|
+
params[:type] ||= String
|
186
190
|
first, rest = name.split('.', 2)
|
187
191
|
while (rest)
|
188
192
|
o = (o[first] ||= {})
|
189
193
|
first, rest = rest.split('.', 2)
|
190
194
|
end
|
191
|
-
|
195
|
+
if params && description
|
196
|
+
o[first] = {:description => description, :params => params}
|
197
|
+
end
|
198
|
+
o[first]
|
192
199
|
end
|
193
200
|
|
194
201
|
def option(name)
|
@@ -266,6 +273,7 @@ module Spider
|
|
266
273
|
configure(key, val)
|
267
274
|
end
|
268
275
|
end
|
276
|
+
@loaded_files << file
|
269
277
|
end
|
270
278
|
|
271
279
|
def to_yaml
|
@@ -286,6 +294,15 @@ module Spider
|
|
286
294
|
return h
|
287
295
|
end
|
288
296
|
|
297
|
+
def get_editor
|
298
|
+
require 'spiderfw/config/configuration_editor'
|
299
|
+
editor = ConfigurationEditor.new
|
300
|
+
@loaded_files.each do |f|
|
301
|
+
editor.load(f)
|
302
|
+
end
|
303
|
+
editor
|
304
|
+
end
|
305
|
+
|
289
306
|
end
|
290
307
|
|
291
308
|
class ConfigurationException < Exception
|