exo_cms 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +3 -5
  3. data/app/controllers/concerns/exo/admin/{site_slug_id_filter.rb → site_restriction.rb} +3 -3
  4. data/app/controllers/concerns/exo/host_restriction.rb +32 -0
  5. data/app/controllers/concerns/exo/{route_filter.rb → request_restriction.rb} +8 -6
  6. data/app/controllers/exo/admin/assets_controller.rb +4 -4
  7. data/app/controllers/exo/admin/ckeditor_assets_controller.rb +2 -2
  8. data/app/controllers/exo/admin/ckeditor_blocks_controller.rb +3 -3
  9. data/app/controllers/exo/admin/contributors_controller.rb +2 -2
  10. data/app/controllers/exo/admin/items_controller.rb +3 -3
  11. data/app/controllers/exo/admin/pages_controller.rb +2 -2
  12. data/app/controllers/exo/admin/resources_controller.rb +2 -2
  13. data/app/controllers/exo/admin/routes_controller.rb +2 -2
  14. data/app/controllers/exo/admin/sessions_controller.rb +2 -0
  15. data/app/controllers/exo/admin/settings_controller.rb +5 -5
  16. data/app/controllers/exo/admin/site_controller.rb +1 -1
  17. data/app/controllers/exo/{admin/application_controller.rb → admin_controller.rb} +3 -3
  18. data/app/controllers/exo/gridfs_controller.rb +3 -3
  19. data/app/controllers/exo/pages_controller.rb +8 -9
  20. data/app/controllers/exo_controller.rb +4 -0
  21. data/app/helpers/exo/block_helper.rb +1 -1
  22. data/app/helpers/exo/resources_helper.rb +1 -1
  23. data/app/models/exo/app_service.rb +3 -0
  24. data/app/models/exo/block.rb +9 -11
  25. data/app/presenters/exo/item_decorator.rb +23 -0
  26. data/app/presenters/exo/resource_decorator.rb +21 -0
  27. data/app/presenters/exo/route_decorator.rb +23 -0
  28. data/app/presenters/exo/site_decorator.rb +25 -0
  29. data/app/resources/templates/application.html.haml +3 -3
  30. data/app/services/exo/config.rb +2 -0
  31. data/app/services/exo/router.rb +33 -0
  32. data/app/views/exo/admin/{application/_bheader.html.haml → _bheader.html.haml} +0 -0
  33. data/app/views/exo/admin/{application/_editor_header.html.haml → _editor_header.html.haml} +0 -0
  34. data/app/views/exo/admin/{application/_header.html.haml → _header.html.haml} +2 -2
  35. data/app/views/exo/admin/{application/_meta_errors.html.haml → _meta_errors.html.haml} +0 -0
  36. data/app/views/exo/admin/{application/_sidebar.html.haml → _sidebar.html.haml} +0 -0
  37. data/app/views/exo/admin/{application/_sidenav.html.haml → _sidenav.html.haml} +23 -17
  38. data/app/views/exo/admin/contributors/index.html.haml +1 -1
  39. data/app/views/exo/admin/{application/fields → fields}/_image.html.haml +0 -0
  40. data/app/views/exo/admin/{application/fields → fields}/_markdown.html.haml +0 -0
  41. data/app/views/exo/admin/items/show.html.haml +3 -3
  42. data/app/views/exo/admin/resources/index.html.haml +1 -1
  43. data/app/views/exo/admin/routes/index.html.haml +1 -1
  44. data/app/views/exo/admin/routes/show.html.haml +1 -1
  45. data/app/views/layouts/{application.html.erb → application.html.erb.tmp} +0 -0
  46. data/app/views/layouts/exo/admin/application.html.haml +1 -1
  47. data/app/views/layouts/exo/admin/editor.html.haml +2 -2
  48. data/config/initializers/devise.rb +27 -19
  49. data/config/routes.rb +1 -0
  50. data/lib/exo.rb +18 -7
  51. data/lib/exo/engine.rb +0 -2
  52. data/lib/exo/regexp.rb +7 -5
  53. data/lib/exo/version.rb +1 -1
  54. data/lib/generators/exo/install_generator.rb +20 -0
  55. data/lib/generators/exo/templates/engine_routes.rb +2 -0
  56. data/lib/generators/exo/templates/gems.rb +5 -0
  57. data/lib/generators/exo/templates/initializer.rb +5 -0
  58. data/spec/dummy/app/controllers/exo/admin/customs_controller.rb +1 -1
  59. data/spec/dummy/app/controllers/my_app/site_customs_controller.rb +1 -1
  60. data/spec/dummy/app/views/{a_sierra_theme → an_exo_theme}/a_page.html.haml +0 -0
  61. data/spec/dummy/app/views/an_exo_theme/a_page_with_block.html.haml +3 -0
  62. data/spec/dummy/app/views/layouts/{a_sierra_theme → an_exo_theme}/application.html.erb +0 -0
  63. data/spec/dummy/app/views/layouts/demo/application.html.haml +3 -3
  64. data/spec/dummy/config/application.rb +2 -1
  65. data/spec/dummy/config/initializers/exo.rb +2 -0
  66. data/spec/dummy/log/development.log +1938 -1
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/03bec07d16adc41979a9767aaf23a5bf +0 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/05d652e83e6b6823771fca143eabff87 +0 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/063d6d3a982ac3bfa05750bd3d01416e +0 -0
  70. data/spec/dummy/tmp/cache/assets/development/sprockets/0b8cbd6c43ff11ed3ab96976a2e98e2b +0 -0
  71. data/spec/dummy/tmp/cache/assets/development/sprockets/0c48f6c7a09d069017a22749c940fd6a +0 -0
  72. data/spec/dummy/tmp/cache/assets/development/sprockets/0da0612d0055abcde88349af8cbdaffc +0 -0
  73. data/spec/dummy/tmp/cache/assets/development/sprockets/0e1b30ba4880626e3c136ff23d15f277 +0 -0
  74. data/spec/dummy/tmp/cache/assets/development/sprockets/0f621a895f3d0916a756a8c7313c7120 +0 -0
  75. data/spec/dummy/tmp/cache/assets/development/sprockets/18fedf436371d2979b37a490e2cbcacf +0 -0
  76. data/spec/dummy/tmp/cache/assets/development/sprockets/1f93865a20acec72a1870a7f9d348cc0 +0 -0
  77. data/spec/dummy/tmp/cache/assets/development/sprockets/219ff56291853001c0fe482a28484813 +0 -0
  78. data/spec/dummy/tmp/cache/assets/development/sprockets/224aace438e22fd51b5b2b6a45a4d69f +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sprockets/24d0fbc91349d4114a1eefbe058c8fba +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sprockets/2a6027bbfa613448003ab80bfc3249f2 +0 -0
  81. data/spec/dummy/tmp/cache/assets/development/sprockets/2c71b158948039606eb85485d93ed206 +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sprockets/3360fbdb00ed8ef59706becb7dbb41e4 +0 -0
  83. data/spec/dummy/tmp/cache/assets/development/sprockets/34f82b1703cb8350ca18f16392967779 +0 -0
  84. data/spec/dummy/tmp/cache/assets/development/sprockets/3b300b301493f1baf5d9dc2969701185 +0 -0
  85. data/spec/dummy/tmp/cache/assets/development/sprockets/3d2b5b35fe7888d5139899d2e067d2ce +0 -0
  86. data/spec/dummy/tmp/cache/assets/development/sprockets/3dfa6cb0540572b6362a1d5e6a1f6d26 +0 -0
  87. data/spec/dummy/tmp/cache/assets/development/sprockets/412b23d9dc12a05a414cae1e5a3fbbf8 +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sprockets/41acdde13a0132b81cbc4951661048cb +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sprockets/41d37ff244c3daef0583214fbef2c560 +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sprockets/48c744a9d1e3e5b052f995545823c315 +0 -0
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/497a85ce66b5ead32a647661d0bada21 +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/4a5a6e9cf9074d00b627b83cf85c62f9 +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/4cd21bd7ac15013e918411a6001c4472 +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/576d1d5819328f9c5e52bbec45cb991e +0 -0
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/6089ad88fceb548141d376101c88bc94 +0 -0
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/667b895b188f4435053278e2497ac7b9 +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/6df5499acca0edd86677d5beec5c2b18 +0 -0
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/716d07423ee379b258338cb932e39d25 +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/717887cd48fa79a99d0c71e392750d58 +0 -0
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/727bcd360e44edbb990ea53347896a64 +0 -0
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/73f77b33ce0f17becb6e75ff1082c43e +0 -0
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/741b8483fbcabf9c321f7db58e78c3d8 +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/759a59934e8cb39ace939db6b3ca6c1a +0 -0
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/76d85daa1c4000f529bf26504ebde8d9 +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/7888c5b61b2cd04d7ee4cf78ab510eb5 +0 -0
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/797b3e33d6e04a512949c083da9c8819 +0 -0
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/7ccfc79620770d38c5bd539c16fca755 +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/7eee5343ea643e8ac6dfa9282bbc4547 +0 -0
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/7ef0c015d0ad290b8ffcd526afb67834 +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/85556c6543bc5bde199eee0c8096d83e +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/86d06f76cdbdc83c9621c928d42fa346 +0 -0
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/8bb68b74b9c6d04b2172ef5589d5b1a5 +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/905ad43b3fc55108ad345c6255ddcfb8 +0 -0
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/9a65689623c3096b82dd97819ef02b79 +0 -0
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/9b1352fb7f42bed64bf100b191511e0d +0 -0
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/a7244c34cc0ff696fbfe2fccb04cb04b +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/b162acd8d30fdf3dd12192251e427c66 +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/b30e4385f999fefded784baa3436ecd3 +0 -0
  119. data/spec/dummy/tmp/cache/assets/development/sprockets/b9df96c25252b82da00791df6d017199 +0 -0
  120. data/spec/dummy/tmp/cache/assets/development/sprockets/ba27cf3baf39fb89f47836875af24dd8 +0 -0
  121. data/spec/dummy/tmp/cache/assets/development/sprockets/c02127f4958e88d15dad1754931334aa +0 -0
  122. data/spec/dummy/tmp/cache/assets/development/sprockets/ca6ae3b0212906e203a675ad02a7729e +0 -0
  123. data/spec/dummy/tmp/cache/assets/development/sprockets/cb679ef7ff0235de4855aa5ee7c4fb27 +0 -0
  124. data/spec/dummy/tmp/cache/assets/development/sprockets/cb9e847b58fe12c042e8e608905c4c38 +0 -0
  125. data/spec/dummy/tmp/cache/assets/development/sprockets/db9141fa82b703a2439a562438fc6f04 +0 -0
  126. data/spec/dummy/tmp/cache/assets/development/sprockets/e3efb6f18e9d6f7f1f7a2bfdb4a616d3 +0 -0
  127. data/spec/dummy/tmp/cache/assets/development/sprockets/e5182eea228cd4e352dc35de5b86d387 +0 -0
  128. data/spec/dummy/tmp/cache/assets/development/sprockets/f20c3ba49438960a7f1184ec1aece636 +0 -0
  129. data/spec/dummy/tmp/cache/assets/development/sprockets/f3c6a93068f488ad8f54bf72f206fa3b +0 -0
  130. data/spec/dummy/tmp/cache/assets/development/sprockets/f952832de9d68bc78aae760f4d85d675 +0 -0
  131. data/spec/dummy/tmp/cache/assets/development/sprockets/fca2562e4bd00a9aaf122c2a9e76eea5 +0 -0
  132. data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/colorize.sassc +0 -0
  133. data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/content.sassc +0 -0
  134. data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/header.sassc +0 -0
  135. data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/sidebar.sassc +0 -0
  136. data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/tables.sassc +0 -0
  137. data/spec/dummy/tmp/cache/assets/test/sass/1117950fc1adf8b31294376d9067eb7feadc7de0/wrapper.sassc +0 -0
  138. data/spec/dummy/tmp/cache/assets/test/sass/238d7e2ec3d3030371e96efa23f1677a0a064045/_functions.scssc +0 -0
  139. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_accordion.scssc +0 -0
  140. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_alert-boxes.scssc +0 -0
  141. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_block-grid.scssc +0 -0
  142. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_breadcrumbs.scssc +0 -0
  143. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_button-groups.scssc +0 -0
  144. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_buttons.scssc +0 -0
  145. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_clearing.scssc +0 -0
  146. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_dropdown-buttons.scssc +0 -0
  147. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_dropdown.scssc +0 -0
  148. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_flex-video.scssc +0 -0
  149. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_forms.scssc +0 -0
  150. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_global.scssc +0 -0
  151. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_grid.scssc +0 -0
  152. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_inline-lists.scssc +0 -0
  153. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_joyride.scssc +0 -0
  154. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_keystrokes.scssc +0 -0
  155. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_labels.scssc +0 -0
  156. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_magellan.scssc +0 -0
  157. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_offcanvas.scssc +0 -0
  158. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_orbit.scssc +0 -0
  159. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_pagination.scssc +0 -0
  160. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_panels.scssc +0 -0
  161. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_pricing-tables.scssc +0 -0
  162. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_progress-bars.scssc +0 -0
  163. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_reveal.scssc +0 -0
  164. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_side-nav.scssc +0 -0
  165. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_split-buttons.scssc +0 -0
  166. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_sub-nav.scssc +0 -0
  167. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_switch.scssc +0 -0
  168. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_tables.scssc +0 -0
  169. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_tabs.scssc +0 -0
  170. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_thumbs.scssc +0 -0
  171. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_tooltips.scssc +0 -0
  172. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_top-bar.scssc +0 -0
  173. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_type.scssc +0 -0
  174. data/spec/dummy/tmp/cache/assets/test/sass/277777414a383c3fe6a5a46b95c6fecc44307daf/_visibility.scssc +0 -0
  175. data/spec/dummy/tmp/cache/assets/test/sass/54bc91a8b995104fa44ba264c53dbd8d0a6ce1eb/font-awesome.css.erbc +0 -0
  176. data/spec/dummy/tmp/cache/assets/test/sass/689cee5da0d308518a9400df205830efb3b2004b/foundation.scssc +0 -0
  177. data/spec/dummy/tmp/cache/assets/test/sass/868bdcd3c8e6bd73d750879e972f235f451b00af/application.sassc +0 -0
  178. data/spec/dummy/tmp/cache/assets/test/sass/868bdcd3c8e6bd73d750879e972f235f451b00af/foundation_and_overrides.scssc +0 -0
  179. data/spec/dummy/tmp/cache/assets/test/sass/868bdcd3c8e6bd73d750879e972f235f451b00af/responsive-tables.cssc +0 -0
  180. data/spec/dummy/tmp/cache/assets/test/sprockets/05d652e83e6b6823771fca143eabff87 +0 -0
  181. data/spec/dummy/tmp/cache/assets/test/sprockets/063d6d3a982ac3bfa05750bd3d01416e +0 -0
  182. data/spec/dummy/tmp/cache/assets/test/sprockets/0b8cbd6c43ff11ed3ab96976a2e98e2b +0 -0
  183. data/spec/dummy/tmp/cache/assets/test/sprockets/0da0612d0055abcde88349af8cbdaffc +0 -0
  184. data/spec/dummy/tmp/cache/assets/test/sprockets/0e1b30ba4880626e3c136ff23d15f277 +0 -0
  185. data/spec/dummy/tmp/cache/assets/test/sprockets/0f621a895f3d0916a756a8c7313c7120 +0 -0
  186. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  187. data/spec/dummy/tmp/cache/assets/test/sprockets/1f93865a20acec72a1870a7f9d348cc0 +0 -0
  188. data/spec/dummy/tmp/cache/assets/test/sprockets/224aace438e22fd51b5b2b6a45a4d69f +0 -0
  189. data/spec/dummy/tmp/cache/assets/test/sprockets/2a6027bbfa613448003ab80bfc3249f2 +0 -0
  190. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  191. data/spec/dummy/tmp/cache/assets/test/sprockets/3360fbdb00ed8ef59706becb7dbb41e4 +0 -0
  192. data/spec/dummy/tmp/cache/assets/test/sprockets/34f82b1703cb8350ca18f16392967779 +0 -0
  193. data/spec/dummy/tmp/cache/assets/test/sprockets/3d2b5b35fe7888d5139899d2e067d2ce +0 -0
  194. data/spec/dummy/tmp/cache/assets/test/sprockets/412b23d9dc12a05a414cae1e5a3fbbf8 +0 -0
  195. data/spec/dummy/tmp/cache/assets/test/sprockets/41d37ff244c3daef0583214fbef2c560 +0 -0
  196. data/spec/dummy/tmp/cache/assets/test/sprockets/447161da5ee42f4d3b0702a328975499 +0 -0
  197. data/spec/dummy/tmp/cache/assets/test/sprockets/4a5a6e9cf9074d00b627b83cf85c62f9 +0 -0
  198. data/spec/dummy/tmp/cache/assets/test/sprockets/4cd21bd7ac15013e918411a6001c4472 +0 -0
  199. data/spec/dummy/tmp/cache/assets/test/sprockets/576d1d5819328f9c5e52bbec45cb991e +0 -0
  200. data/spec/dummy/tmp/cache/assets/test/sprockets/5e9e6e4b1c4bb6da2f89517e17fdca8b +0 -0
  201. data/spec/dummy/tmp/cache/assets/test/sprockets/6089ad88fceb548141d376101c88bc94 +0 -0
  202. data/spec/dummy/tmp/cache/assets/test/sprockets/6df5499acca0edd86677d5beec5c2b18 +0 -0
  203. data/spec/dummy/tmp/cache/assets/test/sprockets/717887cd48fa79a99d0c71e392750d58 +0 -0
  204. data/spec/dummy/tmp/cache/assets/test/sprockets/73f77b33ce0f17becb6e75ff1082c43e +0 -0
  205. data/spec/dummy/tmp/cache/assets/test/sprockets/741b8483fbcabf9c321f7db58e78c3d8 +0 -0
  206. data/spec/dummy/tmp/cache/assets/test/sprockets/759a59934e8cb39ace939db6b3ca6c1a +0 -0
  207. data/spec/dummy/tmp/cache/assets/test/sprockets/76d85daa1c4000f529bf26504ebde8d9 +0 -0
  208. data/spec/dummy/tmp/cache/assets/test/sprockets/7888c5b61b2cd04d7ee4cf78ab510eb5 +0 -0
  209. data/spec/dummy/tmp/cache/assets/test/sprockets/7eee5343ea643e8ac6dfa9282bbc4547 +0 -0
  210. data/spec/dummy/tmp/cache/assets/test/sprockets/7ef0c015d0ad290b8ffcd526afb67834 +0 -0
  211. data/spec/dummy/tmp/cache/assets/test/sprockets/85556c6543bc5bde199eee0c8096d83e +0 -0
  212. data/spec/dummy/tmp/cache/assets/test/sprockets/86d06f76cdbdc83c9621c928d42fa346 +0 -0
  213. data/spec/dummy/tmp/cache/assets/test/sprockets/905ad43b3fc55108ad345c6255ddcfb8 +0 -0
  214. data/spec/dummy/tmp/cache/assets/test/sprockets/9a65689623c3096b82dd97819ef02b79 +0 -0
  215. data/spec/dummy/tmp/cache/assets/test/sprockets/a7244c34cc0ff696fbfe2fccb04cb04b +0 -0
  216. data/spec/dummy/tmp/cache/assets/test/sprockets/b30e4385f999fefded784baa3436ecd3 +0 -0
  217. data/spec/dummy/tmp/cache/assets/test/sprockets/b9df96c25252b82da00791df6d017199 +0 -0
  218. data/spec/dummy/tmp/cache/assets/test/sprockets/ba27cf3baf39fb89f47836875af24dd8 +0 -0
  219. data/spec/dummy/tmp/cache/assets/test/sprockets/c02127f4958e88d15dad1754931334aa +0 -0
  220. data/spec/dummy/tmp/cache/assets/test/sprockets/ca6ae3b0212906e203a675ad02a7729e +0 -0
  221. data/spec/dummy/tmp/cache/assets/test/sprockets/cb679ef7ff0235de4855aa5ee7c4fb27 +0 -0
  222. data/spec/dummy/tmp/cache/assets/test/sprockets/cb9e847b58fe12c042e8e608905c4c38 +0 -0
  223. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  224. data/spec/dummy/tmp/cache/assets/test/sprockets/db9141fa82b703a2439a562438fc6f04 +0 -0
  225. data/spec/dummy/tmp/cache/assets/test/sprockets/e3efb6f18e9d6f7f1f7a2bfdb4a616d3 +0 -0
  226. data/spec/dummy/tmp/cache/assets/test/sprockets/e5182eea228cd4e352dc35de5b86d387 +0 -0
  227. data/spec/dummy/tmp/cache/assets/test/sprockets/f20c3ba49438960a7f1184ec1aece636 +0 -0
  228. data/spec/dummy/tmp/cache/assets/test/sprockets/f3c6a93068f488ad8f54bf72f206fa3b +0 -0
  229. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  230. data/spec/dummy/tmp/cache/assets/test/sprockets/f94211d95775b7b113ff83fbab9d96e5 +0 -0
  231. data/spec/dummy/tmp/cache/assets/test/sprockets/f952832de9d68bc78aae760f4d85d675 +0 -0
  232. data/spec/dummy/tmp/cache/assets/test/sprockets/fca2562e4bd00a9aaf122c2a9e76eea5 +0 -0
  233. data/spec/features/admin/routes/details_spec.rb +1 -1
  234. data/spec/features/front/page_blocks/defined_spec.rb +1 -1
  235. data/spec/features/front/page_blocks/undefined_spec.rb +1 -1
  236. data/spec/features/front/routes/page_spec.rb +1 -1
  237. data/spec/generators/exo/install_generator_spec.rb +41 -0
  238. data/spec/models/{sierra → exo}/contributor_spec.rb +0 -0
  239. data/spec/models/{sierra → exo}/site_spec.rb +0 -0
  240. data/spec/spec_helper.rb +8 -2
  241. data/spec/support/factories/block_factory.rb +1 -1
  242. data/spec/templates/fake_routes.rb +3 -0
  243. metadata +303 -360
  244. data/app/controllers/concerns/exo/host_filter.rb +0 -22
  245. data/app/controllers/exo/application_controller.rb +0 -6
  246. data/app/presenters/exo/item_presenter.rb +0 -19
  247. data/app/presenters/exo/resource_presenter.rb +0 -25
  248. data/app/presenters/exo/route_presenter.rb +0 -33
  249. data/app/presenters/exo/site_presenter.rb +0 -35
  250. data/app/services/exo/tick.rb +0 -36
  251. data/spec/dummy/app/views/a_sierra_theme/a_page_with_block.html.haml +0 -3
  252. data/spec/dummy/tmp/pids/server.pid +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25fd006f9306db4a605eecad94ba1187c987b908
4
- data.tar.gz: cf32bd802e57fc69b405972cdf1a6b4e1ea14cc3
3
+ metadata.gz: 47bc2bfafd7fb198d45ac0f39b22ca0999099183
4
+ data.tar.gz: 69e43b06a5f9106e252f6f12eed0799d8f3d5c50
5
5
  SHA512:
6
- metadata.gz: 91462fc95b11b40114065435eebf4eaa4ec76000ac46135516c7269fecbe14a12b8bf3db3efda20e12956d8af45dc99ba6df5c6e1dbd0beab514c40c6b68c99c
7
- data.tar.gz: 581aa1aa494c4ade6f38c0d48959bdb01efe656b2f104837d5000b3b998c9dae4669d0e27a4df6c7268701a2ab793c5fa27558e50292069cbf7ac2e6c64c32ef
6
+ metadata.gz: 00728e26ddd82deacd6aac4e0d6784209c56cb35af5c9250396661d71c20b7937e1b0e79d8b6c730ea0e08007c08a85320d7989f5740932ef94988a103223f37
7
+ data.tar.gz: cda6363e2f76ea2109c91817bfc340d77dc900e8e84cf7ec72a68a760f98353d1cabda7f78e3ad439f13fa7cc79de72c7bbacd1d2e06c19071f2718d70fcf124
data/Rakefile CHANGED
@@ -14,19 +14,17 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
18
  load 'rails/tasks/engine.rake'
19
19
 
20
-
21
-
22
20
  Bundler::GemHelper.install_tasks
23
21
 
24
22
  require 'rake/testtask'
25
23
 
26
24
  Rake::TestTask.new(:test) do |t|
27
25
  t.libs << 'lib'
28
- t.libs << 'test'
29
- t.pattern = 'test/**/*_test.rb'
26
+ t.libs << 'spec'
27
+ t.pattern = 'spec/**/*_spec.rb'
30
28
  t.verbose = false
31
29
  end
32
30
 
@@ -1,13 +1,13 @@
1
1
  module Exo::Admin
2
- module SiteSlugIdFilter
2
+ module SiteRestriction
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- include ::Exo::HostFilter
6
+ include ::Exo::HostRestriction
7
7
  extend ClassMethods
8
8
 
9
9
  before_filter do
10
- redirect_to exo.admin_root_url unless allowed_sites.include? tick.site.slug_id
10
+ redirect_to exo.admin_root_url unless allowed_sites.include? exo_site.slug_id
11
11
  end
12
12
  end
13
13
 
@@ -0,0 +1,32 @@
1
+ class Exo
2
+ module HostRestriction
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ before_filter :exo_host_acceptance!
7
+ before_filter :exo_host_redirection!
8
+
9
+ expose(:exo_site) { exo_router.site }
10
+
11
+ rescue_from ::Exo::Site::UnknowHostError do |e|
12
+ render e, status: 503
13
+ end
14
+ end
15
+
16
+ protected
17
+ def exo_router
18
+ @exo_router
19
+ end
20
+
21
+ def exo_host_acceptance!
22
+ @exo_router = Router.for_host! request.host
23
+ end
24
+
25
+ def exo_host_redirection!
26
+ if exo_router.domain_redirection?(request.host)
27
+ redirect_to exo_router.host_url(request.path)
28
+ end
29
+ end
30
+ end
31
+ end
32
+
@@ -1,18 +1,20 @@
1
1
  class Exo
2
- module RouteFilter
2
+ module RequestRestriction
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- before_filter :route_ticking!
7
-
6
+ before_filter :exo_request_routing!
7
+
8
+ expose(:exo_route) { exo_router.route }
9
+
8
10
  rescue_from Exo::Route::UnknowPathError do |e|
9
11
  render e, status: 404
10
12
  end
11
13
  end
12
-
14
+
13
15
  protected
14
- def route_ticking!
15
- tick.route! request
16
+ def exo_request_routing!
17
+ exo_router.for_request! request
16
18
  end
17
19
  end
18
20
  end
@@ -1,17 +1,17 @@
1
1
  module Exo::Admin
2
- class AssetsController < ApplicationController
2
+ class AssetsController < Exo::AdminController
3
3
  MODEL = Exo::Asset
4
- expose(:assets) { current_site.slug_scope(MODEL).asc(:created_at) }
4
+ expose(:assets) { exo_site.slug_scope(MODEL).asc(:created_at) }
5
5
  expose(:current_asset) do
6
6
  if [:new, :create].include? params[:action].to_sym
7
7
  MODEL.new asset_params
8
8
  else
9
- current_site.slug_scope(MODEL).find params[:id]
9
+ exo_site.slug_scope(MODEL).find params[:id]
10
10
  end
11
11
  end
12
12
 
13
13
  def create
14
- current_asset.site = current_site
14
+ current_asset.site = exo_site
15
15
  #current_asset.content = params[:upload]
16
16
  if current_asset.save
17
17
  redirect_to admin_assets_url
@@ -1,5 +1,5 @@
1
1
  module Exo::Admin
2
- class CkeditorAssetsController < ApplicationController
2
+ class CkeditorAssetsController < Exo::AdminController
3
3
  skip_before_filter :verify_authenticity_token
4
4
  before_filter :expose_ckeditor_stuff
5
5
 
@@ -10,7 +10,7 @@ module Exo::Admin
10
10
  expose(:ckeditor_function_num) { params[:CKEditorFuncNum] }
11
11
  expose(:asset) do
12
12
  MODEL.new.tap do |a|
13
- a.site = current_site
13
+ a.site = exo_site
14
14
  a.content = params[:upload]
15
15
  end
16
16
  end
@@ -1,9 +1,9 @@
1
1
  module Exo::Admin
2
- class CkeditorBlocksController < ApplicationController
2
+ class CkeditorBlocksController < Exo::AdminController
3
3
  expose(:targeted_page) do
4
4
  _route = nil
5
- Exo::PathMatcher.route_for(current_site.routes, params) do |route|
6
- _route = Exo::RoutePresenter.new route
5
+ Exo::PathMatcher.route_for(exo_site.routes, params) do |route|
6
+ _route = Exo::RouteDecorator.new route
7
7
  end
8
8
  _route
9
9
  end
@@ -1,5 +1,5 @@
1
1
  module Exo::Admin
2
- class ContributorsController < ApplicationController
3
- expose(:contributor) { current_site.contributors.find params[:id] }
2
+ class ContributorsController < Exo::AdminController
3
+ expose(:contributor) { exo_site.contributors.find params[:id] }
4
4
  end
5
5
  end
@@ -1,8 +1,8 @@
1
1
  module Exo::Admin
2
- class ItemsController < Exo::Admin::ApplicationController
2
+ class ItemsController < Exo::AdminController
3
3
  MODEL = Exo::Resource::Item
4
4
 
5
- expose(:current_resource) { tick.site.site.resources.find params[:resource_id] }
5
+ expose(:current_resource) { exo_site.site.resources.find params[:resource_id] }
6
6
  expose(:current_item) do
7
7
  if [:new, :create].include? params[:action].to_sym
8
8
  MODEL.new item_params
@@ -12,7 +12,7 @@ module Exo::Admin
12
12
  end
13
13
 
14
14
  def create
15
- current_item.site = current_site
15
+ current_item.site = exo_site
16
16
  current_item.resource = current_resource
17
17
 
18
18
  update
@@ -1,10 +1,10 @@
1
1
  module Exo::Admin
2
- class PagesController < ::Exo::Admin::ApplicationController
2
+ class PagesController < Exo::AdminController
3
3
  REMOVAL_REGEXP = /\Ahttps?:\/\/([a-z0-9.-:]+)\//i
4
4
  expose(:mercury_path) do
5
5
  File.join '/', params[:url].gsub(REMOVAL_REGEXP, '')
6
6
  end
7
- expose(:current_page) { current_site.routes.find_by path: mercury_path }
7
+ expose(:current_page) { exo_site.routes.find_by path: mercury_path }
8
8
 
9
9
  def mercury_update
10
10
  params[:content].each do |slug, mercure|
@@ -1,5 +1,5 @@
1
1
  module Exo::Admin
2
- class ResourcesController < Exo::Admin::ApplicationController
3
- expose(:current_resource) { current_site.resources.find params[:id] }
2
+ class ResourcesController < Exo::AdminController
3
+ expose(:current_resource) { exo_site.resources.find params[:id] }
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  module Exo::Admin
2
- class RoutesController < Exo::Admin::ApplicationController
2
+ class RoutesController < Exo::AdminController
3
3
  expose(:current_route) do
4
- current_site.routes.find params[:id]
4
+ exo_site.routes.find params[:id]
5
5
  end
6
6
 
7
7
  def edit
@@ -1,4 +1,6 @@
1
1
  class Exo::Admin::SessionsController < Devise::SessionsController
2
+ layout 'devise'
3
+
2
4
  protected
3
5
  def after_sign_in_path_for(resource)
4
6
  '/admin'
@@ -1,5 +1,5 @@
1
1
  module Exo::Admin
2
- class SettingsController < Exo::Admin::ApplicationController
2
+ class SettingsController < Exo::AdminController
3
3
  skip_before_filter :verify_authenticity_token, only: :create
4
4
 
5
5
  MODEL = Exo::Setting
@@ -7,21 +7,21 @@ module Exo::Admin
7
7
  before_filter :current_route, if: :for_route?
8
8
  helper_method :for_route?
9
9
 
10
- expose(:settings) { current_site.settings }
10
+ expose(:settings) { exo_site.settings }
11
11
  expose(:current_setting) do
12
12
  if [:new, :create].include? params[:action].to_sym
13
13
  MODEL.new new_setting_params
14
14
  else
15
- parent = for_route? ? current_route : current_site
15
+ parent = for_route? ? current_route : exo_site
16
16
  parent.settings.find params[:id]
17
17
  end
18
18
  end
19
19
  expose(:current_route) do
20
- current_site.routes.find params[:route_id]
20
+ exo_site.routes.find params[:route_id]
21
21
  end
22
22
 
23
23
  def create
24
- current_setting.setting_container = for_route? ? current_route : current_site
24
+ current_setting.setting_container = for_route? ? current_route : exo_site
25
25
  if current_setting.save
26
26
  redirect_to_parent
27
27
  else
@@ -1,4 +1,4 @@
1
1
  module Exo::Admin
2
- class SiteController < Exo::Admin::ApplicationController
2
+ class SiteController < Exo::AdminController
3
3
  end
4
4
  end
@@ -1,8 +1,8 @@
1
- module Exo::Admin
2
- class ApplicationController < ::Exo::ApplicationController
1
+ class Exo
2
+ class AdminController < ExoController
3
3
  layout 'exo/admin/application'
4
+
4
5
  before_filter :authenticate_contributor!
5
- expose(:current_site) { tick.site.site }
6
6
 
7
7
  protected
8
8
  def allow_params key, fields
@@ -1,13 +1,13 @@
1
1
  class Exo
2
- class GridfsController < ApplicationController
2
+ class GridfsController < ExoController
3
3
  def item_asset
4
- item = tick.site.resource(params[:resource_slug_id]).items.find_by slug_id: params[:item_slug_id]
4
+ item = exo_site.resource(params[:resource_slug_id]).items.find_by slug_id: params[:item_slug_id]
5
5
  asset = item.send params[:field_slug_id].to_sym
6
6
  respond_with_asset asset
7
7
  end
8
8
 
9
9
  def asset
10
- asset = tick.site.slug_scope(Exo::Asset).find_by _id: params[:id]
10
+ asset = exo_site.slug_scope(Exo::Asset).find_by _id: params[:id]
11
11
  if asset
12
12
  respond_with_asset asset
13
13
  else
@@ -1,23 +1,22 @@
1
1
  class Exo
2
- class PagesController < ::Exo::ApplicationController
2
+ class PagesController < ExoController
3
3
  before_filter :fix_lookup_context
4
- include RouteFilter
4
+ include RequestRestriction
5
+ helper Exo::BlockHelper
5
6
 
6
7
  def serve_page
7
- if tick.route.redirection?
8
- redirect_to tick.route.to_url
8
+ if exo_router.route.redirection?
9
+ redirect_to exo_router.route.to_url
9
10
  else
10
- render tick.route.view_path, layout: tick.route.layout_path
11
+ render exo_router.route.view_path, layout: exo_router.route.layout_path
11
12
  end
12
13
  end
13
14
 
14
15
  protected
15
-
16
16
  def fix_lookup_context
17
- # /!\ this is evil
18
17
  lookup_context.prefixes = [
19
- tick.site.theme_path,
20
- tick.site.nest_path('application')
18
+ exo_site.theme_path,
19
+ exo_site.nest_path('application')
21
20
  ]
22
21
  end
23
22
  end
@@ -0,0 +1,4 @@
1
+ class ExoController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ include ::Exo::HostRestriction
4
+ end
@@ -4,7 +4,7 @@ module Exo::BlockHelper
4
4
  options['contenteditable'] = "true" if params[:preview]
5
5
  options[:id] = id
6
6
  options[:class] = "#{options[:class]} _block"
7
- block = tick.route.block id
7
+ block = exo_route.block_name(id)
8
8
 
9
9
  if block
10
10
  content_tag 'div', options do
@@ -46,7 +46,7 @@ module Exo::ResourcesHelper
46
46
  hash[:value] = value.form_value
47
47
  end
48
48
  when Exo::Resource::MetaRelation
49
- _resource = current_site.resource_name field.resource_slug_id
49
+ _resource = exo_site.resource_name field.resource_slug_id
50
50
  options[:selected] = item.value_for(field).form_value
51
51
  options[:include_blank] = false
52
52
  options[:collection] = _resource.items.asc(:name).collect {|i| [i.name, i.id.to_s]}
@@ -0,0 +1,3 @@
1
+ class Exo::AppService < Struct.new(:name, :path)
2
+
3
+ end
@@ -1,13 +1,11 @@
1
- class Exo
2
- class Block
3
- include Exo::Document
4
-
5
- embedded_in :page, class_name: 'Exo::Route::Page'
6
-
7
- field :slug_id
8
- field :content
1
+ class Exo::Block
2
+ include Exo::Document
3
+
4
+ embedded_in :page, class_name: 'Exo::Route::Page'
5
+
6
+ field :slug_id
7
+ field :content
9
8
 
10
- validates_presence_of :slug_id
11
- validates_presence_of :content
12
- end
9
+ validates_presence_of :slug_id
10
+ validates_presence_of :content
13
11
  end
@@ -0,0 +1,23 @@
1
+ class Exo
2
+ class ItemDecorator < Draper::Decorator
3
+ delegate_all
4
+
5
+ def decorated_resource
6
+ @decorated_resource ||= wrap_resource item.resource
7
+ end
8
+
9
+ alias :resource :decorated_resource
10
+
11
+ def method_missing method, *params, &block
12
+ if meta_field = resource.meta_field method
13
+ item.value_for meta_field
14
+ else
15
+ item.send method, *params, &block
16
+ end
17
+ end
18
+
19
+ def wrap_resource resource
20
+ ResourceDecorator.new resource if resource
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ class Exo
2
+ class ResourceDecorator < Draper::Decorator
3
+ delegate_all
4
+
5
+ def items
6
+ ScopeWraper.new resource.items, self
7
+ end
8
+
9
+ def item_name slug_id
10
+ wrap_item items.find_by(slug_id: slug_id)
11
+ end
12
+
13
+ def meta_field_name name
14
+ resource.meta_fields.where(slug_id: name.to_s).first
15
+ end
16
+
17
+ def wrap_item item
18
+ ItemDecorator.new item if item
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ class Exo
2
+ class RouteDecorator < Draper::Decorator
3
+ DEFAULT_LAYOUT = '/application'
4
+
5
+ delegate_all
6
+
7
+ def redirection?
8
+ object.class == Exo::Route::Redirection
9
+ end
10
+
11
+ def view_path
12
+ object.site.nest_path object.view_path
13
+ end
14
+
15
+ def layout_path
16
+ object.site.nest_path(object.layout_path || DEFAULT_LAYOUT)
17
+ end
18
+
19
+ def block_name slug_id
20
+ object.blocks.where(slug_id: slug_id.to_s).first
21
+ end
22
+ end
23
+ end