Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby on Rack

Ruby on Rack

Lightning talk about Rack and bench-micro: https://github.com/luislavena/bench-micro

Presented at Philly.rb (October, 2016)

Ernesto Tagwerker

October 12, 2016
Tweet

More Decks by Ernesto Tagwerker

Other Decks in Programming

Transcript

  1. rails.rb class HelloWorld < Rails::Application routes.append do get "/", to:

    "hello#world" end config.cache_classes = true config.eager_load = true config.secret_key_base = SecureRandom.hex(64) ["Rack::Lock", "ActionDispatch::Flash", "ActionDispatch::BestStandardsSupport", "Rack::Sendfile", "ActionDispatch::Static", "Rack::MethodOverride", "ActionDispatch::RequestId", "Rails::Rack::Logger", "ActionDispatch::ShowExceptions", "ActionDispatch::DebugExceptions", "ActionDispatch::RemoteIp", "ActionDispatch::Callbacks", "ActionDispatch::Cookies", "ActionDispatch::Session::CookieStore", "ActionDispatch::ParamsParser", "Rack::Head", "Rack::ConditionalGet", "Rack::ETag"].each do |middleware| config.middleware.delete(middleware) end end class HelloController < ActionController::Metal def world self.response_body = "Hello World!" end end APP = HelloWorld.initialize! run APP
  2. cuba.rb require "cuba" HelloWorld = Cuba.new do on get, root

    do res.write "Hello World!" end end APP = HelloWorld run APP
  3. hobbit.rb require "hobbit" class HelloWorld < Hobbit::Base get "/" do

    "Hello World!" end end APP = HelloWorld.new run APP