spontaneous 0.2.0.alpha2 → 0.2.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (404) hide show
  1. data/Gemfile +3 -40
  2. data/Rakefile +29 -41
  3. data/Readme.markdown +21 -8
  4. data/application/css/add_alias_dialogue.css.scss +79 -0
  5. data/application/css/{v2.scss → core.css.scss} +537 -550
  6. data/application/css/{definitions.scss → definitions.css.scss} +121 -33
  7. data/application/css/dialogue.css.scss +409 -0
  8. data/application/css/{editing.scss → editing.css.scss} +25 -262
  9. data/application/css/font.css.scss +8 -0
  10. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  11. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  12. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_flat_10_000000_40x100.png +0 -0
  13. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  14. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  15. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  16. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  17. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  18. data/application/css/jquery-ui-1.8.21.custom/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  19. data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_222222_256x240.png +0 -0
  20. data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_228ef1_256x240.png +0 -0
  21. data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_ef8c08_256x240.png +0 -0
  22. data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_ffd27a_256x240.png +0 -0
  23. data/application/css/jquery-ui-1.8.21.custom/images/ui-icons_ffffff_256x240.png +0 -0
  24. data/application/css/jquery-ui-1.8.21.custom/ui-lightness.css.scss +565 -0
  25. data/application/css/{login.scss → login.css.scss} +4 -4
  26. data/application/css/meta.css.scss +331 -0
  27. data/application/css/{popover.scss → popover.css.scss} +9 -8
  28. data/application/css/{schema_error.scss → schema_error.css.scss} +4 -4
  29. data/application/css/spontaneous.css +5 -0
  30. data/application/css/unsupported.css.scss +42 -0
  31. data/application/js/add_alias_dialogue.js +72 -10
  32. data/application/js/ajax.js +50 -16
  33. data/application/js/compatibility.js +19 -15
  34. data/application/js/content.js +39 -36
  35. data/application/js/content_area.js +53 -5
  36. data/application/js/dialogue.js +17 -0
  37. data/application/js/dom.js +1 -1
  38. data/application/js/edit_panel.js +23 -8
  39. data/application/js/extensions.js +7 -2
  40. data/application/js/field_preview.js +2 -1
  41. data/application/js/field_types/date_field.js +11 -8
  42. data/application/js/field_types/file_field.js +188 -9
  43. data/application/js/field_types/image_field.js +46 -29
  44. data/application/js/field_types/markdown_field.js +57 -14
  45. data/application/js/field_types/select_field.js +72 -0
  46. data/application/js/field_types/string_field.js +8 -0
  47. data/application/js/field_types/webvideo_field.js +8 -0
  48. data/application/js/init.js +1 -7
  49. data/application/js/location.js +41 -13
  50. data/application/js/login.js +3 -0
  51. data/application/js/meta_view/user_admin.js +543 -0
  52. data/application/js/meta_view.js +1 -0
  53. data/application/js/metadata.js +20 -0
  54. data/application/js/page.js +17 -3
  55. data/application/js/page_browser.js +40 -30
  56. data/application/js/page_entry.js +4 -0
  57. data/application/js/panel/root_menu.js +66 -0
  58. data/application/js/popover.js +2 -2
  59. data/application/js/preview.js +1 -1
  60. data/application/js/publish.js +138 -30
  61. data/application/js/services.js +43 -0
  62. data/application/js/sharded_upload.js +2 -2
  63. data/application/js/spontaneous.js +64 -5
  64. data/application/js/state.js +20 -9
  65. data/application/js/top_bar.js +273 -150
  66. data/application/js/types.js +20 -15
  67. data/application/js/upload.js +1 -2
  68. data/application/js/user.js +18 -4
  69. data/application/js/vendor/date.js +104 -0
  70. data/application/js/vendor/jquery-ui-1.8.18.custom.min.js +356 -0
  71. data/application/js/views/box_view.js +15 -8
  72. data/application/js/views/page_piece_view.js +11 -8
  73. data/application/js/views/page_view.js +21 -3
  74. data/application/js/views/piece_view.js +19 -10
  75. data/application/js/views.js +3 -0
  76. data/application/static/chromelogo-200x52-45c7cbc93be080bea342df5fcda2ef8b.png +0 -0
  77. data/application/static/dot-texture-9eea29e4ac7ad9a772285252078ec127.png +0 -0
  78. data/application/static/editing-textarea-resize-s-b5af62365eb7e19ea4beccf7242d508e.png +0 -0
  79. data/application/static/editing-texture-1-42b06a3439752490988f30f2a06d5e7c.png +0 -0
  80. data/application/static/font/fontawesome-webfont-5c5c21100a346972a82c34c5e96ffcfe.ttf +0 -0
  81. data/application/static/loop_alt1-white-7894b458528e92216196cae26b4c2c96.svg +12 -0
  82. data/application/static/spontaneous-states-e91ec89db525c62da0105b97cdd781ce.png +0 -0
  83. data/application/views/index.erb +2 -2
  84. data/application/views/login.erb +4 -8
  85. data/application/views/schema_modification_error.html.erb +1 -4
  86. data/application/views/unsupported.erb +9 -7
  87. data/bin/spot +1 -1
  88. data/db/migrations/20110209152710_users_and_groups.rb +10 -10
  89. data/db/migrations/20120305112647_site_modification_time.rb +11 -0
  90. data/db/migrations/20120418153903_add_ownership_of_content.rb +14 -0
  91. data/db/migrations/20120423175416_add_pending_modifications.rb +21 -0
  92. data/db/migrations/20120525164947_add_field_versions.rb +27 -0
  93. data/lib/sequel/plugins/scoped_table_name.rb +10 -1
  94. data/lib/spontaneous/asset/file.rb +25 -0
  95. data/lib/spontaneous/asset/source.rb +28 -0
  96. data/lib/spontaneous/asset.rb +75 -0
  97. data/lib/spontaneous/box.rb +6 -4
  98. data/lib/spontaneous/capistrano/deploy.rb +47 -0
  99. data/lib/spontaneous/capistrano/sync.rb +81 -0
  100. data/lib/spontaneous/capistrano.rb +13 -0
  101. data/lib/spontaneous/change.rb +60 -68
  102. data/lib/spontaneous/cli/assets.rb +29 -0
  103. data/lib/spontaneous/cli/base.rb +0 -48
  104. data/lib/spontaneous/cli/console.rb +1 -1
  105. data/lib/spontaneous/cli/server.rb +6 -4
  106. data/lib/spontaneous/cli/site.rb +28 -17
  107. data/lib/spontaneous/cli/user.rb +107 -0
  108. data/lib/spontaneous/cli.rb +100 -4
  109. data/lib/spontaneous/collections/entry_set.rb +2 -2
  110. data/lib/spontaneous/collections/field_set.rb +48 -22
  111. data/lib/spontaneous/collections/prototype_set.rb +20 -13
  112. data/lib/spontaneous/constants.rb +3 -0
  113. data/lib/spontaneous/content.rb +22 -5
  114. data/lib/spontaneous/errors.rb +3 -3
  115. data/lib/spontaneous/extensions/array.rb +12 -0
  116. data/lib/spontaneous/extensions/enumerable.rb +30 -0
  117. data/lib/spontaneous/extensions/nil.rb +3 -1
  118. data/lib/spontaneous/extensions/string.rb +16 -0
  119. data/lib/spontaneous/field_types/date_field.rb +45 -2
  120. data/lib/spontaneous/field_types/field.rb +42 -9
  121. data/lib/spontaneous/field_types/file_field.rb +68 -0
  122. data/lib/spontaneous/field_types/image_field.rb +63 -0
  123. data/lib/spontaneous/field_types/select_field.rb +109 -0
  124. data/lib/spontaneous/field_types/string_field.rb +6 -1
  125. data/lib/spontaneous/field_types/webvideo_field.rb +85 -27
  126. data/lib/spontaneous/field_types.rb +1 -1
  127. data/lib/spontaneous/field_version.rb +8 -0
  128. data/lib/spontaneous/generators/page.rb +1 -1
  129. data/lib/spontaneous/generators/site/Capfile.tt +1 -4
  130. data/lib/spontaneous/generators/site/Gemfile.tt +13 -6
  131. data/lib/spontaneous/generators/site/config/deploy.rb.tt +28 -0
  132. data/lib/spontaneous/generators/site/config/environments/production.rb.tt +7 -2
  133. data/lib/spontaneous/generators/site.rb +1 -0
  134. data/lib/spontaneous/json.rb +34 -11
  135. data/lib/spontaneous/layout.rb +22 -0
  136. data/lib/spontaneous/media/file.rb +4 -0
  137. data/lib/spontaneous/output/assets/compression.rb +58 -0
  138. data/lib/spontaneous/output/assets.rb +32 -0
  139. data/lib/spontaneous/output/context.rb +179 -0
  140. data/lib/spontaneous/output/format/html.rb +5 -0
  141. data/lib/spontaneous/output/format/plain.rb +5 -0
  142. data/lib/spontaneous/output/format.rb +180 -0
  143. data/lib/spontaneous/output/helpers/classes_helper.rb +18 -0
  144. data/lib/spontaneous/{render/helpers/html_helper.rb → output/helpers/conditional_comment_helper.rb} +3 -12
  145. data/lib/spontaneous/output/helpers/script_helper.rb +73 -0
  146. data/lib/spontaneous/output/helpers/stylesheet_helper.rb +61 -0
  147. data/lib/spontaneous/output/helpers.rb +28 -0
  148. data/lib/spontaneous/output/template/engine.rb +59 -0
  149. data/lib/spontaneous/output/template/renderer.rb +153 -0
  150. data/lib/spontaneous/output/template.rb +21 -0
  151. data/lib/spontaneous/output.rb +163 -0
  152. data/lib/spontaneous/page.rb +2 -1
  153. data/lib/spontaneous/paths.rb +6 -1
  154. data/lib/spontaneous/permissions/access_key.rb +5 -5
  155. data/lib/spontaneous/permissions/user.rb +81 -35
  156. data/lib/spontaneous/permissions/user_level.rb +26 -22
  157. data/lib/spontaneous/plugins/aliases.rb +76 -12
  158. data/lib/spontaneous/plugins/allowed_types.rb +60 -18
  159. data/lib/spontaneous/plugins/application/paths.rb +0 -28
  160. data/lib/spontaneous/plugins/application/system.rb +35 -0
  161. data/lib/spontaneous/plugins/boxes.rb +4 -0
  162. data/lib/spontaneous/plugins/content_groups.rb +16 -0
  163. data/lib/spontaneous/plugins/entries.rb +50 -30
  164. data/lib/spontaneous/plugins/fields.rb +15 -0
  165. data/lib/spontaneous/plugins/layouts.rb +8 -2
  166. data/lib/spontaneous/plugins/modifications.rb +228 -0
  167. data/lib/spontaneous/plugins/page/formats.rb +67 -42
  168. data/lib/spontaneous/plugins/page/request.rb +10 -0
  169. data/lib/spontaneous/plugins/page/site_timestamps.rb +28 -0
  170. data/lib/spontaneous/plugins/paths.rb +15 -3
  171. data/lib/spontaneous/plugins/publishing.rb +124 -45
  172. data/lib/spontaneous/plugins/render.rb +13 -8
  173. data/lib/spontaneous/plugins/schema_hierarchy.rb +18 -6
  174. data/lib/spontaneous/plugins/site/helpers.rb +53 -0
  175. data/lib/spontaneous/plugins/site/hooks.rb +50 -0
  176. data/lib/spontaneous/plugins/site/map.rb +1 -1
  177. data/lib/spontaneous/plugins/site/paths.rb +13 -0
  178. data/lib/spontaneous/plugins/site/publishing.rb +6 -2
  179. data/lib/spontaneous/plugins/site/{revisions.rb → state.rb} +5 -1
  180. data/lib/spontaneous/plugins/site/storage.rb +4 -0
  181. data/lib/spontaneous/plugins/site/url.rb +15 -0
  182. data/lib/spontaneous/plugins/site_map.rb +13 -3
  183. data/lib/spontaneous/plugins/styles.rb +5 -1
  184. data/lib/spontaneous/plugins/visibility.rb +39 -12
  185. data/lib/spontaneous/prototypes/box_prototype.rb +4 -0
  186. data/lib/spontaneous/prototypes/field_prototype.rb +15 -10
  187. data/lib/spontaneous/publishing/event_client.rb +46 -0
  188. data/lib/spontaneous/publishing/immediate.rb +81 -44
  189. data/lib/spontaneous/publishing/simultaneous.rb +23 -6
  190. data/lib/spontaneous/publishing.rb +4 -3
  191. data/lib/spontaneous/rack/around_back.rb +1 -5
  192. data/lib/spontaneous/rack/around_front.rb +4 -4
  193. data/lib/spontaneous/rack/around_preview.rb +4 -3
  194. data/lib/spontaneous/rack/assets.rb +81 -54
  195. data/lib/spontaneous/rack/authentication.rb +0 -1
  196. data/lib/spontaneous/rack/back.rb +160 -72
  197. data/lib/spontaneous/rack/cookie_authentication.rb +2 -2
  198. data/lib/spontaneous/rack/css.rb +18 -15
  199. data/lib/spontaneous/rack/event_source.rb +9 -21
  200. data/lib/spontaneous/rack/fiber_pool.rb +26 -0
  201. data/lib/spontaneous/rack/front.rb +12 -4
  202. data/lib/spontaneous/rack/helpers.rb +35 -13
  203. data/lib/spontaneous/rack/js.rb +41 -0
  204. data/lib/spontaneous/rack/public.rb +34 -44
  205. data/lib/spontaneous/rack/sse.rb +18 -0
  206. data/lib/spontaneous/rack/static.rb +3 -0
  207. data/lib/spontaneous/rack/user_admin.rb +100 -0
  208. data/lib/spontaneous/rack/user_helpers.rb +1 -1
  209. data/lib/spontaneous/rack.rb +6 -2
  210. data/lib/spontaneous/schema.rb +31 -4
  211. data/lib/spontaneous/search/index.rb +19 -3
  212. data/lib/spontaneous/search/results.rb +1 -1
  213. data/lib/spontaneous/sequel.rb +17 -0
  214. data/lib/spontaneous/site.rb +11 -4
  215. data/lib/spontaneous/state.rb +11 -0
  216. data/lib/spontaneous/storage/cloud.rb +4 -0
  217. data/lib/spontaneous/storage/local.rb +11 -0
  218. data/lib/spontaneous/style.rb +2 -2
  219. data/lib/spontaneous/tasks/database.rake +21 -22
  220. data/lib/spontaneous/utils/database/mysql_dumper.rb +4 -0
  221. data/lib/spontaneous/utils/database/postgres_dumper.rb +78 -0
  222. data/lib/spontaneous/utils/database.rb +6 -3
  223. data/lib/spontaneous/utils/smart_quotes.rb +499 -0
  224. data/lib/spontaneous/utils/smush_it.rb +66 -0
  225. data/lib/spontaneous/utils.rb +3 -1
  226. data/lib/spontaneous/version.rb +2 -2
  227. data/lib/spontaneous.rb +25 -29
  228. data/spontaneous.gemspec +186 -106
  229. data/test/experimental/test_features.rb +1 -1
  230. data/test/fixtures/asset_pipeline/application/css/basic.css.scss +4 -0
  231. data/test/fixtures/asset_pipeline/application/css/complex.css.scss.erb +6 -0
  232. data/test/fixtures/asset_pipeline/application/css/simple.css +3 -0
  233. data/test/fixtures/asset_pipeline/application/css/spontaneous.css +7 -0
  234. data/test/fixtures/asset_pipeline/application/css/subdir/complex.css.scss.erb +6 -0
  235. data/test/fixtures/asset_pipeline/application/css/subdir/library.css.scss +1 -0
  236. data/test/fixtures/asset_pipeline/application/css/subdir/simple.css +3 -0
  237. data/test/fixtures/asset_pipeline/application/js/basic.js.coffee +1 -0
  238. data/test/fixtures/asset_pipeline/application/js/complex.js.coffee.erb +1 -0
  239. data/test/fixtures/asset_pipeline/application/js/login.js +1 -0
  240. data/test/fixtures/asset_pipeline/application/js/require.js +1 -0
  241. data/test/fixtures/asset_pipeline/application/js/simple.js +1 -0
  242. data/test/fixtures/asset_pipeline/application/js/spontaneous.js +5 -0
  243. data/test/fixtures/asset_pipeline/application/js/subdir/complex.js.coffee.erb +1 -0
  244. data/test/fixtures/asset_pipeline/application/js/subdir/library.js.coffee +1 -0
  245. data/test/fixtures/asset_pipeline/application/js/subdir/simple.js +1 -0
  246. data/test/fixtures/asset_pipeline/application/js/vendor/jquery.js +1 -0
  247. data/test/fixtures/asset_pipeline/application/static/dot-texture.png +0 -0
  248. data/test/fixtures/asset_pipeline/application/static/subdir/px.gif +0 -0
  249. data/test/fixtures/assets/public1/css/a.scss +1 -0
  250. data/test/fixtures/assets/public1/js/a.js +1 -0
  251. data/test/fixtures/assets/public1/js/m.coffee +1 -0
  252. data/test/fixtures/assets/public2/css/b.scss +1 -0
  253. data/test/fixtures/assets/public2/css/c.css +1 -0
  254. data/test/fixtures/assets/public2/js/b.js +1 -0
  255. data/test/fixtures/assets/public2/js/c.js +1 -0
  256. data/test/fixtures/assets/public2/js/n.coffee +1 -0
  257. data/test/fixtures/back/config/user_levels.yml +3 -0
  258. data/test/fixtures/back/public/js/coffeescript.coffee +1 -0
  259. data/test/fixtures/back/templates/layouts/standard.css.cut +1 -0
  260. data/test/fixtures/back/templates/layouts/standard.js.cut +1 -0
  261. data/test/fixtures/example_application/config/database.yml +4 -4
  262. data/test/fixtures/helpers/templates/layouts/standard.html.cut +1 -0
  263. data/test/fixtures/helpers/templates/layouts/standard.mobile.cut +1 -0
  264. data/test/fixtures/images/vimlogo.pdf +0 -0
  265. data/test/fixtures/outputs/templates/layouts/standard.atom.cut +1 -0
  266. data/test/fixtures/permissions/config/user_levels.yml +6 -3
  267. data/test/fixtures/serialisation/class_hash.yaml.erb +1 -0
  268. data/test/fixtures/serialisation/root_hash.yaml.erb +2 -2
  269. data/test/fixtures/templates/extended/grandparent.html.cut +7 -7
  270. data/test/fixtures/templates/extended/main.html.cut +5 -5
  271. data/test/fixtures/templates/extended/parent.html.cut +8 -8
  272. data/test/fixtures/templates/extended/partial_with_locals.html.cut +1 -1
  273. data/test/fixtures/templates/extended/with_includes.html.cut +6 -6
  274. data/test/fixtures/templates/extended/with_includes_and_locals.html.cut +6 -7
  275. data/test/fixtures/templates/layouts/entries.html.cut +4 -4
  276. data/test/fixtures/templates/layouts/standard.html.cut +1 -0
  277. data/test/fixtures/templates/layouts/variables.html.cut +1 -1
  278. data/test/fixtures/templates/publishing/templates/layouts/static.html.cut +1 -1
  279. data/test/fixtures/templates/publishing/templates/layouts/static.rtf.cut +1 -0
  280. data/test/fixtures/templates/template_class/complex_template.html.cut +2 -2
  281. data/test/fixtures/templates/template_class/complex_template.pdf.cut +2 -2
  282. data/test/fixtures/templates/template_class/default_template_style.html.cut +1 -1
  283. data/test/fixtures/templates/template_class/images_with_template.html.cut +2 -2
  284. data/test/fixtures/templates/template_class/slots_template.html.cut +2 -2
  285. data/test/fixtures/templates/template_class/slots_template.pdf.cut +2 -2
  286. data/test/fixtures/user_manager/config/user_levels.yml +9 -0
  287. data/test/functional/test_application.rb +7 -7
  288. data/test/functional/test_back.rb +352 -97
  289. data/test/functional/test_front.rb +71 -20
  290. data/test/functional/test_user_manager.rb +284 -0
  291. data/test/javascript/env.js +13505 -0
  292. data/test/javascript/test_markdown.rb +43 -3
  293. data/test/support/custom_matchers.rb +3 -2
  294. data/test/test_helper.rb +50 -9
  295. data/test/test_javascript.rb +13 -13
  296. data/test/ui_helper.rb +1 -1
  297. data/test/unit/test_alias.rb +79 -8
  298. data/test/unit/test_asset_bundler.rb +220 -0
  299. data/test/unit/test_assets.rb +213 -0
  300. data/test/unit/test_async.rb +55 -0
  301. data/test/unit/test_authentication.rb +52 -39
  302. data/test/unit/test_boxes.rb +20 -15
  303. data/test/unit/test_changesets.rb +261 -0
  304. data/test/unit/test_content.rb +73 -33
  305. data/test/unit/test_content_inheritance.rb +18 -18
  306. data/test/unit/test_extensions.rb +26 -0
  307. data/test/unit/test_fields.rb +303 -16
  308. data/test/unit/test_formats.rb +267 -34
  309. data/test/unit/test_helpers.rb +79 -2
  310. data/test/unit/test_images.rb +10 -0
  311. data/test/unit/test_layouts.rb +21 -13
  312. data/test/unit/test_modifications.rb +648 -0
  313. data/test/unit/test_page.rb +6 -2
  314. data/test/unit/test_permissions.rb +101 -27
  315. data/test/unit/test_piece.rb +4 -4
  316. data/test/unit/test_plugins.rb +3 -2
  317. data/test/unit/test_publishing.rb +332 -0
  318. data/test/unit/test_render.rb +118 -67
  319. data/test/unit/test_revisions.rb +546 -0
  320. data/test/unit/test_schema.rb +83 -1
  321. data/test/unit/test_search.rb +59 -0
  322. data/test/unit/test_serialisation.rb +2 -47
  323. data/test/unit/test_site.rb +217 -108
  324. data/test/unit/test_storage.rb +26 -0
  325. data/test/unit/test_structure.rb +2 -2
  326. data/test/unit/test_styles.rb +90 -75
  327. data/test/unit/test_table_scoping.rb +21 -17
  328. data/test/unit/test_templates.rb +75 -69
  329. data/test/{slow → unit}/test_visibility.rb +78 -22
  330. metadata +528 -221
  331. data/application/css/add_alias_dialogue.scss +0 -27
  332. data/application/css/min/14c2a35812c443001b15d8b12a4780f88c678035.css +0 -1
  333. data/application/css/min/565d4c25e82148acb01c45c8d675b37a08676d77.css +0 -1
  334. data/application/css/min/84dbe894ea96eafd321c30823d630817bfc4b03b.css +0 -1
  335. data/application/css/spontaneous.scss +0 -111
  336. data/application/css/unsupported.scss +0 -16
  337. data/application/css/variables.scss +0 -80
  338. data/application/js/min/2a0c2962537a3181fedfff5c92596ba6d3122dc9.js +0 -3
  339. data/application/js/min/4cf1c493d3379ecba5287758c61238034c0893f9.js +0 -2
  340. data/application/js/min/78ac6b99d96750bb6b9f9aad4cb9cd91cd03f391.js +0 -3
  341. data/application/js/min/b8abf302a824c35385ff517b34111e1710ff3b37.js +0 -2
  342. data/application/js/min/c8efb9b9f7c3f6613fcebc6be60f605b6570a382.js +0 -90
  343. data/application/static/diagonal-texture.png +0 -0
  344. data/application/static/editing-0-noise.png +0 -0
  345. data/application/static/editing-1-noise.png +0 -0
  346. data/application/static/editing-texture-1.png +0 -0
  347. data/application/static/editing-texture.png +0 -0
  348. data/application/static/editing-toolbar-shadow-bottom.png +0 -0
  349. data/application/static/editing-toolbar-shadow-top.png +0 -0
  350. data/application/static/inner-glow.png +0 -0
  351. data/application/static/item-buttons-highlight.png +0 -0
  352. data/application/static/item-buttons.png +0 -0
  353. data/application/static/paper-texture-dark.png +0 -0
  354. data/application/static/plus_alt.svg +0 -8
  355. data/application/static/select-arrow-root.png +0 -0
  356. data/application/static/slot-up-arrow.png +0 -0
  357. data/application/static/spontaneous.png +0 -0
  358. data/lib/cutaneous/context_helper.rb +0 -187
  359. data/lib/cutaneous/preview_context.rb +0 -32
  360. data/lib/cutaneous/preview_renderer.rb +0 -10
  361. data/lib/cutaneous/publish_context.rb +0 -10
  362. data/lib/cutaneous/publish_renderer.rb +0 -14
  363. data/lib/cutaneous/publish_template.rb +0 -62
  364. data/lib/cutaneous/publish_token_parser.rb +0 -8
  365. data/lib/cutaneous/renderer.rb +0 -124
  366. data/lib/cutaneous/request_context.rb +0 -9
  367. data/lib/cutaneous/request_renderer.rb +0 -15
  368. data/lib/cutaneous/request_template.rb +0 -11
  369. data/lib/cutaneous/request_token_parser.rb +0 -9
  370. data/lib/cutaneous/token_parser.rb +0 -125
  371. data/lib/cutaneous.rb +0 -48
  372. data/lib/spontaneous/render/context_base.rb +0 -143
  373. data/lib/spontaneous/render/development_renderer.rb +0 -14
  374. data/lib/spontaneous/render/engine.rb +0 -19
  375. data/lib/spontaneous/render/format/html.rb +0 -5
  376. data/lib/spontaneous/render/format.rb +0 -75
  377. data/lib/spontaneous/render/helpers/script_helper.rb +0 -17
  378. data/lib/spontaneous/render/helpers/stylesheet_helper.rb +0 -16
  379. data/lib/spontaneous/render/helpers.rb +0 -14
  380. data/lib/spontaneous/render/preview_context.rb +0 -8
  381. data/lib/spontaneous/render/preview_renderer.rb +0 -24
  382. data/lib/spontaneous/render/publish_context.rb +0 -22
  383. data/lib/spontaneous/render/published_renderer.rb +0 -53
  384. data/lib/spontaneous/render/publishing_renderer.rb +0 -16
  385. data/lib/spontaneous/render/render_cache.rb +0 -26
  386. data/lib/spontaneous/render/renderer.rb +0 -50
  387. data/lib/spontaneous/render/request_context.rb +0 -8
  388. data/lib/spontaneous/render.rb +0 -214
  389. data/test/experimental/test_cutaneous.rb +0 -309
  390. data/test/fixtures/application/css/test.less +0 -5
  391. data/test/slow/test_publishing.rb +0 -1006
  392. /data/application/css/{developer.scss → developer.css.scss} +0 -0
  393. /data/application/js/vendor/{jquery-1.7.1.min.js → jquery.js} +0 -0
  394. /data/application/static/{location-arrow.png → location-arrow-c1c1d3ca472481c61a0a5f8cb289d743.png} +0 -0
  395. /data/application/static/{missing.png → missing-911ce6dbd9f4602e0f3fbcd7e78846a2.png} +0 -0
  396. /data/application/static/{orange-down-arrow.png → orange-down-arrow-395ae1929e8662b2ff0977daf12c35bb.png} +0 -0
  397. /data/application/static/{page-browser-next.png → page-browser-next-ce781a242c23b980b99b9db7abc20b05.png} +0 -0
  398. /data/application/static/{plus-box.png → plus-box-dcde74a1e496f68298c9b443caa1c5d5.png} +0 -0
  399. /data/application/static/{select-arrow.png → select-arrow-6e7dd3745b00e934b0d7a3250c46558b.png} +0 -0
  400. /data/application/static/{slot-down-arrow.png → slot-down-arrow-59ad5f5ee5b52a7ebd00bca4b3104194.png} +0 -0
  401. /data/application/static/{splash.png → splash-65b493a714df9b8b3ab170103401b53d.png} +0 -0
  402. /data/application/static/{spot.png → spot-71fab1d2f065034f5fc15e7bea2ad36c.png} +0 -0
  403. /data/application/static/{spot.svg → spot-8505041082d8d3bbe8d34c29dddb3b7d.svg} +0 -0
  404. /data/application/static/{texture.png → texture-03f7627e8264b1d607113ab32c593a58.png} +0 -0
@@ -1,13 +1,56 @@
1
1
  # encoding: UTF-8
2
2
 
3
-
4
3
  module Spontaneous
5
4
  module FieldTypes
6
5
  class DateField < Field
7
6
  include Spontaneous::Plugins::Field::EditorClass
7
+
8
+ DEFAULT_FORMAT = "%A, %-d %B, %Y"
9
+
10
+ def self.export(user)
11
+ super.merge({
12
+ :date_format => prototype.options[:format] || DEFAULT_FORMAT
13
+ })
14
+ end
15
+
16
+ def value(output = :html, *args)
17
+ return date if date.is_a?(String)
18
+ case output
19
+ when :html
20
+ date.strftime(html_format)
21
+ else
22
+ date.strftime(format)
23
+ end
24
+ end
25
+
26
+ def outputs
27
+ [:julian]
28
+ end
29
+
30
+ def preprocess(value)
31
+ return value if value.blank?
32
+ Date.parse(value)
33
+ end
34
+
35
+ def html_format
36
+ %(<time datetime="%Y-%m-%d">#{ format }</time>)
37
+ end
38
+
39
+ def generate_julian(date)
40
+ return date.jd if date.is_a?(Date)
41
+ date.to_s
42
+ end
43
+
44
+ def date
45
+ return "" if values[:julian].blank?
46
+ Date.jd values[:julian].to_i
47
+ end
48
+
49
+ def format
50
+ prototype.options[:format] || DEFAULT_FORMAT
51
+ end
8
52
  end
9
53
 
10
54
  DateField.register
11
55
  end
12
56
  end
13
-
@@ -25,13 +25,14 @@ module Spontaneous
25
25
  end
26
26
  end
27
27
  end
28
- # def self.prototype=(prototype)
29
- # @prototype = prototype
30
- # end
31
28
 
32
- # def self.prototype
33
- # @prototype
34
- # end
29
+ def self.prototype=(prototype)
30
+ @prototype = prototype
31
+ end
32
+
33
+ def self.prototype
34
+ @prototype
35
+ end
35
36
 
36
37
  def self.accepts
37
38
  %w(text/.+)
@@ -44,6 +45,12 @@ module Spontaneous
44
45
  end
45
46
 
46
47
 
48
+ # Provides the ability for specific field types to customize the schema values
49
+ # they return to the UI
50
+ def self.export(user)
51
+ {}
52
+ end
53
+
47
54
  attr_accessor :owner, :name, :unprocessed_value, :template_params, :version
48
55
  attr_reader :processed_values
49
56
 
@@ -57,7 +64,7 @@ module Spontaneous
57
64
 
58
65
 
59
66
  def outputs
60
- [:html]
67
+ [:html, :plain]
61
68
  end
62
69
 
63
70
  def unprocessed_value=(v)
@@ -228,11 +235,30 @@ module Spontaneous
228
235
  alias_method :empty?, :blank?
229
236
 
230
237
 
231
- def /(field)
238
+ def or(field)
232
239
  return field if self.blank?
233
240
  self
234
241
  end
235
- alias_method :'|', :/
242
+
243
+ alias_method :'/', :or
244
+ alias_method :'|', :or
245
+
246
+ def versions
247
+ owner.field_versions(self)
248
+ end
249
+
250
+ def previous_version
251
+ versions.first
252
+ end
253
+
254
+ def create_version
255
+ Spontaneous::FieldVersion.create(
256
+ :content_id => owner.id,
257
+ :field_sid => self.schema_id.to_s,
258
+ :version => version,
259
+ :value => @initial_value,
260
+ :user => owner.current_editor)
261
+ end
236
262
 
237
263
  protected
238
264
 
@@ -264,6 +290,13 @@ module Spontaneous
264
290
  @unprocessed_value = new_value
265
291
  end
266
292
 
293
+ def method_missing(method, *args)
294
+ if outputs.include?(method)
295
+ value(method)
296
+ else
297
+ super
298
+ end
299
+ end
267
300
  end
268
301
  end
269
302
  end
@@ -0,0 +1,68 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'tempfile'
4
+
5
+ module Spontaneous::FieldTypes
6
+ class FileField < Field
7
+ include Spontaneous::Plugins::Field::EditorClass
8
+
9
+ def outputs
10
+ [:html, :filesize, :filename]
11
+ end
12
+
13
+ def preprocess(image_path)
14
+ filename = mimetype = nil
15
+ case image_path
16
+ when Hash
17
+ mimetype = image_path[:type]
18
+ filename = image_path[:filename]
19
+ image_path = image_path[:tempfile].path
20
+ when String
21
+ filename = ::File.basename(image_path)
22
+ end
23
+ return image_path unless File.exist?(image_path)
24
+
25
+ media_file = Spontaneous::Media::File.new(owner, filename, mimetype)
26
+ media_file.copy(image_path)
27
+ set_unprocessed_value(filename)
28
+ media_file
29
+ end
30
+
31
+ def generate_filesize(input)
32
+ if input.respond_to?(:filesize)
33
+ input.filesize
34
+ else
35
+ if ::File.exist?(input)
36
+ ::File.size(input)
37
+ else
38
+ 0
39
+ end
40
+ end
41
+ end
42
+
43
+ def generate_filename(input)
44
+ if input.respond_to?(:filename)
45
+ input.filename
46
+ else
47
+ ::File.basename(input.to_s)
48
+ end
49
+ end
50
+
51
+ def generate_html(input)
52
+ return input if input.is_a?(String)
53
+ input.url
54
+ end
55
+
56
+ def export(user = nil)
57
+ super(user).merge({
58
+ :processed_value => processed_values
59
+ })
60
+ end
61
+
62
+ def path
63
+ value(:html)
64
+ end
65
+ end
66
+
67
+ FileField.register
68
+ end
@@ -7,6 +7,57 @@ require 'delegate'
7
7
  module Spontaneous
8
8
  module FieldTypes
9
9
 
10
+ class ImageOptimizer
11
+ def self.run(source_image)
12
+ self.new(source_image).run
13
+ end
14
+
15
+ def self.jpegtran_binary
16
+ @jpegtran ||= find_binary("jpegtran")
17
+ end
18
+
19
+ def self.jpegoptim_binary
20
+ @jpegoptim ||= find_binary("jpegoptim")
21
+ end
22
+
23
+ def self.find_binary(name)
24
+ binary = `which #{name}`.chomp
25
+ return nil if binary.length == 0
26
+ binary
27
+ end
28
+
29
+ # def self.find_binary(name)
30
+ # binaries = ["/usr/bin/env #{name}"]
31
+ # puts "testing name #{name}"
32
+ # binaries.detect { |bin| status = Spontaneous.system("#{bin} -h"); p status; status == 1 }.tap do |b|
33
+ # puts "found #{b.inspect}"
34
+ # end
35
+ # end
36
+
37
+ def initialize(source_image)
38
+ @source_image = source_image
39
+ end
40
+
41
+ def run
42
+ jpegoptim!(@source_image)
43
+ jpegtran!(@source_image)
44
+ end
45
+
46
+ def jpegoptim!(input)
47
+ run_optimization(self.class.jpegoptim_binary, "-o -q --strip-all --preserve --force #{input} 2>&1 1>/dev/null")
48
+ end
49
+
50
+ def jpegtran!(input)
51
+ run_optimization(self.class.jpegtran_binary, "-optimize -progressive -copy none -outfile #{input} #{input}")
52
+ end
53
+
54
+ def run_optimization(binary, args)
55
+ return unless binary
56
+ command = [binary, args].join(" ")
57
+ Spontaneous.system(command)
58
+ end
59
+ end
60
+
10
61
  module ImageFieldUtilities
11
62
  attr_accessor :template_params
12
63
 
@@ -269,6 +320,14 @@ module Spontaneous
269
320
  end
270
321
  end
271
322
 
323
+ def smush_it!
324
+ ::Spontaneous::Utils::SmushIt.smush!(image.path, current_image_format)
325
+ end
326
+
327
+ def optimize!
328
+ ImageOptimizer.run(image.path) if current_image_format == "jpg"
329
+ end
330
+
272
331
  def border_radius(radius, bg_color = nil)
273
332
  @image.format('png') if bg_color.nil? or bg_color == 'transparent'
274
333
  puts @image.path
@@ -319,6 +378,10 @@ module Spontaneous
319
378
  image.method_missing(method, *params, &block)
320
379
  end
321
380
  end
381
+
382
+ def current_image_format
383
+ image[:format].downcase.gsub(/^jpeg$/, "jpg")
384
+ end
322
385
  end
323
386
 
324
387
  MAX_DIM = 2 ** ([42].pack('i').size * 8) - 1 unless defined?(MAX_DIM)
@@ -0,0 +1,109 @@
1
+ # encoding: UTF-8
2
+
3
+ module Spontaneous::FieldTypes
4
+ # Provides a select field in the UI.
5
+ #
6
+ # Options for the select are provided by passing an :options value in the field config.
7
+ #
8
+ # This form gives a fixed list of options whose values & labels are the same:
9
+ #
10
+ # class Something < Piece
11
+ # field :choices, :select, :options => [ "First Option", "Second Option" ]
12
+ # end
13
+ #
14
+ # This will generate a select tag showing "First Option" and "Second Option" in the
15
+ # editing UI.
16
+ #
17
+ # If you want to have the generated <option/> tag values to be different from the label,
18
+ # then pass an array of arrays as the options:
19
+ #
20
+ # class Something < Piece
21
+ # field :choices, :select, :options => [ ["value1", "Label 1"], ["value2", "Label 2"] ]
22
+ # end
23
+ #
24
+ # You can provide a dynamic set by passing a Proc as the value of the :options parameter:
25
+ #
26
+ # field :choices, :select, :options => proc { |page, box|
27
+ # Things.all.map { |thing| [thing.id, thing.name] }
28
+ # }
29
+ #
30
+ # In this case the options list will be generated dynamically every time the field is edited.
31
+ #
32
+ # To retrieve the selected value from the field, use the standard field.value form.
33
+ # In the case of the example above, the field would return either "value1" or "value2".
34
+ #
35
+ # To retrieve the associated label use `field.value(:label)` or `field.label`
36
+ # ("Value 1" or "Value 2" in the exampel above).
37
+ #
38
+ class SelectField < Field
39
+ include Spontaneous::Plugins::Field::EditorClass
40
+
41
+ def self.static_option_list?
42
+ return false if configured_option_list.is_a?(Proc)
43
+ true
44
+ end
45
+
46
+ def self.configured_option_list
47
+ @configured_option_list ||= normalize_options_list(prototype.options[:options])
48
+ end
49
+
50
+ def self.normalize_options_list(options)
51
+ return options if options.is_a?(Proc)
52
+ options.map { |opt|
53
+ case opt
54
+ when Array
55
+ opt
56
+ else
57
+ [opt, opt]
58
+ end.map { |opt| opt.to_s }
59
+ }
60
+ end
61
+
62
+ def self.export(user)
63
+ default_value = super
64
+ return default_value unless static_option_list?
65
+ default_value.merge({
66
+ :option_list => configured_option_list
67
+ })
68
+ end
69
+
70
+ def self.option_list(owner)
71
+ case (opts = configured_option_list)
72
+ when Proc
73
+ opts.call(owner)
74
+ when Array
75
+ opts
76
+ else
77
+ []
78
+ end
79
+ end
80
+
81
+ def option_list
82
+ self.class.option_list(self.owner)
83
+ end
84
+
85
+ def outputs
86
+ [:html, :label]
87
+ end
88
+
89
+ def generate(output, value)
90
+ return "" if value.blank?
91
+ value[[:html, :label].index(output)]
92
+ end
93
+
94
+ def preprocess(value)
95
+ Spontaneous::JSON.parse(value)
96
+ end
97
+
98
+ def label
99
+ value(:label)
100
+ end
101
+
102
+ def ui_preview_value
103
+ unprocessed_value
104
+ end
105
+
106
+ self.register
107
+ end # OptionsField
108
+ end
109
+
@@ -5,10 +5,15 @@ module Spontaneous
5
5
  class StringField < Field
6
6
  include Spontaneous::Plugins::Field::EditorClass
7
7
 
8
+ def preprocess(value)
9
+ Spontaneous::Utils::SmartQuotes.smarten(value.to_s)
10
+ end
11
+
8
12
  def generate_html(value)
9
13
  escape_html(value)
10
14
  end
11
15
  end
12
- StringField.register
16
+
17
+ StringField.register :string, :title
13
18
  end
14
19
  end
@@ -83,9 +83,20 @@ module Spontaneous
83
83
  Spontaneous.encode_json(params)
84
84
  end
85
85
 
86
+ def src(opts = {})
87
+ case video_type
88
+ when "youtube"
89
+ youtube_src(opts)
90
+ when "vimeo"
91
+ vimeo_src(opts)
92
+ else
93
+ value(:html)
94
+ end
95
+ end
86
96
 
87
97
  def ui_preview_value
88
- render(:html, :width => 480, :height => 270)
98
+ # render(:html, :width => 480, :height => 270)
99
+ src
89
100
  end
90
101
 
91
102
  def retrieve_vimeo_metadata(id)
@@ -145,6 +156,23 @@ module Spontaneous
145
156
 
146
157
  def vimeo_attributes(options = {})
147
158
 
159
+ o = make_vimeo_options(options)
160
+
161
+ attributes = {
162
+ :type => "text/html",
163
+ :frameborder => "0",
164
+ :width => o.delete(:width),
165
+ :height => o.delete(:height)
166
+ }
167
+ attributes.update(:webkitAllowFullScreen => "yes", :allowFullScreen => "yes") if o[:fullscreen]
168
+
169
+ make_query_options!(o)
170
+ attributes[:src] = vimeo_src_with_options(o)
171
+
172
+ {:tagname => "iframe", :tag => "<iframe/>", :attr => attributes}
173
+ end
174
+
175
+ def make_vimeo_options(options = {})
148
176
  o = default_player_options
149
177
  vimeo_options = o.delete(:vimeo) || {}
150
178
 
@@ -168,23 +196,28 @@ module Spontaneous
168
196
  :byline => true,
169
197
  :player_id => "vimeo#{owner.id}id#{value(:id)}"
170
198
  }.merge(o).merge(vimeo_options).merge(options)
199
+ o
200
+ end
171
201
 
172
- attributes = {
173
- :type => "text/html",
174
- :frameborder => "0",
175
- :width => o.delete(:width),
176
- :height => o.delete(:height)
177
- }
178
- attributes.update(:webkitAllowFullScreen => "yes", :allowFullScreen => "yes") if o[:fullscreen]
179
-
202
+ def vimeo_src(options = {})
203
+ o = make_vimeo_options(options)
180
204
  make_query_options!(o)
181
-
182
- attributes[:src] = "http://player.vimeo.com/video/#{value(:id)}?title=#{o[:title]}&byline=#{o[:byline]}&portrait=#{o[:portrait]}&autoplay=#{o[:autoplay]}&loop=#{o[:loop]}&api=#{o[:api]}&player_id=#{o[:player_id]}#{o.key?(:color) ? "&color=#{o[:color]}" : ""}"
183
-
184
- {:tagname => "iframe", :tag => "<iframe/>", :attr => attributes}
185
-
205
+ vimeo_src_with_options(o)
186
206
  end
187
207
 
208
+ def vimeo_src_with_options(o)
209
+ params = {
210
+ "title" => o[:title],
211
+ "byline" => o[:byline],
212
+ "portrait" => o[:portrait],
213
+ "autoplay" => o[:autoplay],
214
+ "loop" => o[:loop],
215
+ "api" => o[:api],
216
+ "player_id" => o[:player_id] }
217
+ params.update("color" => o[:color]) if o.key?(:color)
218
+ params = ::Rack::Utils.build_query(params)
219
+ "http://player.vimeo.com/video/#{value(:id)}?#{params}"
220
+ end
188
221
 
189
222
  def to_youtube_html(options = {})
190
223
  params = youtube_attributes(options)
@@ -194,7 +227,25 @@ module Spontaneous
194
227
 
195
228
 
196
229
  def youtube_attributes(options = {})
230
+ o = make_youtube_options(options)
231
+
232
+ attributes = {
233
+ :type => "text/html",
234
+ :frameborder => "0",
235
+ :width => o.delete(:width),
236
+ :height => o.delete(:height)
237
+ }
238
+
239
+ make_query_options!(o)
240
+
241
+ attributes[:src] = youtube_src_with_options(o)
242
+
243
+ attributes.update(:webkitAllowFullScreen => "yes", :allowFullScreen => "yes") if o[:fullscreen]
244
+
245
+ {:tagname => "iframe", :tag => "<iframe/>", :attr => attributes}
246
+ end
197
247
 
248
+ def make_youtube_options(options = {})
198
249
  o = default_player_options
199
250
  youtube_options = o.delete(:youtube) || {}
200
251
 
@@ -218,23 +269,30 @@ module Spontaneous
218
269
  :autohide => 2,
219
270
  :rel => true
220
271
  }.merge(o).merge(youtube_options).merge(options)
272
+ end
221
273
 
222
- attributes = {
223
- :type => "text/html",
224
- :frameborder => "0",
225
- :width => o.delete(:width),
226
- :height => o.delete(:height)
227
- }
228
-
274
+ def youtube_src(options = {})
275
+ o = make_youtube_options(options)
229
276
  make_query_options!(o)
230
-
231
- attributes[:src] = "http://www.youtube.com/embed/#{value(:id)}?modestbranding=1&theme=#{o[:theme]}&hd=#{o[:hd]}&fs=#{o[:fullscreen]}&controls=#{o[:controls]}&autoplay=#{o[:autoplay]}&showinfo=#{o[:showinfo]}&showsearch=#{o[:showsearch]}&loop=#{o[:loop]}&autohide=#{o[:autohide]}&rel=#{o[:rel]}&enablejsapi=#{o[:api]}"
232
- attributes.update(:webkitAllowFullScreen => "yes", :allowFullScreen => "yes") if o[:fullscreen]
233
-
234
-
235
- {:tagname => "iframe", :tag => "<iframe/>", :attr => attributes}
277
+ youtube_src_with_options(o)
236
278
  end
237
279
 
280
+ def youtube_src_with_options(o)
281
+ params = ::Rack::Utils.build_query({
282
+ "modestbranding" => 1,
283
+ "theme" => o[:theme],
284
+ "hd" => o[:hd],
285
+ "fs" => o[:fullscreen],
286
+ "controls" => o[:controls],
287
+ "autoplay" => o[:autoplay],
288
+ "showinfo" => o[:showinfo],
289
+ "showsearch" => o[:showsearch],
290
+ "loop" => o[:loop],
291
+ "autohide" => o[:autohide],
292
+ "rel" => o[:rel],
293
+ "enablejsapi" => o[:api] })
294
+ "http://www.youtube.com/embed/#{value(:id)}?#{params}"
295
+ end
238
296
 
239
297
  def make_html_attributes(attributes)
240
298
  attributes.to_a.map { |name, value| "#{name}=\"#{escape_html(value)}\"" }.join(" ")
@@ -33,6 +33,6 @@ module Spontaneous
33
33
  end
34
34
  end
35
35
 
36
- [:string, :long_string, :image, :date, :markdown, :location, :webvideo].each do |type|
36
+ [:string, :long_string, :file, :image, :date, :markdown, :location, :webvideo, :select].each do |type|
37
37
  require "spontaneous/field_types/#{type}_field"
38
38
  end
@@ -0,0 +1,8 @@
1
+
2
+ module Spontaneous
3
+ class FieldVersion < Sequel::Model(:spontaneous_field_versions)
4
+ plugin :timestamps
5
+
6
+ many_to_one :user, :class => Spontaneous::Permissions::User
7
+ end
8
+ end
@@ -31,7 +31,7 @@ module Spontaneous
31
31
  self.destination_root = options[:root]
32
32
  empty_directory "schema"
33
33
  template 'page.rb.tt', "schema/#{disk_name}.rb"
34
- copy_file 'inline.html.cut', "templates/#{disk_name}.html.#{Spontaneous::Render.extension}"
34
+ copy_file 'inline.html.cut', "templates/#{disk_name}.html.#{Spontaneous::Output::Template.extension}"
35
35
  end
36
36
  end
37
37
  end
@@ -1,7 +1,4 @@
1
- #load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2
-
3
- # Uncomment if you are using Rails' asset pipeline
4
- # load 'deploy/assets'
1
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
5
2
 
6
3
  #Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
7
4
 
@@ -7,16 +7,23 @@ gem 'mysql2', '~> 0.2'
7
7
  # Deploy with Capistrano
8
8
  gem 'capistrano', '~> 2.9'
9
9
 
10
+ # If you want to enable the built in search functionality then you must un-comment
11
+ # the xapian-full & xapian-fu dependencies below. They are not included by default
12
+ # because the xapian library takes a very long time to build.
13
+ #gem 'xapian-full', "~> 1.2.3"
14
+ #gem 'xapian-fu', "~> 1.3"
10
15
 
11
16
  ## TODO: replace this path based gem with a version once the gem is live
12
17
  #gem 'spontaneous', '<%= Spontaneous::VERSION %>'
13
- gem 'spontaneous', :path => "/Users/garry/Dropbox/Development/spontaneous3/working"
14
- ## TODO: Remove this line when Simultaneous is published
15
- gem 'simultaneous', :path => "/Users/garry/Dropbox/Development/spontaneous3/simultaneous"
16
18
 
17
- # group :development, :test do
18
- # gem 'webrat'
19
- # end
19
+ gem 'spontaneous', :git => "git://github.com/SpontaneousCMS/spontaneous.git"
20
+ gem 'simultaneous', :git => "git://github.com/SpontaneousCMS/simultaneous.git"
21
+
22
+ group :production do
23
+ gem 'thin', '~> 1.3.1'
24
+ gem 'unicorn', '~> 4.2'
25
+ end
26
+
20
27
 
21
28
  # source gemfiles from Plugins & Features
22
29
  Dir['*/**/Gemfile'].each do |path|
@@ -0,0 +1,28 @@
1
+ ENV["SPOT_MODE"] = "console"
2
+
3
+ require File.expand_path("../boot.rb", __FILE__)
4
+
5
+ require "spontaneous/capistrano"
6
+ require "bundler/capistrano"
7
+
8
+ default_run_options[:pty] = true
9
+
10
+ ssh_options[:port] = 22
11
+ ssh_options[:forward_agent] = true
12
+
13
+ set :application, "<%= @domain %>"
14
+ server "<%= @domain %>", :app, :web, :db, :media
15
+ set :user, "<%= @username %>"
16
+ set :use_sudo, false
17
+
18
+
19
+ set :scm, "git"
20
+ set :repository, "git@<%= @domain %>:spontaneous.git"
21
+
22
+ set :deploy_to, "/home/#{fetch(:user)}/spontaneous"
23
+
24
+ namespace :deploy do
25
+ task :restart, :roles => [:app, :web] do
26
+ run "sv kill /home/#{fetch(:user)}/service/enabled/back"
27
+ end
28
+ end
@@ -1,7 +1,12 @@
1
1
 
2
2
  publishing_method :simultaneous
3
3
 
4
- simultaneous_connection "/tmp/simultaneous.sock"
4
+ simultaneous_connection ENV["SIMULTANEOUS_SOCKET"]
5
+ spontaneous_binary ENV["SPONTANEOUS_BINARY"]
6
+
7
+ server_connection ENV["SPONTANEOUS_SERVER"]
5
8
 
6
9
  # used by publishing mech to determine a restart strategy
7
- handler :unicorn
10
+ handler :unicorn
11
+ after_publish_restart ENV["POST_PUBLISH_COMMAND"]
12
+