Saturday, July 22, 2006

Comatose Development Site

Rubyforge has been kind enough to create a project site for Comatose. I’ve enabled the following project tools for it:

Rubyforge also provides a project-specific wiki. I haven’t enabled it, at this point — If you think it’d be useful, lemme know and I can.

So from here on, if you have problems with Comatose you can add a bug ticket. Or better yet, fix it and submit a patch. ;-) If you need help with something, feel free to post on the mailing list or the help forum.

If you’ve used Comatose, I’d like to encourage you to drop by the open-discussion forum and leave a note. If you’ve done anything special with it, I’d love to hear it!

Wednesday, July 19, 2006

Comatose and PostgreSQL

Apparently, there’s an issue in Comatose that causes an error when migrating the first time when using PostgreSQL. Here’s the fix, courtesy of Lyle Troxell.

Changing comatose_page.rb’s line

acts_as_list :scope=>'parent_id'

to

acts_as_list :scope=>:parent_id

Fixes the problem.

This fix will be put in the next version...

Thanks Lyle!

Tuesday, July 18, 2006

Comatose, TNG

The response I’ve gotten on Comatose is somewhat overwhelming. I’m glad so many of you have found it useful!

Hopefully I won’t annoy you guys too much with the next release… It has quite a lot of updates, and changes. Enough to warrant this post on it as a kind of ‘heads up’.

If you’ve made customizations to the admin, and if you have used an svn:external to keep up to date with Comatose — you may want to remove the external and commit the current version (0.5) into your plugin directory… Otherwise you will need to tweak some things when I commit the next version.

In the next release, what is now the ComatoseController is going to be broken down into two separate controllers. There will still be a ComatoseController, it’s purpose will be rendering and caching pages. A new ComatoseAdminController will be the home for all of the administration tools. They will each have a before_filter that calls #authorize for authentication purposes.

The way layouts are handled internally has changed too. The controllers will now extend your ApplicationController, so you should be able to use partials and application helpers in your content layouts.

The biggest change, however, is in the page processing. Liquid will be the new default text processor. Don’t panic — ERB will still be available as a configuration option. But I really want a safer way to support content processing. To go along with that, I’m adding a simple method for adding custom functions to the processors that’ll work for both Liquid and ERB. Also, Liquid will be packaged with the plugin, so you won’t have to worry about having it as a dependency.

There are, at this point, no schema changes — so there won’t be a need for new migrations. There’s quite a few more changes I could talk about, but these are the main things that are some-what breaking changes.

I’ll be releasing the new version later this week.

Wednesday, July 12, 2006

Monstas of the Lil' Variety

Skelly

As some of you may know, I have been collaborating on a webcomic project called Lil Monstas for… Well, a little while now. OK, it’s been so long that some of you may be thinking that it’s never going to see the light of day.

Well, I’m here to tell you that Lil Monstas is alive! It’s aliiivve! Not only that, but we’ve decided on a release schedule.

So, I invite you all to visit www.LilMonstas.com on All Hallow’s Eve — October 31, 2006 for our inaugural episode! It should be a lot of fun, I hope to see you all there.

Tuesday, July 11, 2006

Comatose v0.5

Can you guess what time it is? That’s right! It’s time for another Comatose update!

So, what’s new? Here are the main things:

  • Page reordering
  • Updated administration UI
  • Parameterized inline rendering
  • Fragment caching, and a pre-caching hook if you want more control of such things
  • Better importing/exporting of pages
  • Misc. bug-fixes

New-Page-ListNew-Page-Reordering

Installation

It's as simple as ever:

$ ./script/plugin source http://mattmccray.com/svn/rails/plugins
$ ./script/plugin install comatose
$ ./script/generate comatose_migration
$ rake migrate

Or, for you (OK, us) early adopters:

$ rapt discover --no-prompt
$ rapt install comatose
$ ./script/generate comatose_migration
$ rake migrate

Then, in your routes.rb:

map.comatose_root ''

Upgrading

For those of you upgrading from version 0.4, there aren’t any new db fields — so you won’t need to worry about migrations. However, there are changes to the CSS, JavaScript, and Views. So you might want to diff those with your customized versions (if you’re customizing the Admin).

Oh, and I’ve also bit the bullet and added a few images to spice it up. For new installations, it’ll automatically copy them into RAILS_ROOT/public/images/comatose/.

For existing installations, you’ll want to run:

$ rake comatose:copy_images

That should pretty much do it. Don’t forget to glance over the 400+ line README file.

From the ChangeLog:

[version 0.5]
* Added support for parameterized inline rendering of comatose pages. Use
like a partial: render :comatose=>'path', :locals=>{:username=>'stuff'}
the locals hash will be sent to the ERB context for use when rendering
the page.
* Support for a Hash ERB context exists all the way down to the TextFilters.
* Initial support for fragment caching for inline rendering. It's turned off
by default. Send :use_cache=>true in the render :comatose=>'' tag to use it.
Caching will also not be used if you are sending the page parameters via the
ActionController::Base.fragment_cache_store
* Return reloadable? false for the ComatoseController by default... This
should prevent the development mode hassles people have been having.
* Updated data migration tasks to better support nested pages.
- comatose:data:export FROM=page_path TO_FILE=file_path
- comatose:data:import TO=page_path FROM_FILE=file_path
- FROM_FILE and TO_FILE default to 'db/comatose-pages.yml'
- FROM and TO default to '', the page tree root
* Fixed 'Clear Page Cache' bug -- it didn't handle the page root being an
array like it should have.
* Removed :page_title and :page_keywords from session
* Updated the rails_version in the about.yml to 1.1+ -- just because I
haven't tested it on anything less than that. If you have, and it works,
let me know!
* Adds the utf8 header to all output (text/html; charset=utf-8). Use
ComatoseController.force_utf8 = false to disable.
* Initial support for page reordering (via AJAX)
* Updated the administration look-n-feel.

Enjoy! As always, if you have any questions/problems feel free to give me a shout.