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.

Sinatra

1,409 views

Published on

Charla sobre Sinatra - #maresmedev 12/2010

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Sinatra

  1. 1. SinatraClassy Web Applications
  2. 2. Mauro Pompiliohttp://twitter.com/malditogeekhttp://github.com/malditogeek
  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: www.example.com 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 http://rack.rubyforge.org/http://github.com/rack/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!http://github.com/sinatra/sinatra/blob/master/README.es.rdoc
  11. 11. http://www.sinatrarb.com/http://sinatra-book.gittr.com/http://github.com/sinatra/sinatra
  12. 12. Ejemploshttps://github.com/malditogeek/maresmedev_sinatra
  13. 13. Preguntas?

×