Nitro (web framework)

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Nitro
Developer George Moschovitis
Latest release 0.42
OS Cross-platform
Natural language(s) Ruby
Genre Web application framework
License BSD License
Website nitroproject.org

Nitro is a Ruby-based web application framework. Created by George Moschovitis, Nitro is written in Ruby and uses Ruby syntax and Ruby concepts. Nitro feautures a powerful template system, with a configurable pipeline of transformation steps. It is licensed under a 3-clause BSD license.

A key philosophy of Nitro is that it does not dictate how a web application should be structured. It is possible to mainly use templates with embedded code, as is typical with PHP or ASP. One can equally use a model-view-controller approach, as found in for instance Ruby on Rails, or expand even further with a custom architectural pattern.

Nitro features support for Ajax, XML, web services and syndication while staying standards compliant.

One of its key distinctions from other similar frameworks is its use of Og as the object-relational database mapping layer. Og can create database tables based on Ruby classes, or it can be easily adapted to use an existing database schema.

Contents

The persistence framework developed together with Nitro is named Og, short for ObjectGraph. It is an object-relational mapping (ORM) system that allows for storage and retrieval of Ruby objects from a backend store. This can be an RDBMS, but this does not necessarily have to be so. A backend adapter has been developed that stores objects in individual YAML files on the filesystem.

Og will infer the database structure from the definition of classes that are managed by it. Database tables will be created by Og as necessary. This is different from the ActiveRecord approach used in Rails where the developer is responsible for creating the database tables. Og currently does not attempt to adapt the database schema to changing class definitions, in this case the developer must either manually adapt the schema, or remove the affected tables and let Og recreate them.

Og can also be made to work with an existing (legacy) schema, by supplying hints as to which column is used to store a particular property.

require "nitro"
class MyController
  def index; "Hello from nitro!"; end
end
Nitro.start MyController

This example demonstrates morphers, one of the available transformations for templates. This will result in a dropdown list containing the numbers 1 to 31, with the current day selected.


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.