Sinatra (software)
Encyclopedia
Sinatra is a free and open source web application library and domain-specific language written in Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

. It is an alternative to other Ruby web application frameworks such as Ruby on Rails
Ruby on Rails
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.-History:...

, Merb
Merb
Merb, short for "Mongrel+Erb", is a model–view–controller web framework written in Ruby. Merb adopts an approach that focuses on essential core functionality, leaving most functionality to plugins. Merb was merged into Rails web framework on December 23, 2008 as part of the Ruby on Rails 3.0...

, Nitro
Nitro (web framework)
Nitro was a Ruby-based web application framework created by George Moschovitis. Nitro featured a powerful template system with a configurable pipeline of transformation steps. It was licensed under a 3-clause BSD license....

, Camping
Camping (microframework)
Camping is a web application framework written in Ruby which consistently stays under 4kb - the complete source code can be viewed on a single page....

, and Rango
Rango (web framework)
Rango is an open source web application framework for the Ruby programming language, which is inspired by Django and Merb. It follows the Model-view-controller pattern, using Django terminology .-External links:**...

. It is dependent on the Rack
Rack (web server interface)
Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between into a single method call.Rack is...

 web server interface.

Designed and developed by Blake Mizerany, Sinatra is small and flexible. It does not follow the typical model-view-controller pattern that is seen in other frameworks, such as Ruby on Rails. Instead, Sinatra focuses on "quickly creating web-applications in Ruby with minimal effort."

Some notable companies that use Sinatra include Apple, BBC
BBC
The British Broadcasting Corporation is a British public service broadcaster. Its headquarters is at Broadcasting House in the City of Westminster, London. It is the largest broadcaster in the world, with about 23,000 staff...

, LinkedIn
LinkedIn
LinkedIn is a business-related social networking site. Founded in December 2002 and launched in May 2003, it is mainly used for professional networking. , LinkedIn reports more than 120 million registered users in more than 200 countries and territories. The site is available in English, French,...

, Engine Yard
Engine Yard
Engine Yard is a San Francisco, California based company focused on Ruby on Rails deployment and management-Software development:One of Engine Yard's four founders, Ezra Zygmuntowicz, was the creator of the Merb project, and the company continued supporting the project by hiring Yehuda Katz to work...

, Heroku
Heroku
Heroku is a cloud Platform as a Service run by the San Francisco, California-based company with the same name. Heroku led the way for a multi-language PaaS, introducing the 'polyglot platform'. Heroku initially supported the Ruby programming language, with Rack and Ruby on Rails. Heroku PaaS now...

, GitHub
Github
GitHub is a web-based hosting service for software development projects that use the Git revision control system. GitHub offers both commercial plans and free accounts for open source projects...

, and Songbird
Songbird (software)
Songbird is a free and open source software audio player and web browser, with a stated mission "to incubate Songbird, the first Web player, to catalyze and champion a diverse, open Media Web."...

. Heroku provides much of the financial support for Sinatra's development.

Mizerany and Adam Wiggins of Heroku introduced and talked about Sinatra at RubyConf 2008.

Example

  1. !/usr/bin/env ruby

require 'sinatra'

get '/' do
redirect to('/hello/World')
end

get '/hello/:name' do
"Hello #{params[:name]}!"
end

Frameworks inspired by Sinatra

Sinatra has inspired a lot of micro frameworks in Ruby and other programming languages. Usually such frameworks try to closely mimic the Sinatra DSL.

  • Ruby: Almost Sinatra, Astaire, Cuba, Padrino (based on Sinatra), Pakyow, Renee
  • PHP
    PHP
    PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

    : Fat-Free, Fitzgerald, Glue, klein, Laravel, Limonade, MiMViC, Silex, Slim
  • JavaScript
    JavaScript
    JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

    : Express, Picard, Roundabout, Sammy
  • CoffeeScript
    CoffeeScript
    CoffeeScript is a programming language that transcompiles to JavaScript. The language adds syntactic sugar inspired by Ruby, Python and Haskell to enhance JavaScript's brevity and readability, as well as adding more sophisticated features like array comprehension and pattern matching...

    : Zappa
  • Python
    Python (programming language)
    Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

    : Bottle, Denied (was an April Fools joke), Flask, itty, Juno
  • Erlang
    Erlang
    Erlang may refer to:* Agner Krarup Erlang , a mathematician and engineer after whom several concepts are named** Erlang , a unit to measure traffic in telecommunications or other domains...

    : Fresh, Spooky
  • Groovy: Graffiti, Ratpack
  • Scala: Scalatra, BlueEyes
  • .NET
    .NET Framework
    The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

    : Martin, Nancy, Nina
  • Perl: Dancer, Mojolicious
    Mojolicious
    Mojolicious is a real-time web application framework, written by Sebastian Riedel, creator of the web application framework Catalyst. Licensed as free software under the Artistic License v 2.0, It is written in Perl, and is designed for use in both simple and complex web applications, based on...

  • Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

    : Spark, Napalm
  • Haskell
    Haskell (programming language)
    Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

    : Bird, Loli
  • Fancy
    Fancy (programming language)
    Fancy is a pure object-oriented programming language that is heavily influenced by Smalltalk and Ruby. The language is currently under development as an open source project by Christopher Bertels.- Development :...

    : Sinatra.fy
  • Bash: Astley, sh.inatra
  • C
    C (programming language)
    C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

    : Bogart
  • F#: Frank
  • Lua: Mercury, Orbit
  • Mirah
    Mirah (programming language)
    Mirah is a programming language based on Ruby syntax, local type inference, hybrid static/dynamic type system, and a pluggable compiler toolchain...

    : Shatner
  • Objective-C
    Objective-C
    Objective-C is a reflective, object-oriented programming language that adds Smalltalk-style messaging to the C programming language.Today, it is used primarily on Apple's Mac OS X and iOS: two environments derived from the OpenStep standard, though not compliant with it...

    : RCRouter
  • Vala
    Vala (programming language)
    Vala is a programming language created with the goal of bringing modern language features to C, with no added runtime needs and with little overhead, by targeting the GObject object system. It is being developed by Jürg Billeter and Raffaele Sandrini. The syntax borrows heavily from C#...

    : Valatra

In July 2011, some unknown individual or group, posing as various members of the Sinatra core team, discredited the Dancer project. This incident led to the Sinatra team publicly endorsing Dancer and other clones.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK