Posted By: George Moschovitis
Date: 2005-03-07 20:42
Summary: Nitro + Og 0.12.0
Project: 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 as needed.

* 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, :out, 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.

Latest News
v13.5.0 Released !!
    id 774 - 2013-05-18 12:28
Runt v0.9.0 Released
    Matthew Lipper - 2013-05-17 00:11
kramdown 1.0.2 released
    Thomas Leitner - 2013-05-09 06:58
mime-types 1.23 Released
    Austin Ziegler - 2013-04-21 01:41
diff-lcs 1.2.4 Released
    Austin Ziegler - 2013-04-21 00:08

 

Forums | Admin

Discussion Forums: nitro---og-0.12.0-

Start New Thread Start New Thread

 

Topic Topic Starter Replies Last Post