Ruby For Web Development

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

    1 Favorite

    Ruby For Web Development - Presentation Transcript

    1. Ruby for Web Development Beyond just Rails
    2. Pizza Sponsored By Additional Thanks to Our Other Sponsors
    3. The Big Gorilla
    4. A Myriad of Options Mack Camping Sinatra
    5. The Heart of Them All
    6. So, What’s What?
    7. require 'camping' Camping.goes :Blog module Blog::Models class Post < Base; belongs_to :user; end class Comment < Base; belongs_to :user; end class User < Base; end end Camping module Blog::Controllers class Index def get @posts = Post.find :all • Microframework (under 4K) render :index end end • Single file applications end • MVC-ish module Blog::Views def layout html do head { title "My Blog" } body do h1 "My Blog" self << yield GOTCHAS end end • ActiveRecord needed for end Models def index for post in @posts • Markaby needed for Views h1 post.title end end end
    8. Sinatra • Web Application DSL require 'sinatra' • Single file applications possible get '/' do 'Hello world!' • Non-MVC/MVC-ish end GOTCHAS • Additional dependencies for data persistence (Models) • Additional dependencies for Views & Templates
    9. require 'ramaze' • Modular Web Framework class MainController < Ramaze::Controller • Single file applications possible def index "Hello, World!" end • MVC-ish end • ORM & Templating Agnostic Ramaze.start GOTCHAS • Less visible community
    10. Mack • Lightweight framework • Inspired by Rails, Merb and Ramaze • Emphasis on speed • Multithreaded GOTCHAS • Limited user community • Very limited documentation
    11. • Everything and the kitchen sink • The Ruby Web Standard • Emphasis on “Developer Happiness” • HUGE community GOTCHAS • Monolithic • Opinionated
    12. So, What Is Rack?
    13. • Standard abstraction for web applications class HelloWorld • Super flexible thanks to def call(env) [200, Middleware {"Content-Type" => "text/plain"}, ["Hello world!"]] • end Stupid simple end • Makes your app/framework web server agnostic
    14. Middlewares • Middlewares are Rack applications that you stack together to form a larger app • Rails is composed of numerous pieces of Rack Middleware • Middlewares respond to call, accept an environment hash and return a response array • Examples of Rack Middleware • Rack::Static - Handles fetching and returning static assets or caches • Rack::Session::Cookie - Handles your sessions via cookies • Rack::ShowExceptions - Catches any exceptions thrown in your app and returns a useful backtrace on the exception.
    15. More Resources • 32 Rack Links and Resources (Ruby Inside) - http://bit.ly/2NTV4Z • 21 Rack Middlewares (Ruby Inside) - http://bit.ly/4uyXYW • Rails on Rack (Rails Guides) - http://bit.ly/C9zZP • Rack Middleware (Railscasts) - http://bit.ly/okQoF • Rack Screencasts (Ruby Flow) - http://bit.ly/4AMeuP
    16. Questions?

    + James ThompsonJames Thompson, 3 weeks ago

    custom

    196 views, 1 favs, 0 embeds more stats

    An examination of the various options for web devel more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 196
      • 196 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 3
    Most viewed embeds

    more

    All embeds

    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