Ruby for Web Development
        Beyond just Rails
Pizza Sponsored By




Additional Thanks to Our Other Sponsors
The Big Gorilla
A Myriad of Options
Mack
                    Camping




 Sinatra
The Heart of Them All
So, What’s What?
require 'camping'

                                Camping.goes :Blog

                                module Blog::Models...
Sinatra

•   Web Application DSL
                                       require 'sinatra'

•   Single file applications pos...
require 'ramaze'
•   Modular Web Framework
                                       class MainController < Ramaze::Controlle...
Mack

•   Lightweight framework

•   Inspired by Rails, Merb and
    Ramaze

•   Emphasis on speed

•   Multithreaded


  ...
•   Everything and the kitchen sink

•   The Ruby Web Standard

•   Emphasis on “Developer
    Happiness”

•   HUGE commun...
So, What Is Rack?
•   Standard abstraction for web
    applications
                                   class HelloWorld

•   Super flexible t...
Middlewares


•   Middlewares are Rack applications that you stack together to form a
    larger app
    •   Rails is comp...
More Resources


•   32 Rack Links and Resources (Ruby Inside) - http://bit.ly/2NTV4Z
•   21 Rack Middlewares (Ruby Inside...
Questions?
Upcoming SlideShare
Loading in …5
×

Ruby For Web Development

1,755 views

Published on

An examination of the various options for web development with Ruby, including Rails, Ramaze, Camping, Sinatra and Mack. Also includes a look at the heart of all the Ruby web frameworks: Rack.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,755
On SlideShare
0
From Embeds
0
Number of Embeds
16
Actions
Shares
0
Downloads
24
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Ruby For Web Development

    1. 1. Ruby for Web Development Beyond just Rails
    2. 2. Pizza Sponsored By Additional Thanks to Our Other Sponsors
    3. 3. The Big Gorilla
    4. 4. A Myriad of Options Mack Camping Sinatra
    5. 5. The Heart of Them All
    6. 6. So, What’s What?
    7. 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. 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. 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. 10. Mack • Lightweight framework • Inspired by Rails, Merb and Ramaze • Emphasis on speed • Multithreaded GOTCHAS • Limited user community • Very limited documentation
    11. 11. • Everything and the kitchen sink • The Ruby Web Standard • Emphasis on “Developer Happiness” • HUGE community GOTCHAS • Monolithic • Opinionated
    12. 12. So, What Is Rack?
    13. 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. 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. 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. 16. Questions?

    ×