[ANN] Nitro + Og 0.12.0

  • Thread starter George Moschovitis
  • Start date
G

George Moschovitis

Hello everyone,

new versions of Nitro and Og were just released.

Homepage: http://www.rubyforge.com/projects/nitro

A careful blend of new features and subtle improvements
to the existing infrastructure. Some important bugs where
fixed aswell.

Most notable additions:

* Nitro allows the definition of metadata for each action.
Routing (rewrite) rules, parameter constrains, hierarchy information
and custom data can easily be attached to actions:

def view
@entry = Article[@oid]
end
action :view, :route => /view\/(.*)/, 'oid' => 1

just browse

view/1

and @oid is automatically initialized with request['oid']

Browse the source to see how to add additional constrains,
more is comming in the next version. This feature replaces
the non portable ParseTree implementation. The scaffolder
is updated to generate routings for nice urls.

* Og automatically generates finders for all properties, for
even easier (and portable) querying:

class Article
property :title, :body, String
property :hits, Fixnum
property :create_time, Time
end

you get the finders:

Article.find_by_title
Article.find_by_body
Article.find_by_hits
Article.find_by_create_time

The finders take into account the unique constrain, to return
an array or just an object* Og introduces lifecycle observers to
avoid 'poluting' the model
objects with excess functionality. You can use every object
as observer (duck typing) or extend from an AR style Observer
class. The observer callbacks are precompiled in the lifecycle
methods only if defined, so the perfomance is not affected
in the general case.

* Factored out templating engine, can now be used in stand-alone
mode. Usefull for example to render email templates etc:

template = %q{
Hello #{user}

dont forget the following facts:

<?r for item in items ?>
<li>#{item}</li>
<?r end ?>
}

user = 'gmosx'
items = %w{ nitro is really great }
out = '' # the rendered template comes here.

Template.process(template, :eek:ut, binding)

* New options in the default runner:

--render crawls a web application and renders all pages
as static html files. Allows you to leverage Nitro's
advanced templating features to generate static sites.

--crawl spiders the application, useful for testing.

* Better error page, with more information (see blog example).

* Fixed Og bug: multiple many_to_many relations with the
same target class.

* further code cleanup, improved examples and more.
as needed.


Nitro is an efficient, yet simple engine for developing professional
Web Applications using the Ruby language. Nitro aims to provide a
robust infrastructure for scalable web applications that can be
distributed over a server cluster. However, Nitro can also power simple
web applications for deployment on intranets or even personal
computers. Nitro integrates the powerful Og Object-Relational mapping
library.

Nitro is a multiparadigm application framework and will integrate ideas
from Rails, Wee, PHP, JSP and .NET

Nitro integrates the Og (ObjectGraph) object-relational mapping
library. Og provides transparent serialization of object graphs to a
RDBMS backend. Unlike other similar libraries Og maps standard Ruby
objects to SQL tables and not vice versa. Og provides a meta language
to describe the relations between objects, a flexible and intuitive api
for querieng the database, raw access to the SQL language if needed
(for example to fine tune the automatically generated SQL tables, or
for custom queries), suports deserialization to Ruby objects or tuples,
automatically generates join tables for many_to_many relations
and provides a collection of usefull Mixins to synthesize common
Entities.

Og is a combination of the best features of Active Record and the
former O-R mapping library included in Nitro (NDB). Adapters for
PostgreSQL, MySQL, SQLite and Oracle are included.

I hope this software will be useful for you, and I would love to
receive your suggestions, ideas and bug reports.

have fun,
George Moschovitis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top