updated gemspec and even some README
Oleg
committed Oct 19, 2010
commit 9e128989b18de8f26be74c4c4fb1de98585318ae
Showing 3
changed files with
115 additions
and 11 deletions
Gemfile
+1
-1
| @@ | @@ -1,6 +1,6 @@ |
| source 'http://rubygems.org' | |
| - | gem 'rails', '3.0.0' |
| + | gem 'rails', '>=3.0.0' |
| gem 'sqlite3-ruby', :require => 'sqlite3' | |
| gem 'active_link_to', '>=0.0.6' | |
| gem 'paperclip', '>=2.3.3' | |
README.md
+83
-1
| @@ | @@ -1,4 +1,86 @@ |
| Comfortable Mexican Sofa (CMS) | |
| ============================== | |
| - | TODO |
| \ No newline at end of file | |
| + | What is this? |
| + | ------------- |
| + | Comfortable Mexican Sofa is a Content Management System with an obnoxious name. Also it's a Rails 3 Engine. This means that you can use it as a stand-alone application and also as an Engine for your existing application. |
| + | |
| + | Installation |
| + | ------------ |
| + | |
| + | ### Stand-alone |
| + | TODO: Need to create some sort of setup, so you can simply run: |
| + | |
| + | $ comfortable_mexican_sofa my_new_app |
| + | |
| + | ### As a Rails Engine |
| + | Add gem definition to your Gemfile: |
| + | |
| + | config.gem 'comfortable_mexican_sofa' |
| + | |
| + | Then from the Rails project's root run: |
| + | |
| + | bundle install |
| + | rails g cms |
| + | rake db:migrate |
| + | |
| + | At this point you should have database structure created, some assets copied to /public directory and initializer set up: |
| + | |
| + | ComfortableMexicanSofa.configure do |config| |
| + | config.cms_title = 'ComfortableMexicanSofa' |
| + | config.authentication = 'ComfortableMexicanSofa::HttpAuth' |
| + | end |
| + | |
| + | # Credentials for CmsHttpAuthentication |
| + | ComfortableMexicanSofa::HttpAuth.username = 'username' |
| + | ComfortableMexicanSofa::HttpAuth.password = 'password' |
| + | |
| + | Usage |
| + | ----- |
| + | |
| + | Now you should be able to navigate to http://yoursite/cms-admin |
| + | |
| + | ### Step 1: Create Site |
| + | CMS allows you to run multiple sites from a single installation. Each site is attached to a hostname. For the first time you'll be prompted to set up the initial site. Hostname will be pre-populated so just choose a label. |
| + | |
| + | ### Step 2: Create Layout |
| + | Before creating pages and populating them with content we need to create a layout. Layout is the template of your pages. It defines some reusable content (like header and footer, for example) and places where the content goes. A very simple layout can look like this: |
| + | |
| + | <html> |
| + | <body> |
| + | <h1>My Awesome Site</h1> |
| + | <cms:page:content> |
| + | </body> |
| + | </html> |
| + | |
| + | So there's your layout and the `<cms:page:content>` defines a place where renderable `content` will go. There's just a handful of tags that you can use. |
| + | |
| + | *Page Blocks* are pieces of content that will be output on the page: |
| + | |
| + | <cms:page:some_label:text> # same as <cms:page:some_label>, will render a text area during page creation |
| + | <cms:page:some_label:string> # will render a text field during page creation |
| + | <cms:page:some_label:datetime> # datetime select widget |
| + | <cms:page:some_label:integer> # a number field |
| + | |
| + | *Page Fields* are pieces of content that are not rendered. They are useful for hidden values you want to use inside your app. |
| + | |
| + | <cms:field:some_label:text> # text area for the page creation form |
| + | <cms:field:some_label:string> # same as <cms:field:some_label>, this is a text field |
| + | <cms:field:some_label:datetime> # datetime |
| + | <cms:field:some_label:integer> # a number field |
| + | |
| + | *Snippets* bits of reusable content that can be used in pages and layouts |
| + | |
| + | <cms:snippet:snippet_slug> |
| + | |
| + | *Partials* are exactly that. You don't want to do IRB inside CMS so there's a handy tag: |
| + | |
| + | <cms:partial:path/to/partial> |
| + | |
| + | You don't have to define entire html layout, however. You can simply re-use your application one. Page content will be yielded into it like any normal view. |
| + | |
| + | TODO: more stuff |
| + | |
| + | ### Step 3: Create Page |
| + | |
| + | TODO: You pres butan page is created. Yay! |
comfortable_mexican_sofa.gemspec
+31
-9
| @@ | @@ -5,11 +5,11 @@ |
| Gem::Specification.new do |s| | |
| s.name = %q{comfortable_mexican_sofa} | |
| - | s.version = "1.0.1" |
| + | s.version = "1.0.2" |
| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | |
| s.authors = ["Oleg Khabarov", "The Working Group Inc"] | |
| - | s.date = %q{2010-10-14} |
| + | s.date = %q{2010-10-19} |
| s.description = %q{} | |
| s.email = %q{oleg@theworkinggroup.ca} | |
| s.extra_rdoc_files = [ | |
| @@ | @@ -26,12 +26,14 @@ Gem::Specification.new do |s| |
| "app/controllers/cms_admin/base_controller.rb", | |
| "app/controllers/cms_admin/layouts_controller.rb", | |
| "app/controllers/cms_admin/pages_controller.rb", | |
| + | "app/controllers/cms_admin/sites_controller.rb", |
| "app/controllers/cms_admin/snippets_controller.rb", | |
| "app/controllers/cms_admin/uploads_controller.rb", | |
| "app/controllers/cms_content_controller.rb", | |
| "app/models/cms_block.rb", | |
| "app/models/cms_layout.rb", | |
| "app/models/cms_page.rb", | |
| + | "app/models/cms_site.rb", |
| "app/models/cms_snippet.rb", | |
| "app/models/cms_upload.rb", | |
| "app/views/cms_admin/layouts/_form.html.erb", | |
| @@ | @@ -46,6 +48,10 @@ Gem::Specification.new do |s| |
| "app/views/cms_admin/pages/form_blocks.js.erb", | |
| "app/views/cms_admin/pages/index.html.erb", | |
| "app/views/cms_admin/pages/new.html.erb", | |
| + | "app/views/cms_admin/sites/_form.html.erb", |
| + | "app/views/cms_admin/sites/edit.html.erb", |
| + | "app/views/cms_admin/sites/index.html.erb", |
| + | "app/views/cms_admin/sites/new.html.erb", |
| "app/views/cms_admin/snippets/_form.html.erb", | |
| "app/views/cms_admin/snippets/edit.html.erb", | |
| "app/views/cms_admin/snippets/index.html.erb", | |
| @@ | @@ -64,6 +70,7 @@ Gem::Specification.new do |s| |
| "config/environments/development.rb", | |
| "config/environments/production.rb", | |
| "config/environments/test.rb", | |
| + | "config/initializers/comfortable_mexican_sofa.rb", |
| "config/initializers/mime_types.rb", | |
| "config/initializers/paperclip.rb", | |
| "config/locales/en.yml", | |
| @@ | @@ -72,10 +79,7 @@ Gem::Specification.new do |s| |
| "db/seeds.rb", | |
| "doc/README_FOR_APP", | |
| "lib/comfortable_mexican_sofa.rb", | |
| - | "lib/comfortable_mexican_sofa/cms_acts_as_tree.rb", |
| - | "lib/comfortable_mexican_sofa/cms_engine.rb", |
| - | "lib/comfortable_mexican_sofa/cms_form_builder.rb", |
| - | "lib/comfortable_mexican_sofa/cms_rails_extensions.rb", |
| + | "lib/comfortable_mexican_sofa/acts_as_tree.rb", |
| "lib/comfortable_mexican_sofa/cms_tag.rb", | |
| "lib/comfortable_mexican_sofa/cms_tag/field_datetime.rb", | |
| "lib/comfortable_mexican_sofa/cms_tag/field_integer.rb", | |
| @@ | @@ -87,6 +91,13 @@ Gem::Specification.new do |s| |
| "lib/comfortable_mexican_sofa/cms_tag/page_text.rb", | |
| "lib/comfortable_mexican_sofa/cms_tag/partial.rb", | |
| "lib/comfortable_mexican_sofa/cms_tag/snippet.rb", | |
| + | "lib/comfortable_mexican_sofa/configuration.rb", |
| + | "lib/comfortable_mexican_sofa/controller_methods.rb", |
| + | "lib/comfortable_mexican_sofa/engine.rb", |
| + | "lib/comfortable_mexican_sofa/form_builder.rb", |
| + | "lib/comfortable_mexican_sofa/http_auth.rb", |
| + | "lib/comfortable_mexican_sofa/rails_extensions.rb", |
| + | "lib/comfortable_mexican_sofa/view_methods.rb", |
| "lib/generators/README", | |
| "lib/generators/cms_generator.rb", | |
| "public/404.html", | |
| @@ | @@ -113,20 +124,26 @@ Gem::Specification.new do |s| |
| "test/fixtures/cms_blocks.yml", | |
| "test/fixtures/cms_layouts.yml", | |
| "test/fixtures/cms_pages.yml", | |
| + | "test/fixtures/cms_sites.yml", |
| "test/fixtures/cms_snippets.yml", | |
| "test/fixtures/cms_uploads.yml", | |
| "test/fixtures/files/invalid_file.gif", | |
| "test/fixtures/files/valid_image.jpg", | |
| - | "test/functional/cms_admin/base_controller_test.rb", |
| "test/functional/cms_admin/layouts_controller_test.rb", | |
| "test/functional/cms_admin/pages_controller_test.rb", | |
| + | "test/functional/cms_admin/sites_controller_test.rb", |
| "test/functional/cms_admin/snippets_controller_test.rb", | |
| "test/functional/cms_admin/uploads_controller_test.rb", | |
| "test/functional/cms_content_controller_test.rb", | |
| + | "test/integration/authentication_test.rb", |
| + | "test/integration/render_cms_test.rb", |
| + | "test/integration/sites_test.rb", |
| "test/test_helper.rb", | |
| "test/unit/cms_block_test.rb", | |
| + | "test/unit/cms_configuration_test.rb", |
| "test/unit/cms_layout_test.rb", | |
| "test/unit/cms_page_test.rb", | |
| + | "test/unit/cms_site_test.rb", |
| "test/unit/cms_snippet_test.rb", | |
| "test/unit/cms_tag_test.rb", | |
| "test/unit/cms_tags/field_datetime_test.rb", | |
| @@ | @@ -148,16 +165,21 @@ Gem::Specification.new do |s| |
| s.rubygems_version = %q{1.3.7} | |
| s.summary = %q{ComfortableMexicanSofa is a Rails Engine CMS gem} | |
| s.test_files = [ | |
| - | "test/functional/cms_admin/base_controller_test.rb", |
| - | "test/functional/cms_admin/layouts_controller_test.rb", |
| + | "test/functional/cms_admin/layouts_controller_test.rb", |
| "test/functional/cms_admin/pages_controller_test.rb", | |
| + | "test/functional/cms_admin/sites_controller_test.rb", |
| "test/functional/cms_admin/snippets_controller_test.rb", | |
| "test/functional/cms_admin/uploads_controller_test.rb", | |
| "test/functional/cms_content_controller_test.rb", | |
| + | "test/integration/authentication_test.rb", |
| + | "test/integration/render_cms_test.rb", |
| + | "test/integration/sites_test.rb", |
| "test/test_helper.rb", | |
| "test/unit/cms_block_test.rb", | |
| + | "test/unit/cms_configuration_test.rb", |
| "test/unit/cms_layout_test.rb", | |
| "test/unit/cms_page_test.rb", | |
| + | "test/unit/cms_site_test.rb", |
| "test/unit/cms_snippet_test.rb", | |
| "test/unit/cms_tag_test.rb", | |
| "test/unit/cms_tags/field_datetime_test.rb", | |