Sinatra (software)

from Wikipedia, the free encyclopedia
Sinatra
Basic data

developer Blake Mizerany (maintainer: Konstantin Haase)
Current  version 2.0.0
(April 10, 2017)
operating system cross-platform
programming language Ruby
category Web framework
License MIT license
German speaking No
www.sinatrarb.com

Sinatra is a free web framework and a domain-specific language written in Ruby . It's an alternative to other Ruby frameworks like Ruby on Rails , Nitro , Camping, and Rango . Sinatra requires the rack web server interface.

Sinatra was designed and developed by Blake Mizerany and is meant to be compact and flexible. It does not follow the MVC pattern used in other frameworks such as Ruby on Rails. Instead, Sinatra aims to be able to develop web applications quickly and with minimal effort.

Some major companies use Sinatra, including Apple , the BBC , LinkedIn , Engine Yard , Heroku , GitHub, and Songbird . Heroku is providing a large portion of Sinatra's funding.

Sinatra was created in 2007 and placed under an open source license .

Examples

Example 1: a webapp in a file

A hello world web application can look like this, for example:

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

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

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

Such a program is started with:

$ ruby test.rb

If you open it in the browser:

http://localhost:4567

Can you read the Hello World! see in the browser window. However, if you call the URL

http://localhost:4567/hello/Ada

so you can read the Hello Ada! see in the browser window.

Example 2: HTML code in the web app

It is possible to incorporate HTML code into the source code with ERuby (erb):

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

get '/' do
  erb :main
end

__END__
@@main
<!doctype html>
<html >
<head>
  <title>Welcome page</title>
  <meta charset="utf-8">
</head>
<body>
  <header>
    <h1>Welcome World!</h1>
  </header>
    <p>Welcome to this Website!
    </p>
</body>
</html>

Frameworks influenced by Sinatra

Sinatra has inspired a number of microframeworks in Ruby and other programming languages. Such frameworks usually try to emulate Sinatra's domain-specific language (DSL) as closely as possible.

In July 2011, an individual or group posing as members of the Sinatra team discredited the Dancer Project. This incident led the Sinatra team to publicly endorse the Dancer project and other replicas.

literature

  • Alan Harris, Konstantin Haase: Sinatra: Up And Running (First ed.). O'Reilly Media, 2012, ISBN 978-1-4493-0423-2 , p. 120.

Web links

Individual evidence

  1. Sinatra: Getting Started. In: sinatrarb.com. Retrieved January 29, 2012 .
  2. Open source software used by Apple. Retrieved January 20, 2012 .
  3. BBC Zeitgeist. (No longer available online.) Archived from the original on November 28, 2010 ; Retrieved January 29, 2012 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / thechangelog.com
  4. JRubyfying LinkedIn's front-end. Retrieved January 29, 2012 .
  5. Sinatra in The Wild. Retrieved January 29, 2012 .
  6. Sinatra: About. Retrieved January 29, 2012 .
  7. ^ Almost Sinatra
  8. Astaire
  9. ^ Cuba
  10. Padrino
  11. Pakyow
  12. Renee
  13. Fat-Free
  14. Fitzgerald
  15. Glue ( Memento of the original from July 8, 2011 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / glue.d-xp.com
  16. small
  17. Laravel
  18. lemonade
  19. MiMViC  ( page can no longer be accessed , search in web archivesInfo: The link was automatically marked as defective. Please check the link according to the instructions and then remove this notice.@1@ 2Template: Dead Link / mimvic.googlecode.com  
  20. Silex ( Memento of the original from April 30, 2015 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / silex-project.org
  21. Slim
  22. Express
  23. Picard
  24. Roundabout
  25. Sammy
  26. Zappa
  27. Bottle ( Memento of the original from January 10, 2011 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / bottle.paws.de
  28. Denied ( Memento of the original from September 4, 2011 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / denied.immersedcode.org
  29. ^ Armin Ronacher: April 1st Post Mortem
  30. Flask
  31. itty
  32. Juno
  33. Fresh
  34. Spooky
  35. ^ Graffiti
  36. Ratpack
  37. Scalatra
  38. BlueEyes
  39. Martin
  40. Nancy
  41. Nina
  42. ^ Mojolicious :: Lite
  43. Spark
  44. Napalm  ( page no longer available , search in web archivesInfo: The link was automatically marked as defective. Please check the link according to the instructions and then remove this notice.@1@ 2Template: Dead Link / github.com  
  45. HTMLeasy
  46. ^ Bird
  47. Loli ( Memento of the original from February 14, 2010 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / github.com
  48. Sinatra.fy
  49. Astley
  50. see inatra
  51. Bogart
  52. Frank ( Memento of the original from October 13, 2011 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / frankfs.net
  53. Mercury
  54. Orbit
  55. Shatner
  56. RC router
  57. Valatra
  58. Jester
  59. "Sinatra Loves Dancer"