Your SlideShare is downloading. ×
Ruby For Web Development
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby For Web Development

1,509
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.

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,509
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
21
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 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?