[Nitro] [ANN] Nitro + Og 0.15.0
George Moschovitis
george.moschovitis at gmail.com
Mon Apr 4 05:21:04 EDT 2005
Hello everyone,
new versions of Nitro and Og were just released.
Homepage + Downloads: http://nitro.rubyforge.org
A great release. Many cool new features and tons of subtle
improvements. We also welcome a new core developer, Anastastios
Koutoumanos, who's first contribution is the new SqlServer adapter.
Most notable additions:
* Advanced localization support:
locale_en = {
'See you' => 'See you',
:long_paragraph => 'The best new books, up to 30% reduced price',
:price => 'Price: %d %s',
:proc_price => proc { |value, cur| "Price: #{value} #{cur}" }
}
locale_de = {
'See you' => 'Auf wieder sehen',
...
}
lc = Localization.get
lc['See you'] -> See you
lc[:price, 100, 'euro'] -> Price: 100 euro
lc = Localization.get[:de]
lc['See you'] -> Auf wiedersehen
Using the LocalizationShader you can have templates like this:
<h1>[[This is a localized]] String</h1>
<p>
do you [[:like]] this?
</p>
All strings enclosed in [[ ]] are replaced with localized
versions (honouring the session locale). Localization rules can also
be provided with a .yml file. Check out the updated blog example.
* Dynamic/Parametrised mixins. A great extension to Ruby's mixin
feature. The Og::list implementation is replaced with the new
Orderable dynamic mixin, here is an example:
class Comment
property :body, String
belongs_to :article, Article
include Orderable, :scope => article
end
c.move_higher
The Orderable mixin uses the :scope parameter to dynamically alter
the methods appended to the Comment class. This new feature will be
used throughout the platform.
* NestedSets mixin:
class Comment
include NestedSets
end
or
class Comment
include Hierarchical, :method => :nested_sets
end
c.add_comment(child_comment)
c.full_children
c.direct_children
c.children
this is a reimplementation of the SqlTraversable mixin
available in older versions.
* Improved templating system. Now allows <% %> intrerpolators
and provides a number of html morphing effects:
<div if="admin">
admin interface
</div>
<ul>
<li each="u in @users">#{u.first_name} #{u.last_name}
</ul>
and more...
* Og provides an SqlServer adapter out of the box.
* Improved scaffolding code (still a lot more to come).
* Build default environment, introduced nitro and nitrogen
commands to help new users.
* Many, many small improvements and fixes.
--
http://nitro.rubyforge.org
http://www.joy.gr
More information about the Nitro-general
mailing list