Comatose v2 Beta

Posted
M@
on 10.30.2008, tagged: news, releases. .

Wow. It's been a really long time since I've updated the dev site, eh? Well, Comatose isn't dead. It's just been sleeping. Deeply. :-)

Seriously though, a while ago I quietly started working on Comatose 2. It's Rails 2 compatible. In fact, there is a beta version on GitHub right now. Check it out.

From the Changelog

  • version: 2.0.3 (beta)

    • Moving from alpha to beta!
    • staugaard: Added import and export of pages in admin controller
  • version: 2.0.2 (alpha)

  • version: 2.0.1 (alpha)

    • Merged changes from andreas...
    • andreas: Fixed comatose:admin:customize rake task (seems plugin_path was wrong, and made use of mkdir_p to avoid "File exists"-errors.)
    • andreas: Added "unloadable" to ComatoseAdminController (problems with ActsAsAuthenticated-integration similar to http://tinyurl.com/6caz5r)
  • version: 2.0 (uber alpha)

    • Removed controllers, models, and helpers from Comatose module. It was causing odd issues
    • Initial support for Rails 2.1(ish)
    • Fixed up slug generation to remove leading and trailing whitespace
    • Moved to github
    • Changed all the .rhtml files to .html.erb
    • Adding support for use as a gem plugin

Some Thanks Yous

You may notice from the Changelog that there have been some patches from other githubbers... Thanks andreas, jcnetdev, and staugaard! Hopefully this will be the start of a trend. :-)

Also, thank you very much to those of you who have donated monetarily to Comatose! It's very much appreciated, and it's encouraged me to get back and update Comatose.

Oh, as long as I'm on the topic of 'Thanks yous'. I'm not sure if I ever mentioned this, but the fun 'Comatose' logo at the top of the page here was contributed by Desbytree. Thanks!

Coming Up/Ideas

I have a few ideas for where I'd like to take Comatose next, here's a high-level overview.

  • Improvements in the ComatoseAdminController to reduce number of DB calls for building the page tree.
  • Remove dependency on acts_as_list and acts_as_tree.
  • A script to automatically create rails test harnesses.
  • UI refresh (nothing major, just some cleanup).
  • RESTful goodness.
  • Support XML/JSON responses from ComatoseController and ComatoseAdminController.
  • Support for static rendering (for generating sites like this blog).

If you find any bugs, feel free to report them -- or -- just fork your own version of Comatose and start hacking!

Have anything to add? You can email me at matt at elucidata dot net.

Version 0.8.1 Released

Posted
M@
on 06.29.2007, tagged: releases. .

I know it's been a long time coming, but here it is: Comatose 0.8.1!

Over the next few days, I'll be transitioning from RubyForge over to Google Code and Google Groups please start using them for reporting bugs and such.

Here are the important URLs:

I've also updated the docs to reflect the new 0.8+ way of doing things. They'll wind up on the wiki so that they'll be easily maintained by all.

From the changelog:

  • All includes and helpers are loaded at the end of the ComatoseController and ComatoseAdminController classes
  • Fixed the ComatoseController#show action to correctly send an HTTP status of 404 even if it finds, and renders, a page at '/404'
  • Fixed the migration to default a page's full_path to '' instead of null
  • Formalized ComatoseDrops. Use Comatose.define_drop "drop_name", do ... end. Every method within that block should return a value for use with a Liquid and/or ERB template. Usage in a comatose page: {{ drop_name.def_name }}
  • Added support for a config.after_setup block that gets called after Comatose is setup (in the Dispatcher#to_prepare event)
  • Added HTML comment output for calls that result in a method_missing on the ProcessingContext
  • Updated page tree to remember collapsed/expanded nodes between page visits
  • Fixed some errors that were caused by null revisions (usually happened after initial installation)
  • Added my javascript test_runner lib for testing slugs generated by JavaScript. More JS tests to come.
  • Bugfix #8640 (rubyforge bug)

And from Version 0.8 (the version before):

  • Now ONLY supports Rails 1.2 (not even tested in Rails 1.1)
  • New configuration system
  • DEFER_COMATOSE_LOAD is gone -- Using Dispatcher.to_prepare replaces it
  • You no longer extend the base classes to add functionality. You configure Comatose to include modules and send it symbols for providing said functionality. e.g. Comatose.config.includes << :authentication_system; Comatose.config.authorization = :require_login
  • The automatic loading of RAILS_ROOT/lib/comatose/*.rb files is NO longer supported.
  • In addition to mapping comatose_root in your routes.rb, you'll want to map.comatose_admin as well

DevSite Updated

Posted
M@
on 05.06.2007, tagged: devsite. .

There have been a noted lack of updates around here lately... Sorry about that. It's partially because I've been pretty busy, and partially because the tool I was using to maintain this site was rather cumbersome.

So, here's the new -- and easier to update -- development site!

In the next few days I'll be posting an update on version 0.8, and talk about where Comatose is heading from here. Stay tuned!

Another Day, Another Update: 0.7.1

Posted
M@
on 09.21.2006, tagged: releases. .

As most of you will know, Comatose has been having a few problems co-existing with some kinds of plugins lately. The problems seem to be caused, at least in part, because the comatose controllers extend ApplicationController and therefore require the application.rb before the rest of the plugins load.

Plus, some plugins seem to take issue with any previous plugins defining an Active Record model before they’re loaded—very picky stuff.

To combat this, I’ve added a DEFER_COMATOSE_LOAD flag (it’s an ENVironment variable).

When the plugin initializes it will check the flag, if it’s set to true it won’t load the controllers or the models. You’ll tell Comatose to load at the bottom of your environment.rb file, which will load the controllers and models after the rest of your app.

By default, the flag is set to false for backward compatibility.

Test It Out!

So if you’ve been having problems using Comatose with other plugins, or applications, please give this version a shot.

After you’ve re-installed the plugin, just open your config/enviroment.rb and at the top, next to where the RAILS_ENV is set, add this:

ENV['DEFER_COMATOSE_LOAD'] = 'true'

Then, at the bottom of your enviroment.rb add:

Comatose.load

That’s it! Now Comatose will be loaded after the rest of your application which should make it work with most plugins and applications.

Update: Sean recommended this much improved method of enabling “compatibility mode”. Thanks!

DevBlog Update

Oh, I’ve tweaked the devblog feed, so this should be the last time you get all those duplicates in NetNewsWire—Hopefully. It’s funny, I don’t have that problem in NewsFire.

Comatose 0.7 Released!

Posted
M@
on 09.20.2006, tagged: releases. .

Comatose version 0.7 is ready to go! This release features:

  • Page versioning
  • Automatic loading of comatose extension scripts from RAILSROOT/lib/comatose/
  • And, of course, bug-fixes (previewing no longer modifies the page record -- that was a big bug that slipped through the cracks)

Page Versions

Only content fields are versioned, namely: title, body, slug, and keywords. Which is to say that they're the only ones, if changed, that will trigger the creation of a new version.

The versions view shows the current version on the left side, and the selected older version on the right. You can change which older version is shown, and mark the older one as the current version.

There's also a new database table to support all this so... You guessed it: A new migration. But it's still as easy as ever. If you're upgrading from version 0.6.9, you can run:

$ ./script/plugin remove comatose
$ ./script/plugin install comatose
$ ./script/generate comatose_migration --upgrade --from=0.6
$ rake migrate

That's it. If you're upgrading from an even older version, no big deal - just make sure and specify the version in the from parameter ( --from=#.#).

Versioning is supported using Rick Olsen's excellent acts_as_versioned library (included with Comatose).

Comatose Extension Scripts Folder

Comatose will now automatically load all *.rb files in the RAILS_ROOT/lib/comatose folder (if it exists). If you put your comatose-specific customizations, tags, and filters in that folder, then you won't need to muck around in your environment.rb file anymore.

Using Comatose With rForum

Posted
M@
on 08.31.2006, tagged: tips n tricks. .

Several people have been reporting issues with rForum. The error messages can be a little deceiving, leading you to believe the error is in navbar.rb or a @Localization@ class.

Actually, the problem has to do with Rails' loading sequence. Plugin code is loaded before the application code. In some applications this can lead to problems.

So, you have two options for fixing the rForum problem.

Option One

Remembering that plugins are loaded alphabetically, we create a simple plugin that will load before Comatose that includes the appropriate rForum startup code.

In the console, enter:

./script/generate plugin 01_app_loader

It should spit out:

  create  vendor/plugins/01_app_loader/lib
  create  vendor/plugins/01_app_loader/tasks
  create  vendor/plugins/01_app_loader/test
  create  vendor/plugins/01_app_loader/README
  create  vendor/plugins/01_app_loader/Rakefile
  create  vendor/plugins/01_app_loader/init.rb
  create  vendor/plugins/01_app_loader/install.rb
  create  vendor/plugins/01_app_loader/lib/01_app_loader.rb
  create  vendor/plugins/01_app_loader/tasks/01_app_loader_tasks.rake
  create  vendor/plugins/01_app_loader/test/01_app_loader_test.rb

Then you open the vendor/plugins/01_app_loader/init.rb file and paste this into it:

require RAILS_ROOT + '/config/app'

That's it! It should work now, as you'd expect.

Option Two

Update the vendor/plugins/comatose/init.rb and add the same require RAILS_ROOT + '/config/app' to the very top of the file.

I don't really recommend this way, however. You'd have to redo it if you updated Comatose.

Notes

If you've already installed Comatose, you'll need to uninstall it before you create the new plugin. After you've pasted the startup code, you can re-install Comatose, generate the migration and go to town!