Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

Charla sobre Sinatra - #maresmedev 12/2010

Published in: Technology
  • Be the first to comment

  • Be the first to like this


  1. 1. SinatraClassy Web Applications
  2. 2. Mauro Pompilio
  3. 3. SinatraAplicaciones web en Ruby... tiradas!Framework? Más bien un DSLPrototipos, servicios REST, aplicacionespequeñasConstruido sobre Rack
  4. 4. Rack GET /hello HTTP/1.1 Host: HTTP/1.1 200 OK Date: Mon, 23 May 2005 22:38:34 GMT Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT Accept-Ranges: bytes Content-Length: 438 Connection: close Content-Type: text/html; charset=UTF-8 Hello world!class HelloWorld def call(env) [200, {"Content-Type" => "text/plain"}, ["Hello world!"]] endend
  5. 5. Rack
  6. 6. Somethin’ StupidSinatra “Classic” require rubygems require sinatra ruta“verbo” get /hello do Hello world! respuesta end
  7. 7. Fly Me To The Moon Sinatra “modular”module Demo class Application < Sinatra::Base get / do Welcome! end get /hello/:name do |name| "Hello #{name}!" end endend
  8. 8. Protip!gem install shotgunRecompila la aplicación Sinatra en cada peticiónAgilidad de desarrollo
  9. 9. Strangers In The NightREST: GET, POST, PUT, DELETERutas explicitas, catch all, o expresionesregularesVistas y templatesFilters y Helpers...lovers at first sight!
  10. 10. Más info? RTFM!
  11. 11.
  12. 12. Ejemplos
  13. 13. Preguntas?