Sinatra Introduction

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    10 Favorites & 1 Group

    Sinatra Introduction - Presentation Transcript

    1. Agenda • Sinatra Introduction • Real Example • Rack • Rails Intergation
    2. • http://twitter.com/xdite • http://blog.xdite.net • Rails Developer
    3. Sinatra is ... • ruby web framework library • not MVC ( Model-View-Controller ) • DSL for defining RESTful HTTP actions
    4. RAILS LINGO ORM , MVC , Testing , Mail , Generator, RJS, I18n, Template , Engine .....
    5. SINATRA LINGO GET / POST / PUT / DELETE , request paramenters, response, views , helpers , configure , rack
    6. Single file web-app
    7. Single file web-app
    8. Hello World!
    9. HTTP actions
    10. Routes
    11. Views
    12. Helpers
    13. Filter
    14. Configure
    15. • Web Service / API • Tiny Web Application • Rails Metal
    16. Web Service / API
    17. Requests per second: 81.09 [#/sec] (mean) Time per request: 12.332 [ms] (mean) Rails action Requests per second:450.56 [#/sec] (mean) Sinatra Time per request: 2.219 [ms] (mean) Ubuntu 8.04, Intel Atom N270 @1.60GHz
    18. Tiny Web Application
    19. • simple • cherry pick • ActiveRecord / Datamapper • Prototype / jQuery
    20. twitter IE6
    21. • CodeIgniter - PHP framework • Twitter API • LOC : 1000+ • NOT support CJK
    22. require 'rubygems' require 'sinatra' require 'twitter_search' get '/' do @client = TwitterSearch::Client.new 'politweets' @results = @client.query :q => '@MrIE6' erb :home end 10 ..
    23. • ORM • Paginate
    24. 40
    25. Rails Metal with Sinatra
    26. Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks Core Code Middleware Mongrel rack middleware
    27. http Profiling Security Caching Middleware Middleware Middleware Handler Core Code for Rack
    28. $ rake middleware
    29. Scaling Rails - Metal • Rack action • Sinatra Metal app
    30. Performance
    31. class OldPollerController < ApplicationController def poller render :text => "Hello World!" end end class Poller < Rails::Rack::Metal def call(env) if env["PATH_INFO"] =~ /^/poller/ [[200], {"Content-Type" => "text/html"}, "Hello, World!"] else [[404], {"Content-Type" => "text/html"}, "Not Found"] end end end 25
    32. Requests per second: 81.09 [#/sec] (mean) Rails action Time per request: 12.332 [x`x] (mean) Requests per second: 163.75 [#/sec] (mean) Metal + Sinatra Time per request: 6.107 [ms] (mean) Ubuntu 8.04, Intel Atom N270 @1.60GHz
    33. Q &A
    34. Resources • Scaling Rails : Episode #14 Rack • RailsCast: Episode #251 Rack Middleware • Pragprog.com : Classy Web Development with Sinata • Github / xdite : tweesage-message-wall

    + xuitejokexuitejoke, 4 months ago

    custom

    1556 views, 10 favs, 2 embeds more stats

    Ruby Tuesday 6/30 xdite's talk

    about Sinatra / Rac more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1556
      • 930 on SlideShare
      • 626 from embeds
    • Comments 0
    • Favorites 10
    • Downloads 30
    Most viewed embeds
    • 625 views on http://blog.xdite.net
    • 1 views on http://static.slidesharecdn.com

    more

    All embeds
    • 625 views on http://blog.xdite.net
    • 1 views on http://static.slidesharecdn.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events