exo_cms 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +3 -5
- data/app/controllers/concerns/exo/admin/{site_slug_id_filter.rb → site_restriction.rb} +3 -3
- data/app/controllers/concerns/exo/host_restriction.rb +32 -0
- data/app/controllers/concerns/exo/{route_filter.rb → request_restriction.rb} +8 -6
- data/app/controllers/exo/admin/assets_controller.rb +4 -4
- data/app/controllers/exo/admin/ckeditor_assets_controller.rb +2 -2
- data/app/controllers/exo/admin/ckeditor_blocks_controller.rb +3 -3
- data/app/controllers/exo/admin/contributors_controller.rb +2 -2
- data/app/controllers/exo/admin/items_controller.rb +3 -3
- data/app/controllers/exo/admin/pages_controller.rb +2 -2
- data/app/controllers/exo/admin/resources_controller.rb +2 -2
- data/app/controllers/exo/admin/routes_controller.rb +2 -2
- data/app/controllers/exo/admin/sessions_controller.rb +2 -0
- data/app/controllers/exo/admin/settings_controller.rb +5 -5
- data/app/controllers/exo/admin/site_controller.rb +1 -1
- data/app/controllers/exo/{admin/application_controller.rb → admin_controller.rb} +3 -3
- data/app/controllers/exo/gridfs_controller.rb +3 -3
- data/app/controllers/exo/pages_controller.rb +8 -9
- data/app/controllers/exo_controller.rb +4 -0
- data/app/helpers/exo/block_helper.rb +1 -1
- data/app/helpers/exo/resources_helper.rb +1 -1
- data/app/models/exo/app_service.rb +3 -0
- data/app/models/exo/block.rb +9 -11
- data/app/presenters/exo/item_decorator.rb +23 -0
- data/app/presenters/exo/resource_decorator.rb +21 -0
- data/app/presenters/exo/route_decorator.rb +23 -0
- data/app/presenters/exo/site_decorator.rb +25 -0
- data/app/resources/templates/application.html.haml +3 -3
- data/app/services/exo/config.rb +2 -0
- data/app/services/exo/router.rb +33 -0
- data/app/views/exo/admin/{application/_bheader.html.haml → _bheader.html.haml} +0 -0
- data/app/views/exo/admin/{application/_editor_header.html.haml → _editor_header.html.haml} +0 -0
- data/app/views/exo/admin/{application/_header.html.haml → _header.html.haml} +2 -2
- data/app/views/exo/admin/{application/_meta_errors.html.haml → _meta_errors.html.haml} +0 -0
- data/app/views/exo/admin/{application/_sidebar.html.haml → _sidebar.html.haml} +0 -0
- data/app/views/exo/admin/{application/_sidenav.html.haml → _sidenav.html.haml} +23 -17
- data/app/views/exo/admin/contributors/index.html.haml +1 -1
- data/app/views/exo/admin/{application/fields → fields}/_image.html.haml +0 -0
- data/app/views/exo/admin/{application/fields → fields}/_markdown.html.haml +0 -0
- data/app/views/exo/admin/items/show.html.haml +3 -3
- data/app/views/exo/admin/resources/index.html.haml +1 -1
- data/app/views/exo/admin/routes/index.html.haml +1 -1
- data/app/views/exo/admin/routes/show.html.haml +1 -1
- data/app/views/layouts/{application.html.erb → application.html.erb.tmp} +0 -0
- data/app/views/layouts/exo/admin/application.html.haml +1 -1
- data/app/views/layouts/exo/admin/editor.html.haml +2 -2
- data/config/initializers/devise.rb +27 -19
- data/config/routes.rb +1 -0
- data/lib/exo.rb +18 -7
- data/lib/exo/engine.rb +0 -2
- data/lib/exo/regexp.rb +7 -5
- data/lib/exo/version.rb +1 -1
- data/lib/generators/exo/install_generator.rb +20 -0
- data/lib/generators/exo/templates/engine_routes.rb +2 -0
- data/lib/generators/exo/templates/gems.rb +5 -0
- data/lib/generators/exo/templates/initializer.rb +5 -0
- data/spec/dummy/app/controllers/exo/admin/customs_controller.rb +1 -1
- data/spec/dummy/app/controllers/my_app/site_customs_controller.rb +1 -1
- data/spec/dummy/app/views/{a_sierra_theme → an_exo_theme}/a_page.html.haml +0 -0
- data/spec/dummy/app/views/an_exo_theme/a_page_with_block.html.haml +3 -0
- data/spec/dummy/app/views/layouts/{a_sierra_theme → an_exo_theme}/application.html.erb +0 -0
- data/spec/dummy/app/views/layouts/demo/application.html.haml +3 -3
- data/spec/dummy/config/application.rb +2 -1
- data/spec/dummy/config/initializers/exo.rb +2 -0
- data/spec/dummy/log/development.log +1938 -1
- data/spec/dummy/tmp/cache/assets/development/sprockets/03bec07d16adc41979a9767aaf23a5bf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/05d652e83e6b6823771fca143eabff87 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/063d6d3a982ac3bfa05750bd3d01416e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0b8cbd6c43ff11ed3ab96976a2e98e2b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0c48f6c7a09d069017a22749c940fd6a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0da0612d0055abcde88349af8cbdaffc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0e1b30ba4880626e3c136ff23d15f277 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0f621a895f3d0916a756a8c7313c7120 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/18fedf436371d2979b37a490e2cbcacf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1f93865a20acec72a1870a7f9d348cc0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/219ff56291853001c0fe482a28484813 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/224aace438e22fd51b5b2b6a45a4d69f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/24d0fbc91349d4114a1eefbe058c8fba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2a6027bbfa613448003ab80bfc3249f2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2c71b158948039606eb85485d93ed206 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3360fbdb00ed8ef59706becb7dbb41e4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/34f82b1703cb8350ca18f16392967779 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3b300b301493f1baf5d9dc2969701185 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3d2b5b35fe7888d5139899d2e067d2ce +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3dfa6cb0540572b6362a1d5e6a1f6d26 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/412b23d9dc12a05a414cae1e5a3fbbf8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/41acdde13a0132b81cbc4951661048cb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/41d37ff244c3daef0583214fbef2c560 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/48c744a9d1e3e5b052f995545823c315 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/497a85ce66b5ead32a647661d0bada21 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4a5a6e9cf9074d00b627b83cf85c62f9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4cd21bd7ac15013e918411a6001c4472 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/576d1d5819328f9c5e52bbec45cb991e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6089ad88fceb548141d376101c88bc94 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/667b895b188f4435053278e2497ac7b9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6df5499acca0edd86677d5beec5c2b18 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/716d07423ee379b258338cb932e39d25 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/717887cd48fa79a99d0c71e392750d58 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/727bcd360e44edbb990ea53347896a64 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/73f77b33ce0f17becb6e75ff1082c43e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/741b8483fbcabf9c321f7db58e78c3d8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/759a59934e8cb39ace939db6b3ca6c1a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/76d85daa1c4000f529bf26504ebde8d9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7888c5b61b2cd04d7ee4cf78ab510eb5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/797b3e33d6e04a512949c083da9c8819 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7ccfc79620770d38c5bd539c16fca755 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7eee5343ea643e8ac6dfa9282bbc4547 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7ef0c015d0ad290b8ffcd526afb67834 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/85556c6543bc5bde199eee0c8096d83e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/86d06f76cdbdc83c9621c928d42fa346 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8bb68b74b9c6d04b2172ef5589d5b1a5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/905ad43b3fc55108ad345c6255ddcfb8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9a65689623c3096b82dd97819ef02b79 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9b1352fb7f42bed64bf100b191511e0d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a7244c34cc0ff696fbfe2fccb04cb04b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b162acd8d30fdf3dd12192251e427c66 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b30e4385f999fefded784baa3436ecd3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b9df96c25252b82da00791df6d017199 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ba27cf3baf39fb89f47836875af24dd8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c02127f4958e88d15dad1754931334aa +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ca6ae3b0212906e203a675ad02a7729e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cb679ef7ff0235de4855aa5ee7c4fb27 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cb9e847b58fe12c042e8e608905c4c38 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/db9141fa82b703a2439a562438fc6f04 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e3efb6f18e9d6f7f1f7a2bfdb4a616d3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e5182eea228cd4e352dc35de5b86d387 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f20c3ba49438960a7f1184ec1aece636 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f3c6a93068f488ad8f54bf72f206fa3b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f952832de9d68bc78aae760f4d85d675 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fca2562e4bd00a9aaf122c2a9e76eea5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/colorize.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/content.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/header.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/sidebar.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/tables.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/wrapper.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/238d7e2ec3d3030371e96efa23f1677a0a064045/_functions.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_accordion.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_alert-boxes.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_block-grid.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_breadcrumbs.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_button-groups.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_buttons.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_clearing.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_dropdown-buttons.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_dropdown.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_flex-video.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_forms.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_global.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_grid.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_inline-lists.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_joyride.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_keystrokes.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_labels.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_magellan.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_offcanvas.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_orbit.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_pagination.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_panels.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_pricing-tables.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_progress-bars.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_reveal.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_side-nav.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_split-buttons.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_sub-nav.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_switch.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_tables.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_tabs.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_thumbs.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_tooltips.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_top-bar.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_type.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_visibility.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/54bc91a8b995104fa44ba264c53dbd8d0a6ce1eb/font-awesome.css.erbc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/689cee5da0d308518a9400df205830efb3b2004b/foundation.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/868bdcd3c8e6bd73d750879e972f235f451b00af/application.sassc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/868bdcd3c8e6bd73d750879e972f235f451b00af/foundation_and_overrides.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/868bdcd3c8e6bd73d750879e972f235f451b00af/responsive-tables.cssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/05d652e83e6b6823771fca143eabff87 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/063d6d3a982ac3bfa05750bd3d01416e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0b8cbd6c43ff11ed3ab96976a2e98e2b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0da0612d0055abcde88349af8cbdaffc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0e1b30ba4880626e3c136ff23d15f277 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0f621a895f3d0916a756a8c7313c7120 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1f93865a20acec72a1870a7f9d348cc0 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/224aace438e22fd51b5b2b6a45a4d69f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2a6027bbfa613448003ab80bfc3249f2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3360fbdb00ed8ef59706becb7dbb41e4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/34f82b1703cb8350ca18f16392967779 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3d2b5b35fe7888d5139899d2e067d2ce +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/412b23d9dc12a05a414cae1e5a3fbbf8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/41d37ff244c3daef0583214fbef2c560 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/447161da5ee42f4d3b0702a328975499 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4a5a6e9cf9074d00b627b83cf85c62f9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4cd21bd7ac15013e918411a6001c4472 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/576d1d5819328f9c5e52bbec45cb991e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5e9e6e4b1c4bb6da2f89517e17fdca8b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6089ad88fceb548141d376101c88bc94 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6df5499acca0edd86677d5beec5c2b18 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/717887cd48fa79a99d0c71e392750d58 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/73f77b33ce0f17becb6e75ff1082c43e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/741b8483fbcabf9c321f7db58e78c3d8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/759a59934e8cb39ace939db6b3ca6c1a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/76d85daa1c4000f529bf26504ebde8d9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7888c5b61b2cd04d7ee4cf78ab510eb5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7eee5343ea643e8ac6dfa9282bbc4547 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7ef0c015d0ad290b8ffcd526afb67834 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/85556c6543bc5bde199eee0c8096d83e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/86d06f76cdbdc83c9621c928d42fa346 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/905ad43b3fc55108ad345c6255ddcfb8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/9a65689623c3096b82dd97819ef02b79 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a7244c34cc0ff696fbfe2fccb04cb04b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b30e4385f999fefded784baa3436ecd3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b9df96c25252b82da00791df6d017199 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ba27cf3baf39fb89f47836875af24dd8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c02127f4958e88d15dad1754931334aa +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ca6ae3b0212906e203a675ad02a7729e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cb679ef7ff0235de4855aa5ee7c4fb27 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cb9e847b58fe12c042e8e608905c4c38 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/db9141fa82b703a2439a562438fc6f04 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e3efb6f18e9d6f7f1f7a2bfdb4a616d3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e5182eea228cd4e352dc35de5b86d387 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f20c3ba49438960a7f1184ec1aece636 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f3c6a93068f488ad8f54bf72f206fa3b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f94211d95775b7b113ff83fbab9d96e5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f952832de9d68bc78aae760f4d85d675 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fca2562e4bd00a9aaf122c2a9e76eea5 +0 -0
- data/spec/features/admin/routes/details_spec.rb +1 -1
- data/spec/features/front/page_blocks/defined_spec.rb +1 -1
- data/spec/features/front/page_blocks/undefined_spec.rb +1 -1
- data/spec/features/front/routes/page_spec.rb +1 -1
- data/spec/generators/exo/install_generator_spec.rb +41 -0
- data/spec/models/{sierra → exo}/contributor_spec.rb +0 -0
- data/spec/models/{sierra → exo}/site_spec.rb +0 -0
- data/spec/spec_helper.rb +8 -2
- data/spec/support/factories/block_factory.rb +1 -1
- data/spec/templates/fake_routes.rb +3 -0
- metadata +303 -360
- data/app/controllers/concerns/exo/host_filter.rb +0 -22
- data/app/controllers/exo/application_controller.rb +0 -6
- data/app/presenters/exo/item_presenter.rb +0 -19
- data/app/presenters/exo/resource_presenter.rb +0 -25
- data/app/presenters/exo/route_presenter.rb +0 -33
- data/app/presenters/exo/site_presenter.rb +0 -35
- data/app/services/exo/tick.rb +0 -36
- data/spec/dummy/app/views/a_sierra_theme/a_page_with_block.html.haml +0 -3
- data/spec/dummy/tmp/pids/server.pid +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class Exo
|
|
2
|
+
class SiteDecorator < Draper::Decorator
|
|
3
|
+
delegate_all
|
|
4
|
+
|
|
5
|
+
def resource_name name
|
|
6
|
+
name = name.to_s
|
|
7
|
+
if _resources[name] == nil
|
|
8
|
+
resource = object.resources.where(slug_id: name).first
|
|
9
|
+
decorated_resources[name] = resource ? ResourceDecorator.new(resource) : false
|
|
10
|
+
end
|
|
11
|
+
_resources[name]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def setting_name name
|
|
15
|
+
self.object.settings.where(slug_id: name.to_sym).first
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
protected
|
|
19
|
+
attr_accessor :_resources
|
|
20
|
+
|
|
21
|
+
def _resources
|
|
22
|
+
@_resources ||= {}
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
!!!
|
|
2
2
|
%html
|
|
3
3
|
%head
|
|
4
|
-
%title= @page_name ||
|
|
4
|
+
%title= @page_name || exo_site.slug_id
|
|
5
5
|
%meta{'http-equiv' => "content-language", :content => 'fr'}
|
|
6
6
|
%meta{'http-equiv' => "Content-Type", :content => "text/html; charset=ISO-8859-1"}
|
|
7
|
-
= stylesheet_link_tag
|
|
8
|
-
= javascript_include_tag
|
|
7
|
+
= stylesheet_link_tag exo_site.nest_path(:application), media: "all", "data-turbolinks-track" => true
|
|
8
|
+
= javascript_include_tag exo_site.nest_path(:application), "data-turbolinks-track" => true
|
|
9
9
|
= csrf_meta_tags
|
|
10
10
|
%body
|
|
11
11
|
= yield
|
data/app/services/exo/config.rb
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class Exo
|
|
2
|
+
class Router
|
|
3
|
+
attr_accessor :site, :route, :request, :params
|
|
4
|
+
|
|
5
|
+
def self.for_host! host
|
|
6
|
+
site = Site.any_of([{hosts: host}, {main_host: host}]).first
|
|
7
|
+
raise ::Exo::Site::UnknowHostError.new(host) unless site
|
|
8
|
+
new site
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize site
|
|
12
|
+
self.site = SiteDecorator.new site
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def domain_redirection?(host)
|
|
16
|
+
site.main_host.to_s != host
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def host_url path=''
|
|
20
|
+
"http://#{site.main_host}#{path}"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def for_request! request
|
|
24
|
+
unless self.route
|
|
25
|
+
Exo::PathMatcher.route_for(site.routes, request.params) do |route|
|
|
26
|
+
self.route = Exo::RouteDecorator.new route
|
|
27
|
+
end
|
|
28
|
+
raise ::Exo::Route::UnknowPathError.new site.main_host, request.path unless route
|
|
29
|
+
end
|
|
30
|
+
self.route
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
%h1
|
|
5
5
|
= link_to admin_root_url do
|
|
6
6
|
%i.fa.fa-home.fa-fw
|
|
7
|
-
=
|
|
7
|
+
= exo_site.slug_id.capitalize
|
|
8
8
|
%li.name.hide-for-medium-up
|
|
9
9
|
%h1
|
|
10
10
|
%a.toggle-sidenav{href: '#'}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
Sites
|
|
20
20
|
%ul.dropdown
|
|
21
21
|
- current_contributor.sites.each do |site|
|
|
22
|
-
%li{class: site ==
|
|
22
|
+
%li{class: site == exo_site ? 'active' : ''}
|
|
23
23
|
= link_to "#{site.url}/admin" do
|
|
24
24
|
%i.fa.fa-share.fa-fw
|
|
25
25
|
= site.name
|
|
File without changes
|
|
File without changes
|
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
%li.hide-for-medium-up
|
|
3
3
|
= link_to admin_root_url do
|
|
4
4
|
%i.fa.fa-home
|
|
5
|
-
=
|
|
6
|
-
|
|
7
|
-
%h4 Resources
|
|
8
|
-
- current_site.resources.asc(:name).each do |resource|
|
|
5
|
+
= exo_site.slug_id.capitalize
|
|
6
|
+
- if exo_site.services #.exists?
|
|
9
7
|
%li
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
%h4 Services
|
|
9
|
+
- exo_site.services.each do |s|
|
|
10
|
+
%li
|
|
11
|
+
= link_to s.path do
|
|
12
|
+
%i.fa.fa-star.fa-fw
|
|
13
|
+
= resource.name
|
|
14
|
+
- if exo_site.resources.exists?
|
|
15
|
+
%li
|
|
16
|
+
%h4 Resources
|
|
17
|
+
- exo_site.resources.asc(:name).each do |resource|
|
|
18
|
+
%li
|
|
19
|
+
= link_to admin_resource_url(resource) do
|
|
20
|
+
%i.fa.fa-archive.fa-fw
|
|
21
|
+
= resource.name
|
|
22
|
+
- if exo_site.routes.exists?
|
|
20
23
|
%li
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
%h4 Routes
|
|
25
|
+
- exo_site.routes.asc(:path).each do |route|
|
|
26
|
+
%li
|
|
27
|
+
= link_to admin_route_url(route) do
|
|
28
|
+
%i.fa.fa-road.fa-fw
|
|
29
|
+
= route.path
|
|
24
30
|
%li
|
|
25
31
|
%h4 Site
|
|
26
32
|
%li
|
|
File without changes
|
|
File without changes
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
- value = current_item.value_for meta_field
|
|
29
29
|
- if value == nil
|
|
30
30
|
%p= "-"
|
|
31
|
-
- elsif meta_field.kind_of?(
|
|
31
|
+
- elsif meta_field.kind_of?(Exo::Resource::MetaRelation)
|
|
32
32
|
- ids = meta_field.many ? value : [value]
|
|
33
|
-
- _resource =
|
|
33
|
+
- _resource = exo_site.resource_name meta_field.resource_slug_id
|
|
34
34
|
%ul
|
|
35
35
|
- ids.each do |id|
|
|
36
|
-
- item =
|
|
36
|
+
- item = exo_site.slug_scope(Exo::Resource::Item).where(_id: id).first
|
|
37
37
|
- next unless item
|
|
38
38
|
%li
|
|
39
39
|
= link_to admin_resource_item_url(_resource, item) do
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
!!!
|
|
2
2
|
%html
|
|
3
3
|
%head
|
|
4
|
-
%title= @page_title || "Exo-#{
|
|
4
|
+
%title= @page_title || "Exo-#{exo_site.slug_id.capitalize}"
|
|
5
5
|
%link{rel: 'shortcut icon', href: asset_path('admin/favicon.ico')}
|
|
6
6
|
%meta{'http-equiv' => 'content-language', :content => 'fr'}
|
|
7
7
|
%meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=ISO-8859-1'}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
%html
|
|
3
3
|
%head
|
|
4
4
|
%title Admin CMS
|
|
5
|
-
= stylesheet_link_tag 'admin/application', media: "all", "data-turbolinks-track" => true
|
|
5
|
+
= stylesheet_link_tag 'exo/admin/application', media: "all", "data-turbolinks-track" => true
|
|
6
6
|
= yield :head
|
|
7
7
|
= csrf_meta_tags
|
|
8
8
|
%body{style: 'background: #333'}
|
|
9
|
-
= javascript_include_tag 'admin/application', "data-turbolinks-track" => true
|
|
9
|
+
= javascript_include_tag 'exo/admin/application', "data-turbolinks-track" => true
|
|
10
10
|
= render partial: 'editor_header'
|
|
11
11
|
= yield
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
|
2
2
|
# Many of these configuration options can be set straight in your model.
|
|
3
3
|
Devise.setup do |config|
|
|
4
|
+
# The secret key used by Devise. Devise uses this key to generate
|
|
5
|
+
# random tokens. Changing this key will render invalid all existing
|
|
6
|
+
# confirmation, reset password and unlock tokens in the database.
|
|
7
|
+
config.secret_key = 'b2ff1bb6a8d74d4d58ddebf03731899c87c487a6a70326581157e77d421bdbe12b2b50f7d96ce9872de0b6c4d655de25ea065f7c42f8c9df162b55ab76250e74'
|
|
8
|
+
|
|
4
9
|
# ==> Mailer Configuration
|
|
5
10
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
|
6
|
-
# note that it will be overwritten if you use your own mailer class
|
|
7
|
-
|
|
11
|
+
# note that it will be overwritten if you use your own mailer class
|
|
12
|
+
# with default "from" parameter.
|
|
13
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
|
8
14
|
|
|
9
15
|
# Configure the class responsible to send e-mails.
|
|
10
|
-
# config.mailer =
|
|
16
|
+
# config.mailer = 'Devise::Mailer'
|
|
11
17
|
|
|
12
18
|
# ==> ORM configuration
|
|
13
19
|
# Load and configure the ORM. Supports :active_record (default) and
|
|
@@ -50,19 +56,16 @@ Devise.setup do |config|
|
|
|
50
56
|
|
|
51
57
|
# Tell if authentication through HTTP Auth is enabled. False by default.
|
|
52
58
|
# It can be set to an array that will enable http authentication only for the
|
|
53
|
-
# given strategies, for example, `config.http_authenticatable = [:
|
|
54
|
-
# enable it only for
|
|
59
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
|
60
|
+
# enable it only for database authentication. The supported strategies are:
|
|
55
61
|
# :database = Support basic authentication with authentication key + password
|
|
56
|
-
# :token = Support basic authentication with token authentication key
|
|
57
|
-
# :token_options = Support token authentication with options as defined in
|
|
58
|
-
# http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html
|
|
59
62
|
# config.http_authenticatable = false
|
|
60
63
|
|
|
61
64
|
# If http headers should be returned for AJAX requests. True by default.
|
|
62
65
|
# config.http_authenticatable_on_xhr = true
|
|
63
66
|
|
|
64
|
-
# The realm used in Http Basic Authentication.
|
|
65
|
-
# config.http_authentication_realm =
|
|
67
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
|
68
|
+
# config.http_authentication_realm = 'Application'
|
|
66
69
|
|
|
67
70
|
# It will change confirmation, password recovery and other workflows
|
|
68
71
|
# to behave the same regardless if the e-mail provided was right or wrong.
|
|
@@ -70,12 +73,18 @@ Devise.setup do |config|
|
|
|
70
73
|
# config.paranoid = true
|
|
71
74
|
|
|
72
75
|
# By default Devise will store the user in session. You can skip storage for
|
|
73
|
-
#
|
|
76
|
+
# particular strategies by setting this option.
|
|
74
77
|
# Notice that if you are skipping storage for all authentication paths, you
|
|
75
78
|
# may want to disable generating routes to Devise's sessions controller by
|
|
76
79
|
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
|
77
80
|
config.skip_session_storage = [:http_auth]
|
|
78
81
|
|
|
82
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
|
83
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
|
84
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
|
85
|
+
# from the server. You can disable this option at your own risk.
|
|
86
|
+
# config.clean_up_csrf_token_on_authentication = true
|
|
87
|
+
|
|
79
88
|
# ==> Configuration for :database_authenticatable
|
|
80
89
|
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
|
81
90
|
# using other encryptors, it sets how many times you want the password re-encrypted.
|
|
@@ -86,7 +95,7 @@ Devise.setup do |config|
|
|
|
86
95
|
config.stretches = Rails.env.test? ? 1 : 10
|
|
87
96
|
|
|
88
97
|
# Setup a pepper to generate the encrypted password.
|
|
89
|
-
# config.pepper =
|
|
98
|
+
# config.pepper = 'f95f583ad720cdbaa9d8cbc65dde406d997980de251f070d19c45a1da0dcd35f02a94b68061fc311c14d211145960d8702a669db63649b59335aa9068332f095'
|
|
90
99
|
|
|
91
100
|
# ==> Configuration for :confirmable
|
|
92
101
|
# A period that the user is allowed to access the website even without
|
|
@@ -164,6 +173,9 @@ Devise.setup do |config|
|
|
|
164
173
|
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
|
165
174
|
# config.unlock_in = 1.hour
|
|
166
175
|
|
|
176
|
+
# Warn on the last attempt before the account is locked.
|
|
177
|
+
# config.last_attempt_warning = false
|
|
178
|
+
|
|
167
179
|
# ==> Configuration for :recoverable
|
|
168
180
|
#
|
|
169
181
|
# Defines which key will be used when recovering the password for an account
|
|
@@ -184,10 +196,6 @@ Devise.setup do |config|
|
|
|
184
196
|
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
|
185
197
|
# config.encryptor = :sha512
|
|
186
198
|
|
|
187
|
-
# ==> Configuration for :token_authenticatable
|
|
188
|
-
# Defines name of the authentication token params key
|
|
189
|
-
# config.token_authentication_key = :auth_token
|
|
190
|
-
|
|
191
199
|
# ==> Scopes configuration
|
|
192
200
|
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
|
193
201
|
# "users/sessions/new". It's turned off by default because it's slower if you
|
|
@@ -211,7 +219,7 @@ Devise.setup do |config|
|
|
|
211
219
|
# should add them to the navigational formats lists.
|
|
212
220
|
#
|
|
213
221
|
# The "*/*" below is required to match Internet Explorer requests.
|
|
214
|
-
# config.navigational_formats = [
|
|
222
|
+
# config.navigational_formats = ['*/*', :html]
|
|
215
223
|
|
|
216
224
|
# The default HTTP method used to sign out a resource. Default is :delete.
|
|
217
225
|
config.sign_out_via = :delete
|
|
@@ -235,12 +243,12 @@ Devise.setup do |config|
|
|
|
235
243
|
# is mountable, there are some extra configurations to be taken into account.
|
|
236
244
|
# The following options are available, assuming the engine is mounted as:
|
|
237
245
|
#
|
|
238
|
-
# mount MyEngine, at:
|
|
246
|
+
# mount MyEngine, at: '/my_engine'
|
|
239
247
|
#
|
|
240
248
|
# The router that invoked `devise_for`, in the example above, would be:
|
|
241
249
|
config.router_name = :exo
|
|
242
250
|
#
|
|
243
251
|
# When using omniauth, Devise cannot automatically set Omniauth path,
|
|
244
252
|
# so you need to do it manually. For the users scope, it would be:
|
|
245
|
-
# config.omniauth_path_prefix =
|
|
253
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
|
246
254
|
end
|
data/config/routes.rb
CHANGED
data/lib/exo.rb
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
------
|
|
3
|
+
/\/ \/\
|
|
4
|
+
/ /\ /\ \
|
|
5
|
+
/ /_ \/ \ \
|
|
6
|
+
\ \ /\ / /
|
|
7
|
+
\ \/ \/ /
|
|
8
|
+
\/\ /\/
|
|
9
|
+
-------- CMS
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'mongoid'
|
|
13
|
+
require 'devise'
|
|
1
14
|
require "exo/engine"
|
|
15
|
+
require 'exo/regexp'
|
|
2
16
|
|
|
3
17
|
class Exo
|
|
4
18
|
include Singleton
|
|
@@ -10,11 +24,13 @@ class Exo
|
|
|
10
24
|
attr_accessor :services
|
|
11
25
|
|
|
12
26
|
def initialize
|
|
13
|
-
self.services =
|
|
27
|
+
self.services = []
|
|
14
28
|
end
|
|
15
29
|
|
|
16
30
|
def register_services hash
|
|
17
|
-
|
|
31
|
+
hash.each do |name, path|
|
|
32
|
+
self.services = AppService.new name, path
|
|
33
|
+
end
|
|
18
34
|
end
|
|
19
35
|
end
|
|
20
36
|
|
|
@@ -22,9 +38,4 @@ end
|
|
|
22
38
|
# s.generic_services(
|
|
23
39
|
# 'Messages' => '/somepath'
|
|
24
40
|
# )
|
|
25
|
-
#
|
|
26
|
-
# s.register_models(
|
|
27
|
-
# SomeNamespace::AModel,
|
|
28
|
-
# SomeNamespace::AnotherModel
|
|
29
|
-
# )
|
|
30
41
|
# end
|
data/lib/exo/engine.rb
CHANGED
data/lib/exo/regexp.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
class Exo
|
|
2
|
+
module Regexp
|
|
3
|
+
HOST = /\A([a-z0-9-]+\.)*[a-z0-9-]+\.[a-z]{2,4}\z/
|
|
4
|
+
REL_PATH = /\A[a-z0-9_]+(\/[a-z0-9_]+)*\z/
|
|
5
|
+
ABSOLUTE_PATH = /\A\/([a-z0-9_]+\/)*([a-z0-9_]+(\.[a-z0-9_]+)?)?\z/
|
|
6
|
+
ROUTING_PATH = /\A\/((:|\*)?[a-z0-9_]+\/)*((:|\*)?[a-z0-9_]+(\.[a-z0-9_]+)?)?\z/
|
|
7
|
+
end
|
|
6
8
|
end
|
data/lib/exo/version.rb
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
class Exo
|
|
2
|
+
module Generators
|
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
|
5
|
+
|
|
6
|
+
desc "This generator add exo gem to your Gemfile, mount the engine and add an initializer"
|
|
7
|
+
def install
|
|
8
|
+
File.open(File.join(self.class.source_root, 'gems.rb'), 'r') do |f|
|
|
9
|
+
append_file 'Gemfile', f.read
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
template "initializer.rb", "config/initializers/exo.rb"
|
|
13
|
+
|
|
14
|
+
File.open(File.join(self.class.source_root, 'engine_routes.rb'), 'r') do |f|
|
|
15
|
+
route f.read
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|