Sinatra_(software)

Sinatra (software)

Sinatra (software)

Add article description


Sinatra is a free and open source software web application library and domain-specific language[2] written in Ruby. It is an alternative to other Ruby web application frameworks such as Ruby on Rails, Merb, Nitro, and Camping. It is dependent on the Rack web server interface. It is named after musician Frank Sinatra.[3]

Quick Facts Original author(s), Developer(s) ...

Designed and developed by Blake Mizerany, Sinatra is small and flexible. It does not follow the typical model–view–controller pattern used in other frameworks, such as Ruby on Rails. Instead, Sinatra focuses on "quickly creating web-applications in Ruby with minimal effort."[4] Because of much smaller size compared to Ruby on Rails, it is also called microframework.[5]

Some notable companies and institutions that use Sinatra include Apple,[6] BBC,[7] the British Government's Government Digital Service,[8] LinkedIn,[9] the National Security Agency,[10] Engine Yard, Heroku, GitHub,[11] Stripe, and Songbird.[12] Travis CI provides much of the financial support for Sinatra's development.[3]

Sinatra was created and open-sourced in 2007. It inspired multiple ports and similar projects in other programming languages, such as Express.js and Scalatra.[5][13]

Mizerany and Heroku's Adam Wiggins introduced and discussed Sinatra at RubyConf 2008.[14]

Example

#!/usr/bin/env ruby
require 'sinatra'

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

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

References

  1. Error: Unable to display the reference properly. See the documentation for details.
  2. "Taking the Stage - Sinatra: Up and Running". Safaribooksonline.com. Retrieved 2016-10-21.
  3. Carlson, Lucas; Richardson, Leonard (2015). Ruby Cookbook: Recipes for Object-Oriented Scripting. O'Reilly Media. ISBN 9781449373696.
  4. "Open Source (Almost) Everything". 22 November 2011. Retrieved 16 January 2015.

Further reading


Share this article:

This article uses material from the Wikipedia article Sinatra_(software), and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.