Cuca - Another Ruby Web Application Framework
Content
- 2008/06/17 - 0.04
- Fixed error-message displaying traceback but not the actual exception
- Display trace if enabled on 'stop :error' events
- Option for autoloading support files (instead of bulk 'require')
- Fixed bug where session didn't close (saved to disk) if 'stop'
was raised (fastcgi)
- 'url', 'base_path and 'path_tree' property added into urlmap class
- Priority option on filters.
- Mount option for external directories on application path
- Cleanup app.rb, removed some global variables
- get/post parameters are automaticaly visible within the session page container
- Added some unit tests
- Minor fixes in stdlib
- Some fixes in dispatchers
-
Older news in the CHANGELOG
Cuca is a light web application framework. Compared to other frameworks it
does not implement an MVC (Model/View/Controller) architecture, instead it
tries to see everything as a widget. A Widget is an element that can produce
content and is faily unlimited in its capabilities. A set of widgets handle
an http request and produce a web page.
Cuca supports CGI, FastCGI, (soon Rack), pretty URL's, layouts, sessions, unit testing and the rendering
of 'partials'.
Cuca is small - It only contains a few files
and public classes which makes it much easier to learn and extend. It
focuses just on page generation and http handling. So there is no built-in database
or email support but it works great with any external library or your choice (e.g.
ActiveRecord, DBI, ActionMailer...).
How it works (a short story):
- A Widget is a screen element. Can be a full page or part of it or
contain other widgets. The Controller and the Layout are Widgets, too.
- A Controller deals with one request URI (get, post or both) and can set variables
other widgets can make use of. It can also define a Layout and filters.
- A Layout wraps the output of a controller and finally return the
built web page.
- A Generator (NOT "code generator") can be used within any Widget to help building the web content.
Cuca comes with a Markaby and a eruby/erb Generator.
- A Session can be used optionally to keep stateful data.
The API is documented with examples. The Widgets explanations below give a
deeper impression of what can be done.
- Install the framework with: gem install --remote cuca using a
privileged user account.
- Generate a basic application skeleton:
cuca your_project_name (if you can't find your cuca executable look into
the bin directory of your rubygem path 'gem environment')
-
Enter the new created directory (cd your_project_name) and run ./scripts/server-webrick.rb.
Now open http://localhost:2000/ and you should get a simple welcome page.
- Open the generated source files and see how it works...
- Browse read the API.
So far only tested on Linux and FreeBSD - not sure if it will work on
windows
The cuca gem includes a collection of standard widgets that you are welcome
reuse in your application. Most of these widgets are in an alpha state and
might need additional support (css or javascript). I'll describe only some of them
here. They will also give a good impression of what's possible within a
widget:
- Form Widget The Form widget can help you to create/setup and validate
html forms. If you use RoR's excellent ActiveRecord library the FormWidget can create and validate
directly to a Model definition without or little extra code... Read more...
- List / DB List Many application require to display a database
list that you can search, sort by columns, join other tables and rewrite
content dynamically. The List widgets can do it, with static data or data
from sql databases... Read more...
Cuca was written by bones - <boesemar@gmx.de>
Feel free to send me comments, patches, suggestions etc..
Last updated: 2008/06/17