alchemy_cms 3.0.4 → 3.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -6
  3. data/Gemfile +4 -7
  4. data/README.md +207 -115
  5. data/alchemy_cms.gemspec +10 -9
  6. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -2
  7. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +2 -2
  8. data/app/assets/javascripts/alchemy/alchemy.js +6 -7
  9. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +1 -43
  10. data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +1 -1
  11. data/app/assets/stylesheets/alchemy/_mixins.scss +2 -1
  12. data/app/assets/stylesheets/alchemy/buttons.scss +0 -5
  13. data/app/assets/stylesheets/alchemy/dialogs.scss +1 -0
  14. data/app/assets/stylesheets/alchemy/frame.scss +9 -12
  15. data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +11 -2
  16. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +9 -1
  17. data/app/controllers/alchemy/admin/attachments_controller.rb +2 -4
  18. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +34 -38
  19. data/app/controllers/alchemy/api/base_controller.rb +19 -0
  20. data/app/controllers/alchemy/api/contents_controller.rb +35 -0
  21. data/app/controllers/alchemy/api/elements_controller.rb +29 -0
  22. data/app/controllers/alchemy/api/pages_controller.rb +32 -0
  23. data/app/controllers/alchemy/contents_controller.rb +1 -0
  24. data/app/controllers/alchemy/elements_controller.rb +5 -2
  25. data/app/controllers/alchemy/pages_controller.rb +4 -1
  26. data/app/controllers/alchemy/pictures_controller.rb +4 -36
  27. data/app/helpers/alchemy/admin/essences_helper.rb +5 -2
  28. data/app/helpers/alchemy/essences_helper.rb +14 -1
  29. data/app/models/alchemy/content.rb +32 -4
  30. data/app/models/alchemy/element.rb +2 -16
  31. data/app/models/alchemy/element/presenters.rb +2 -2
  32. data/app/models/alchemy/essence_file.rb +5 -0
  33. data/app/models/alchemy/essence_picture.rb +12 -8
  34. data/app/models/alchemy/picture.rb +1 -74
  35. data/app/models/alchemy/picture/transformations.rb +249 -0
  36. data/app/serializers/alchemy/content_serializer.rb +3 -10
  37. data/app/serializers/alchemy/element_serializer.rb +6 -3
  38. data/app/serializers/alchemy/legacy_element_serializer.rb +17 -0
  39. data/app/views/alchemy/admin/dashboard/_sites.html.erb +14 -4
  40. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +8 -5
  41. data/app/views/alchemy/admin/pages/edit.html.erb +9 -9
  42. data/app/views/alchemy/admin/pictures/info.html.erb +2 -3
  43. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  44. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +8 -7
  45. data/app/views/alchemy/essences/_essence_boolean_view.html.erb +3 -3
  46. data/app/views/alchemy/essences/_essence_date_editor.html.erb +8 -2
  47. data/app/views/alchemy/essences/_essence_date_view.html.erb +10 -8
  48. data/app/views/alchemy/essences/_essence_file_editor.html.erb +48 -53
  49. data/app/views/alchemy/essences/_essence_file_view.html.erb +5 -5
  50. data/app/views/alchemy/essences/_essence_html_editor.html.erb +5 -4
  51. data/app/views/alchemy/essences/_essence_link_editor.html.erb +17 -15
  52. data/app/views/alchemy/essences/_essence_link_view.html.erb +11 -7
  53. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +4 -2
  54. data/app/views/alchemy/essences/_essence_picture_view.html.erb +4 -2
  55. data/app/views/alchemy/essences/_essence_richtext_view.html.erb +5 -4
  56. data/app/views/alchemy/essences/_essence_select_editor.html.erb +22 -32
  57. data/app/views/alchemy/essences/_essence_text_view.html.erb +7 -6
  58. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +1 -1
  59. data/app/views/layouts/alchemy/admin.html.erb +5 -3
  60. data/config/initializers/inflections.rb +3 -0
  61. data/config/initializers/simple_form.rb +1 -1
  62. data/config/locales/alchemy.en.yml +0 -1
  63. data/config/routes.rb +14 -0
  64. data/lib/alchemy/capistrano.rb +71 -0
  65. data/lib/alchemy/engine.rb +0 -3
  66. data/lib/alchemy/essence.rb +1 -1
  67. data/lib/alchemy/permissions.rb +19 -5
  68. data/lib/alchemy/picture_attributes.rb +1 -1
  69. data/lib/alchemy/test_support/auth_helpers.rb +1 -1
  70. data/lib/alchemy/test_support/essence_shared_examples.rb +37 -22
  71. data/lib/alchemy/test_support/integration_helpers.rb +1 -1
  72. data/lib/alchemy/tinymce.rb +21 -4
  73. data/lib/alchemy/upgrader/three_point_one.rb +43 -0
  74. data/lib/alchemy/upgrader/three_point_zero.rb +13 -0
  75. data/lib/alchemy/version.rb +2 -1
  76. data/lib/rails/generators/alchemy/module/module_generator.rb +30 -0
  77. data/lib/rails/generators/alchemy/module/templates/ability.rb.tt +11 -0
  78. data/lib/rails/generators/alchemy/module/templates/controller.rb.tt +2 -0
  79. data/lib/rails/generators/alchemy/module/templates/module_config.rb.tt +15 -0
  80. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +0 -1
  81. data/lib/rails/templates/alchemy.rb +2 -2
  82. data/lib/tasks/alchemy/db.rake +7 -1
  83. data/spec/controllers/admin/attachments_controller_spec.rb +38 -38
  84. data/spec/controllers/admin/base_controller_spec.rb +18 -18
  85. data/spec/controllers/admin/clipboard_controller_spec.rb +23 -18
  86. data/spec/controllers/admin/contents_controller_spec.rb +33 -27
  87. data/spec/controllers/admin/dashboard_controller_spec.rb +14 -14
  88. data/spec/controllers/admin/elements_controller_spec.rb +125 -105
  89. data/spec/controllers/admin/essence_files_controller_spec.rb +6 -7
  90. data/spec/controllers/admin/essence_pictures_controller_spec.rb +52 -42
  91. data/spec/controllers/admin/languages_controller_spec.rb +3 -3
  92. data/spec/controllers/admin/pages_controller_spec.rb +81 -71
  93. data/spec/controllers/admin/pictures_controller_spec.rb +69 -72
  94. data/spec/controllers/admin/resources_controller_spec.rb +5 -5
  95. data/spec/controllers/admin/trash_controller_spec.rb +15 -12
  96. data/spec/controllers/alchemy/admin/tags_controller_spec.rb +8 -8
  97. data/spec/controllers/alchemy/api/contents_controller_spec.rb +73 -0
  98. data/spec/controllers/alchemy/api/elements_controller_spec.rb +69 -0
  99. data/spec/controllers/alchemy/api/pages_controller_spec.rb +86 -0
  100. data/spec/controllers/attachments_controller_spec.rb +8 -8
  101. data/spec/controllers/contents_controller_spec.rb +22 -0
  102. data/spec/controllers/elements_controller_spec.rb +10 -4
  103. data/spec/controllers/messages_controller_spec.rb +35 -34
  104. data/spec/controllers/pages_controller_spec.rb +37 -28
  105. data/spec/controllers/pictures_controller_spec.rb +90 -23
  106. data/spec/dummy/app/models/dummy_user.rb +0 -4
  107. data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_editor.html.erb +11 -0
  108. data/spec/dummy/config/alchemy/elements.yml +22 -1
  109. data/spec/dummy/config/alchemy/page_layouts.yml +4 -0
  110. data/spec/dummy/config/application.rb +2 -1
  111. data/spec/dummy/config/environments/test.rb +3 -1
  112. data/spec/features/admin/dashboard_spec.rb +41 -6
  113. data/spec/features/admin/language_tree_feature_spec.rb +3 -3
  114. data/spec/features/admin/legacy_page_url_management_spec.rb +1 -1
  115. data/spec/features/admin/link_overlay_spec.rb +7 -7
  116. data/spec/features/admin/locale_select_feature_spec.rb +5 -2
  117. data/spec/features/admin/modules_integration_spec.rb +1 -1
  118. data/spec/features/admin/page_creation_feature_spec.rb +3 -2
  119. data/spec/features/admin/page_editing_feature_spec.rb +66 -79
  120. data/spec/features/admin/picture_library_integration_spec.rb +8 -8
  121. data/spec/features/admin/resources_integration_spec.rb +21 -21
  122. data/spec/features/admin/tinymce_feature_spec.rb +36 -0
  123. data/spec/features/navigation_spec.rb +1 -1
  124. data/spec/features/page_feature_spec.rb +34 -34
  125. data/spec/features/picture_security_spec.rb +4 -4
  126. data/spec/features/security_spec.rb +1 -1
  127. data/spec/features/translation_integration_spec.rb +7 -7
  128. data/spec/helpers/admin/base_helper_spec.rb +51 -49
  129. data/spec/helpers/admin/contents_helper_spec.rb +11 -11
  130. data/spec/helpers/admin/elements_helper_spec.rb +20 -17
  131. data/spec/helpers/admin/essences_helper_spec.rb +42 -11
  132. data/spec/helpers/admin/navigation_helper_spec.rb +64 -54
  133. data/spec/helpers/admin/pages_helper_spec.rb +10 -10
  134. data/spec/helpers/admin/tags_helper_spec.rb +16 -16
  135. data/spec/helpers/base_helper_spec.rb +11 -11
  136. data/spec/helpers/elements_block_helper_spec.rb +24 -24
  137. data/spec/helpers/elements_helper_spec.rb +46 -46
  138. data/spec/helpers/essences_helper_spec.rb +90 -17
  139. data/spec/helpers/pages_helper_spec.rb +53 -53
  140. data/spec/helpers/picture_url_helpers_spec.rb +6 -6
  141. data/spec/helpers/url_helper_spec.rb +32 -32
  142. data/spec/libraries/config_spec.rb +9 -9
  143. data/spec/libraries/controller_actions_spec.rb +14 -14
  144. data/spec/libraries/i18n_spec.rb +6 -6
  145. data/spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb +4 -4
  146. data/spec/libraries/modules_spec.rb +4 -4
  147. data/spec/libraries/mount_point_spec.rb +13 -13
  148. data/spec/libraries/page_layout_spec.rb +24 -24
  149. data/spec/libraries/permissions_spec.rb +97 -80
  150. data/spec/libraries/resource_spec.rb +37 -37
  151. data/spec/libraries/resources_helper_spec.rb +19 -19
  152. data/spec/libraries/shell_spec.rb +17 -17
  153. data/spec/libraries/template_tracker_spec.rb +14 -14
  154. data/spec/libraries/tinymce_spec.rb +8 -8
  155. data/spec/libraries/userstamp_spec.rb +2 -2
  156. data/spec/mailers/messages_spec.rb +4 -4
  157. data/spec/models/attachment_spec.rb +86 -30
  158. data/spec/models/cell_spec.rb +10 -10
  159. data/spec/models/content_spec.rb +106 -46
  160. data/spec/models/element_spec.rb +94 -115
  161. data/spec/models/essence_date_spec.rb +1 -1
  162. data/spec/models/essence_file_spec.rb +4 -4
  163. data/spec/models/essence_picture_spec.rb +56 -25
  164. data/spec/models/essence_richtext_spec.rb +1 -1
  165. data/spec/models/essence_text_spec.rb +7 -7
  166. data/spec/models/language_spec.rb +12 -12
  167. data/spec/models/legacy_page_url_spec.rb +2 -2
  168. data/spec/models/message_spec.rb +12 -5
  169. data/spec/models/page_spec.rb +259 -235
  170. data/spec/models/picture_spec.rb +72 -166
  171. data/spec/models/site_spec.rb +41 -41
  172. data/spec/models/tag_spec.rb +7 -7
  173. data/spec/routing/api_routing_spec.rb +150 -0
  174. data/spec/routing/routing_spec.rb +28 -28
  175. data/spec/spec_helper.rb +6 -5
  176. data/spec/support/hint_examples.rb +5 -5
  177. data/spec/support/transformation_examples.rb +173 -0
  178. data/spec/tasks/helpers_spec.rb +29 -29
  179. data/spec/views/essences/essence_boolean_editor_spec.rb +32 -0
  180. data/spec/views/essences/essence_boolean_view_spec.rb +2 -2
  181. data/spec/views/essences/essence_date_view_spec.rb +1 -1
  182. data/spec/views/essences/essence_link_view_spec.rb +11 -0
  183. data/spec/views/essences/essence_picture_view_spec.rb +56 -11
  184. data/spec/views/essences/essence_richtext_view_spec.rb +12 -0
  185. data/spec/views/essences/essence_text_view_spec.rb +12 -0
  186. data/vendor/assets/javascripts/tinymce/langs/de.js +20 -2
  187. data/vendor/assets/javascripts/tinymce/langs/fr.js +14 -1
  188. data/vendor/assets/javascripts/tinymce/langs/nl.js +22 -4
  189. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +1 -1
  190. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.min.js +1 -1
  191. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.min.js +1 -1
  192. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.min.js +1 -1
  193. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.min.js +1 -1
  194. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.min.js +1 -1
  195. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +1 -1
  196. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.min.js +1 -1
  197. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.min.js +1 -1
  198. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.min.js +1 -1
  199. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.min.js +1 -1
  200. data/vendor/assets/javascripts/tinymce/themes/modern/theme.min.js +1 -1
  201. data/vendor/assets/javascripts/tinymce/tinymce.min.js +11 -10
  202. metadata +72 -42
  203. data/app/views/alchemy/messages/contact_form_mail.es.text.erb +0 -12
  204. data/config/locales/alchemy.es.yml +0 -958
  205. data/config/locales/alchemy.ru.yml +0 -837
  206. data/config/locales/simple_form.es.yml +0 -6
  207. data/config/locales/simple_form.ru.yml +0 -25
  208. data/lib/rails/generators/alchemy/scaffold/files/alchemy.es.yml +0 -31
  209. data/vendor/assets/javascripts/tinymce/langs/es.js +0 -197
  210. data/vendor/assets/javascripts/tinymce/langs/ru.js +0 -197
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a98f349ff1159991c93354c2cd40b77793ade10
4
- data.tar.gz: a7378076e929a7fe8f80fc59256041260f3ff7dd
3
+ metadata.gz: d8ff921fd176dd5ee1ffbbb6c23b73d3a03f6f05
4
+ data.tar.gz: 09825c9d513e598cab488839e88f80ef301f2c67
5
5
  SHA512:
6
- metadata.gz: 081d537f1cc0a4528039e2466885fbe41b072f24131d08f4757cca4e91bafa6867c6ee4b255d90db5a3fb0b07f12f4c02714d4b4c6b5915781b652ab81c7e4f8
7
- data.tar.gz: eea901691a4b7351154098e8ff0f8635b3233381e20529ef284d463213fab9b2b9a224f78183a83fb9924df9505844c3a8a3ada02451c326b04be525df54f5c8
6
+ metadata.gz: 5baf66ef54d6670f7f8f05d5a55bdfef93d7725c9084d12dd84cd430851ff261190473837555fb767fd9822326582474c71b15e088a53dbf4e96e44473a3d85d
7
+ data.tar.gz: e3cfe5a46b73571a77da7296df1b1d8c978b7ab6004e6f7ce9e8b9c42e1910cd0e24cac3ab81f1edc5238e7d7a492889d9e266b3cfa47f975de6daa1a5b11e1a
@@ -1,19 +1,17 @@
1
1
  language: ruby
2
- sudo: false
3
- cache: bundler
4
2
  rvm:
5
3
  - 1.9.3
6
4
  - 2.0.0
7
5
  - 2.1
8
6
  branches:
9
7
  only:
10
- - 3.0-stable
11
- before_script: 'bundle exec rake alchemy:spec:prepare'
12
- script: 'bundle exec rspec'
8
+ - master
9
+ before_script: 'rake alchemy:spec:prepare'
10
+ script: rspec
13
11
  env:
14
12
  - DB=mysql
15
13
  - DB=postgresql
16
- - RAILS_VERSION=4.0.13
14
+ - RAILS_VERSION=4.1.5
17
15
  notifications:
18
16
  irc:
19
17
  on_success: change
data/Gemfile CHANGED
@@ -3,15 +3,12 @@ source 'http://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  if ENV['RAILS_VERSION']
6
- gem 'rails', ENV['RAILS_VERSION']
6
+ gem 'rails', "~> #{ENV['RAILS_VERSION']}"
7
7
  end
8
8
 
9
9
  # Code coverage plattform
10
10
  gem 'coveralls', require: false
11
11
 
12
- # Fixes issues with wrong exit codes. See: https://github.com/colszowka/simplecov/issues/269
13
- gem 'simplecov', '0.7.1'
14
-
15
12
  gem 'database_cleaner'
16
13
 
17
14
  group :test do
@@ -19,6 +16,7 @@ group :test do
19
16
  gem 'mysql2' if ENV['DB'] == 'mysql'
20
17
  gem 'pg' if ENV['DB'] == 'postgresql'
21
18
  gem 'poltergeist'
19
+ gem 'rspec-activemodel-mocks'
22
20
  unless ENV['CI']
23
21
  gem 'launchy'
24
22
  end
@@ -27,12 +25,11 @@ end
27
25
  group :development, :test do
28
26
  unless ENV['CI']
29
27
  gem 'annotate'
30
- gem 'pry'
31
28
  gem 'bumpy'
32
29
  gem 'yard'
33
30
  gem 'redcarpet'
34
- gem 'pry-rails'
35
- gem 'spring', '~> 1.1.0.beta2'
31
+ gem 'pry-byebug'
32
+ gem 'spring'
36
33
  gem 'spring-commands-rspec'
37
34
  end
38
35
  gem 'jasmine-rails', github: 'searls/jasmine-rails'
data/README.md CHANGED
@@ -1,32 +1,31 @@
1
- [![Gem Version](https://badge.fury.io/rb/alchemy_cms.svg)](http://badge.fury.io/rb/alchemy_cms)
2
- [![Build Status](https://travis-ci.org/AlchemyCMS/alchemy_cms.svg?branch=3.0-stable)](https://travis-ci.org/AlchemyCMS/alchemy_cms) [![Code Climate](https://codeclimate.com/github/AlchemyCMS/alchemy_cms.svg)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms) [![Coverage Status](https://img.shields.io/coveralls/AlchemyCMS/alchemy_cms.svg)](https://coveralls.io/r/AlchemyCMS/alchemy_cms?branch=3.0-stable)
1
+ [![Gem Version](https://badge.fury.io/rb/alchemy_cms.png)](http://badge.fury.io/rb/alchemy_cms)
2
+ [![Build Status](https://travis-ci.org/magiclabs/alchemy_cms.svg?branch=master)](https://travis-ci.org/magiclabs/alchemy_cms) [![Code Climate](https://codeclimate.com/github/magiclabs/alchemy_cms.png)](https://codeclimate.com/github/magiclabs/alchemy_cms) [![Coverage Status](https://coveralls.io/repos/magiclabs/alchemy_cms/badge.png?branch=master)](https://coveralls.io/r/magiclabs/alchemy_cms?branch=master)
3
+
4
+ **CAUTION: This master branch is a development branch that can contain bugs. For productive environments you should use the [current Ruby gem version](http://rubygems.org/gems/alchemy_cms/versions/3.0.0), or the [latest stable branch (3.0-stable)](https://github.com/magiclabs/alchemy_cms/tree/3.0-stable).**
3
5
 
4
6
  About
5
7
  -----
6
8
 
7
9
  ![Alchemy CMS](http://alchemy-cms.com/assets/alchemy_logo.svg)
8
10
 
9
- Alchemy is the most powerful, userfriendly and flexible Rails CMS.
11
+ Alchemy is a powerful, flexible and user centric Rails CMS.
10
12
 
11
- Read more on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
13
+ Read more about Alchemy on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
12
14
 
13
15
  Features
14
16
  --------
15
17
 
16
- - Highly flexible Templating
17
- - Gorgious End-User centric interface
18
- - Multilingual
19
- - Multidomain
20
- - SEO friendly
21
- - Access Control
22
- - RSS Feeds
23
- - Contactforms
18
+ - Highly flexible templating that completely separates content from markup
19
+ - End-User centric graphical user interface
20
+ - Multi language and multi domain
21
+ - SEO friendly urls
22
+ - User Access Control
23
+ - Build in contact form mailer
24
24
  - Attachments and downloads
25
25
  - Powerful image rendering
26
- - Extendable
27
- - Integrates in existing Rails Apps
28
- - Caching
29
- - BSD License
26
+ - Extendable via Rails engines
27
+ - Integrates into existing Rails Apps
28
+ - Flexible caching
30
29
  - Hostable on any Server that supports Ruby on Rails, a SQL Database and ImageMagick
31
30
 
32
31
  Rails Version
@@ -34,181 +33,261 @@ Rails Version
34
33
 
35
34
  **This version of Alchemy CMS runs with Rails 4 (including 4.1)**
36
35
 
37
- If you are looking for a Rails 3.2 compatible version check the [2.8-stable branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.8-stable).
38
-
39
- If you are looking for a Rails 3.1 compatible version check the [2.1-stable branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.1-stable).
36
+ **Rails 4.2 support is coming soon. Watch [this pull request](https://github.com/magiclabs/alchemy_cms/pull/655).**
40
37
 
41
- If you are looking for a Rails 3.0 compatible version check the [2.0-stable branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.0-stable).
42
-
43
- If you are looking for a Rails 2.3 compatible version check the [1.6-stable branch](https://github.com/AlchemyCMS/alchemy_cms/tree/1.6-stable).
38
+ * For a Rails 3.2 compatible version use the [`2.8-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.8-stable).
39
+ * For a Rails 3.1 compatible version use the [`2.1-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.1-stable).
40
+ * For a Rails 3.0 compatible version use the [`2.0-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.0-stable).
41
+ * For a Rails 2.3 compatible version use the [`1.6-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/1.6-stable).
44
42
 
45
43
  Ruby Version
46
44
  ------------
47
45
 
48
46
  Alchemy runs with Ruby >= 1.9.3 (including Ruby 2.0 and 2.1).
49
47
 
50
- For a Ruby 1.8.7 compatible version use the [2.3-stable branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.3-stable).
48
+ For a Ruby 1.8.7 compatible version use the [`2.3-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.3-stable).
51
49
 
52
50
 
53
51
  Installation
54
52
  ------------
55
53
 
56
- ### Translation requirements
54
+ ### Install as a standalone project
57
55
 
58
- #### Russian:
56
+ Use the installer:
59
57
 
60
- If you want to use Russian translation and have better i18n support, you should put:
58
+ ```shell
59
+ $ gem install alchemy_cms --pre
60
+ $ alchemy new my_magicpage
61
+ ```
61
62
 
62
- gem 'russian', '~> 0.6.0'
63
+ and follow the instructions to finish the installation.
63
64
 
64
- or similar in functionality gem into your Gemfile before running:
65
+ The installer has some options (like choosing the database). See them with:
65
66
 
66
- bundle install
67
+ ```shell
68
+ $ alchemy --help
69
+ ```
67
70
 
68
- ### As a standalone project
71
+ ### Install into an existing Rails project
69
72
 
70
- #### 1. Use the installer:
73
+ #### 1. Add the Alchemy gem:
71
74
 
72
- gem install alchemy_cms
73
- alchemy new my_magicpage
74
- cd my_magicpage
75
+ Put this into your `Gemfile`:
75
76
 
76
- Run
77
+ ```ruby
78
+ gem 'alchemy_cms', github: 'magiclabs/alchemy_cms', branch: 'master'
79
+ ```
77
80
 
78
- bundle install
81
+ **NOTE:** You normally want to use a stable branch, like `3.0-stable`.
79
82
 
80
- to finish installation process.
83
+ #### 2. Update your bundle:
81
84
 
82
- #### 2. Start the local server:
85
+ ```shell
86
+ $ bundle install
87
+ ```
83
88
 
84
- bin/rails server
89
+ #### 3. Set the authentication user
85
90
 
86
- #### 3. Switch to your browser:
91
+ Now you have to decide, if you want to use your own user model or if you want to use
92
+ the Devise based user model that Alchemy provides and was extracted [into its own gem](https://github.com/magiclabs/alchemy-devise).
87
93
 
88
- Open `http://localhost:3000` and follow the on screen instructions.
94
+ ##### Use Alchemy user
89
95
 
90
- ### Into an existing Rails project
96
+ If you don't have your own user class, you can use the Alchemy user model. Just add the following gem into your `Gemfile`:
91
97
 
92
- #### 1. Add the Alchemy gem:
98
+ ```ruby
99
+ gem 'alchemy-devise', '~> 2.0'
100
+ ```
93
101
 
94
- In your App's Gemfile:
102
+ Then run:
95
103
 
96
- gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: '3.0-stable'
104
+ ```shell
105
+ $ bundle install
106
+ $ bin/rake alchemy_devise:install:migrations
107
+ ```
97
108
 
98
- #### 2. Install Alchemy into your app:
109
+ ##### Use your User model
99
110
 
100
- Run in terminal:
111
+ In order to use your own user model you need to tell Alchemy about it.
101
112
 
102
- bundle install
103
- bin/rake alchemy:install
113
+ The best practice is to use an initializer:
104
114
 
105
- ### Authentication User Model
115
+ ```ruby
116
+ # config/initializers/alchemy.rb
117
+ Alchemy.user_class_name = 'YourUserClass' # Defaults to 'User'
118
+ Alchemy.login_path = '/your/login/path' # Defaults to '/login'
119
+ Alchemy.logout_path = '/your/logout/path' # Defaults to '/logout'
120
+ ```
106
121
 
107
- With Version 3.0 we extracted the Alchemy user model [into its own gem](https://github.com/AlchemyCMS/alchemy-devise).
122
+ The only thing Alchemy needs to know from your user class is the `alchemy_roles` method.
108
123
 
109
- In order to get the former Alchemy user model back, add the following gem into your Gemfile:
124
+ This method has to return an `Array` (or `ActiveRecord::Relation`) with at least one of the following roles: `member`, `author`, `editor`, `admin`.
110
125
 
111
- gem 'alchemy-devise', '~> 2.0'
126
+ Example:
112
127
 
113
- Run in terminal:
128
+ ```ruby
129
+ # app/models/user.rb
114
130
 
115
- bundle install
116
- bin/rake alchemy_devise:install:migrations db:migrate
131
+ def alchemy_roles
132
+ if admin?
133
+ %w(admin)
134
+ end
135
+ end
136
+ ```
117
137
 
118
- **In order to use your own user model, you can add e.g.**
138
+ Please follow [this guide](http://guides.alchemy-cms.com/edge/custom_authentication.html) for further instructions on how to customize your user class even more.
119
139
 
120
- # config/initializers/alchemy.rb
121
- Alchemy.user_class_name = 'YourUserClass'
122
- Alchemy.login_path = '/your/login/path'
123
- Alchemy.logout_path = '/your/logout/path'
140
+ #### 4. Install Alchemy into your app:
124
141
 
125
- The only thing Alchemy needs to know from your user model is the `alchemy_roles` method.
142
+ **After** you set the user model you need to run the Alchemy install task:
126
143
 
127
- This method has to return an `Array` or `ActiveRecord::Relation` with at least one of the following roles:
144
+ ```shell
145
+ $ bin/rake alchemy:install
146
+ ```
128
147
 
129
- * `member`
130
- * `author`
131
- * `editor`
132
- * `admin`
148
+ Now everything should be set up and you should be able to visit the Alchemy Dashboard at:
133
149
 
134
- Example:
150
+ <http://localhost:3000/admin>
135
151
 
136
- def alchemy_roles
137
- self.admin?
138
- %w(admin)
139
- end
140
- end
152
+ *) Use your custom path if you mounted Alchemy at something else then `'/'`
141
153
 
142
- **Optionally** you can add a `alchemy_display_name` method that returns a name representing the currently logged in user. This is used in the admin views.
143
154
 
144
- Example:
155
+ Customizing
156
+ -----------
145
157
 
146
- def alchemy_display_name
147
- "#{first_name} #{last_name}".strip
148
- end
158
+ Alchemy has very flexible ways to organize and manage content. Please be sure to read [the introduction guide](http://guides.alchemy-cms.com/edge/index.html) in order to understand the basic idea of how Alchemy works.
149
159
 
150
- Testing
151
- -------
152
160
 
153
- Before running tests (which refer to Alchemy), please make sure to run the rake task
161
+ Upgrading
162
+ ---------
154
163
 
155
- bundle exec rake alchemy:spec:prepare
164
+ The Alchemy team takes upgrades very seriously and tries to make them as smooth as we can. Therefore we have build in upgrade tasks, that try to automate as much as possible.
156
165
 
157
- to set up the database for testing.
166
+ That's why after updating the Alchemy gem you should **always run the upgrader**:
158
167
 
159
- Now you can run your tests, e. g. with RSpec:
168
+ ```shell
169
+ $ bundle update alchemy_cms
170
+ $ bin/rake alchemy:upgrade
171
+ ```
160
172
 
161
- bundle exec rspec spec/...
173
+ Alchemy will print out useful information after running the automated tasks that help a smooth upgrade path. So please **take your time and read them**.
162
174
 
163
- **Alternatively** you can just run:
175
+ Always be sure to keep an eye on the `config/alchemy/config.yml.defaults` file and update your `config/alchemy/config.yml` accordingly.
164
176
 
165
- bundle exec rake
177
+ Also, `git diff` is your friend. You are using git to track changes of your projects, right?
166
178
 
167
- This default task executes the database preparations and runs all defined test cases.
168
179
 
169
180
  Deployment
170
181
  ----------
171
182
 
172
- Alchemy ships with a generator that creates a Capistrano `config/deploy.rb` file, which
173
- takes care of everything you need to deploy an Alchemy site.
183
+ Alchemy ships with Capistrano based deployment receipts which takes care of everything you need to deploy an Alchemy site.
174
184
 
175
- So, if you don't have your own deploy file, we encourage you to use this generator:
185
+ #### Add Capistrano gem
176
186
 
177
- $ bin/rails g alchemy:deploy_script
187
+ First you need to add Capistrano to your `Gemfile`:
178
188
 
179
- If you have your own Capistrano receipts, you should require the Alchemy tasks in your app's `config/deploy.rb` file:
189
+ ```ruby
190
+ # Gemfile
191
+ gem 'capistrano', '2.15.5', group: 'development'
192
+ ```
180
193
 
181
- # deploy.rb
182
- require 'alchemy/capistrano'
194
+ **A note about Capistrano version:**
183
195
 
184
- If you don't use Capistrano you have to **make sure that the `uploads`, `tmp/cache/assets`, `public/assets` and `public/pictures` cache folders get shared** between deployments, otherwise you **will loose data**.
196
+ Alchemy's deploy script is currently **only compatible with Capistrano 2.x** ([See this pull request](https://github.com/magiclabs/alchemy_cms/pull/616) if you want to help us upgrade to 3.x).
185
197
 
186
- Please take a look into the `lib/alchemy/capistrano.rb` file, to see how to achieve this.
198
+ #### Generate the deploy file
187
199
 
188
- Upgrading
189
- ---------
200
+ To generate the deploy file you need to use this generator:
190
201
 
191
- After updating the Alchemy gem in your App, you should run the upgrader.
202
+ ```shell
203
+ $ bin/rails g alchemy:deploy_script
204
+ ```
192
205
 
193
- Run in terminal:
206
+ and follow the instructions.
194
207
 
195
- bin/rake alchemy:upgrade
208
+ If you *have your own Capistrano receipts* you can require the Alchemy tasks in your `config/deploy.rb` file:
196
209
 
210
+ ```ruby
211
+ # deploy.rb
212
+ require 'alchemy/capistrano'
213
+ ```
197
214
 
198
- Tips
199
- -----
215
+ #### Synchronize your data
216
+
217
+ Alchemy Capistrano receipts offer much more then only deployment related tasks. We also have tasks to make your local development easier. To get a list of all receipts type:
218
+
219
+ ```shell
220
+ $ bundle exec cap -T alchemy
221
+ ```
222
+
223
+ ##### Import data from server
224
+
225
+ ```shell
226
+ $ bundle exec cap alchemy:import:all
227
+ ```
228
+
229
+ This imports your servers data onto your local development machine. This is very handy if you want to clone the current server state.
230
+
231
+ ##### Export data to server
232
+
233
+ That even works the other way around:
234
+
235
+ ```shell
236
+ $ bundle exec cap alchemy:export:all
237
+ ```
238
+
239
+ **NOTE:** This will **overwrite the database** on your server. But calm down my dear friend, Alchemy will ask you to perform a backup before overwriting it.
240
+
241
+ #### Without Capistrano
200
242
 
201
- - Read the guidelines: http://guides.alchemy-cms.com.
202
- - Read the documentation: http://rubydoc.info/github/AlchemyCMS/alchemy_cms
203
- - Ask the community: http://groups.google.com/group/alchemy-cms
243
+ If you don't use Capistrano you have to **make sure** that the `uploads`, `tmp/cache/assets`, `public/assets` and `public/pictures` folders get **shared between deployments**, otherwise you **will loose data**. No, not really, but you know, just keep them in sync.
244
+
245
+ Please take a look into Alchemys [Capistrano receipt](https://github.com/magiclabs/alchemy_cms/blob/master/lib/alchemy/capistrano.rb) in order to see how you could achieve this.
246
+
247
+
248
+ Testing
249
+ -------
250
+
251
+ If you want to contribute to Alchemy ([and we encourage you to do so](https://github.com/magiclabs/alchemy_cms/blob/master/CONTRIBUTING.md)) we have a strong test suite that helps you to not break anything.
252
+
253
+ To prepare the tests of your Alchemy fork please make sure to run the preparation task:
254
+
255
+ ```shell
256
+ # ~/your/local/alchemy_cms
257
+ $ bin/rake alchemy:spec:prepare
258
+ ```
259
+
260
+ to set up the database for testing.
261
+
262
+ ##### Run your tests with:
263
+
264
+ ```shell
265
+ $ bundle exec rspec
266
+ ```
267
+
268
+ **Alternatively** you can just run:
269
+
270
+ ```shell
271
+ $ bundle exec rake
272
+ ```
273
+
274
+ *) This default task executes the database preparations and runs all defined test cases.
275
+
276
+ **A note about RSpec version:**
277
+
278
+ Alchemy specs are written **in RSpec 3**. Please **do not use depricated RSpec 2.x syntax**. Thanks
204
279
 
205
280
 
206
281
  Getting Help
207
282
  ------------
208
283
 
209
- * If you have bugs, please use the [issue tracker on Github](https://github.com/AlchemyCMS/alchemy_cms/issues).
210
- * For Q&A and general usage, please use the [User Group](http://groups.google.com/group/alchemy-cms) or the IRC channel.
211
- * New features should be discussed on our [Trello Board](https://trello.com/alchemycms). *PLEASE* don't use the Github issues for new features.
284
+ * Read the guidelines: http://guides.alchemy-cms.com.
285
+ * Read the documentation: http://rubydoc.info/github/magiclabs/alchemy_cms
286
+ * If you found a bug please use the [issue tracker on Github](https://github.com/magiclabs/alchemy_cms/issues).
287
+ * For questions about general usage please use [Stack Overflow](http://stackoverflow.com/questions/tagged/alchemy-cms), [the User Group](http://groups.google.com/group/alchemy-cms) or the [IRC channel](irc://irc.freenode.net#alchemy_cms).
288
+ * New features should be discussed on our [Trello Board](https://trello.com/alchemycms).
289
+
290
+ **PLEASE** don't use the Github issues for feature requests. If you want to contribute to Alchemy please [read the contribution guidelines](https://github.com/magiclabs/alchemy_cms/blob/master/CONTRIBUTING.md) before doing so.
212
291
 
213
292
 
214
293
  Resources
@@ -216,12 +295,14 @@ Resources
216
295
 
217
296
  * Homepage: <http://alchemy-cms.com>
218
297
  * Live-Demo: <http://demo.alchemy-cms.com> (user: demo, password: demo123)
219
- * API Documentation: <http://rubydoc.info/github/AlchemyCMS/alchemy_cms>
220
- * Issue-Tracker: <https://github.com/AlchemyCMS/alchemy_cms/issues>
221
- * Sourcecode: <https://github.com/AlchemyCMS/alchemy_cms>
298
+ * API Documentation: <http://rubydoc.info/github/magiclabs/alchemy_cms>
299
+ * Issue-Tracker: <https://github.com/magiclabs/alchemy_cms/issues>
300
+ * Sourcecode: <https://github.com/magiclabs/alchemy_cms>
222
301
  * User Group: <http://groups.google.com/group/alchemy-cms>
223
- * IRC Channel: #alchemy_cms on irc.freenode.net
302
+ * IRC Channel: <irc://irc.freenode.net#alchemy_cms>
224
303
  * Discussion Board: <https://trello.com/alchemycms>
304
+ * Twitter: <https://twitter.com/alchemy_cms>
305
+
225
306
 
226
307
  Authors
227
308
  ---------
@@ -232,7 +313,18 @@ Authors
232
313
  * Hendrik Mans: <https://github.com/hmans>
233
314
  * Carsten Fregin: <https://github.com/cfregin>
234
315
 
316
+
235
317
  License
236
318
  -------
237
319
 
238
- * BSD: <https://raw.github.com/AlchemyCMS/alchemy_cms/master/LICENSE>
320
+ * BSD: <https://raw.github.com/magiclabs/alchemy_cms/master/LICENSE>
321
+
322
+
323
+ Spread the love
324
+ ---------------
325
+
326
+ If you like Alchemy, please help us to spread the word about Alchemy and star this repo [on GitHub](https://github.com/magiclabs/alchemy_cms), upvote it [on The Ruby Toolbox](https://www.ruby-toolbox.com/projects/alchemy_cms), mention us [on Twitter](https://twitter.com/alchemy_cms) and vote for it [on Bitnami](https://bitnami.com/stack/alchemy).
327
+
328
+ That will help us to keep Alchemy awesome.
329
+
330
+ Thank you <3!