From: George Moschovitis Date: 2005-07-12T19:55:50+09:00 Subject: [ANN] Nitro + Og 0.20.0 AJAX, Wee integration, Configuration, Mixins, Docs Hello everyone, new versions of Nitro and Og were just released: Homepage + Downloads: http://www.nitrohq.com Mailing List: http://rubyforge.org/mailman/listinfo/nitro-general Another superb release! State of the art AJAX/Javascript support, Wee components / programmatic renderer integration, a beginners tutorial, self documenting configuration and many important bug fixes. Don't forget to check out our new community site at http://www.nitrohq.com Some notable changes: * Ajax is THE buzzword at the moment, and Nitro provides the best support you can find. Nitro fully separates the behaviour from the template using the behaviour.js library and allowing for dynamic injection of ajax functionality. The generated code contains clean html and all the javascript organized in a single See how a normal tag is converted transparently to an Ajax request. The prototype, scriptacoulous and behaviour js libraries are used. The ajax support in this release is a PREVIEW. Stay tuned for major improvements (and some surprises) in the next version. * Wee Components integration. Nitro now transparently integrates Wee components. This is truly a win-win situation. Wee applications can use Nitro's infrastructure. Nitro applications can use extremely reusable, stateful Components. For a demonstration check out the new Wee example in the examples distribution! Wee 0.9.0 is needed! Even better interoperability with Wee is coming soon. Nitro plays well with the others, and always provides more options. * Mixins are modules of functionality that can be mixed into Controllers. The developer can explicitly include Mixins or use Nitro conventions to have helper Mixins automatically included: class MyController .. end module MyControlllerMixin # gets automatically mixed in end This works just like Og Mixins. * Brand new, self-documenting configuration system. There is a new keyword for defining configuration settings: Here is an example: class Render setting :template_extension, :default => 'xhtml', :doc => 'The default template extension' end class Session setting :store, :default => 'memory', :doc => 'The session store' end You can configure the Application using ruby code or yaml files: Render.template_extension = 'xhtml' Session.store = 'drb' or Render: template_extension: xhtml Session: store: drb You can access all defined settings: Configuration.settings.each { |s| ... } You can view the settings of the application along with documentation on the following url: www.myapp.com/settings This feature is also a PREVIEW. Will be used a lot more in the next release. * CherryPy style published objects. Nitro allows you to publish any Ruby object. Here is the new hello world example: class HelloWorld def index print 'Hello World' end def add(val) print "added: #{val + 2}" end end App.start(HelloWorld) Now, point your browser to localhost:/ or localhost/add?val=2 If you need the advanced controller functionality just extend your published object from the Controller base class. The normal heuristics to decide which method is safe to publish are aplied. * CherryPy-style dispatcher configuration, provides another way to define mounting points for Controllers and published objects. Here is an example: server = Server.new server.root = MainController # / server.root.fora = ForaController # /fora server.root.wiki = WikiController # /wiki server.root.really.deep = DeepController # /really/deap * Improved pager interface. Thanks to the new PagerMixin, presenting paged lists is easier (and as efficient) than ever: items, pager = paginate(Article, :per_page => 5, :order => 'date DESC') * Added better sql injection protection in Og sql stores. * Fixed Mysql store reconnect bug. * Og falls back to pure ruby adapters for Mysql and Postgres, to make it easier to run out of the box. Please, don't forget to switch to the natively compiled adapters for production sites. * This is surely the most request feature: Nitro Step by Step by James Britt, a beginers guide to Nitro. Available in the brand-new, Nitro-powered, www.nitrohq.com Community wiki. * New examples: The totaly recoded and ultra cool ajax example, a Wee/Nitro example and the new Hello world example. * Cleaned up a lot of source files. * Many, many, many bug fixes and small improvements. This release fixes all reported bugs in the spirit of out zero-bug tolerance philosophy. I hope this software will be useful to you, and I would love to receive your suggestions, ideas and bug reports. have fun, George Moschovitis