Rails and Rack

Rails and Rack

社内勉強会で発表した際の資料です。

yachibit

June 12, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

14 slides
  1. Rackとは? Rack provides a minimal interface between webservers that support

    Ruby and Ruby frameworks. ref: http://rack.github.io/ ・WebサーバーとRubyやRubyフレームワークとの間のインターフェースを  ミニマルにしてくれるもの ・WebサーバーとRubyフレームワークをつなぐ規約を定義している
  2. Rackに準拠したアプリケーションの規約 To use Rack, provide an "app": an object that

    responds to the `call` method, taking the environment hash as a parameter, and returning an Array with three elements: - The HTTP response code - A Hash of headers - The response body, which must respond to each ref: http://rack.github.io/ ・1つのHashオブジェクトを引数に取る `call` というメソッドが実装されていること ・`call` メソッドは、「ステータスコード, ヘッダーを表現したHash, eachに反応するオブ ジェクト」の3つの要素を持つ配列を返すこと
  3. 参考 - rack/rack: a modular Ruby webserver interface - Rack:

    a Ruby Webserver Interface - Rails on Rack — Ruby on Rails Guides - 翻訳 - Rackとは何か - Qiita - Rails開発におけるwebサーバーとアプリケーションサーバーの違い(翻訳) - Qiita - Rack解説 - Rackの構造とRack DSL - Qiita - パーフェクト Ruby on Rails

More Decks by yachibit

Other Decks in Technology