Slide 1

Slide 1 text

RACK a framework to roll your own @nishantmodak Revealing Hour Creations t revealinghour.in

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Donald Knuth Email is a wonderful thing for people whose role in life is to be on top of things. But not for me; my role is to be on the bottom of things. http://www-cs-faculty.stanford.edu/~knuth/email.html

Slide 4

Slide 4 text

SERVER What is Rack? APPLICATION / FRAMEWORK SERVER

Slide 5

Slide 5 text

1. Web Server Interface 2. Tool for composing web applications 3. Collection of middleware utilities What is Rack?

Slide 6

Slide 6 text

RACK

Slide 7

Slide 7 text

config.ru $ rackup

Slide 8

Slide 8 text

APP HTTP INTERMEDIARIES Middleware

Slide 9

Slide 9 text

HTTP APPLICATION M I D D L E W A R E

Slide 10

Slide 10 text

DSL use, run, map lib/builder.rb

Slide 11

Slide 11 text

DEMO 1. MyRackApp 2. Middlewares - use / run / map 3. Rack Code

Slide 12

Slide 12 text

Rack::Builder

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

> rake middleware

Slide 15

Slide 15 text

MIDDLEWARE MIDDLEWARE MIDDLEWARE ROUTING MIDDLEWARE APPLICATION APPLICATION SERVER FRAMEWORK

Slide 16

Slide 16 text

Yay! Full Stack Developers!

Slide 17

Slide 17 text

WHY ANOTHER FRAMEWORK ?

Slide 18

Slide 18 text

Yes, We CAN !

Slide 19

Slide 19 text

CRUDingly awful

Slide 20

Slide 20 text

Maybe - fearware - too bloated - too simple - over default ing -

Slide 21

Slide 21 text

Maybe - fearware - too bloated - too simple - over default ing - troll your own framework

Slide 22

Slide 22 text

justrails.rb ➔ Controllers ➔ Routing ➔ Views ➔ Models

Slide 23

Slide 23 text

1_application

Slide 24

Slide 24 text

2_Controllers - Conventions - URL Matching - Autoloading

Slide 25

Slide 25 text

Conventions 1. /products/index 2. ProductsController#index 3. products_controller 4. /application/controllers

Slide 26

Slide 26 text

Autoloading - const_get - const_missing - $LOAD_PATH

Slide 27

Slide 27 text

3_View Interface to several Ruby template engines

Slide 28

Slide 28 text

3_View Interface to several Ruby template engines

Slide 29

Slide 29 text

4_Methods as Rack Applications

Slide 30

Slide 30 text

5_Routing

Slide 31

Slide 31 text

Options? ➔ Middlewares ➔ Action* , Active* ➔ Inheritance

Slide 32

Slide 32 text

References - edgeguides.rubyonrails.org/rails_on_rack.html - rebuilding-rails.com - Sinatra, Rails, Thin

Slide 33

Slide 33 text

Thank You!

Slide 34

Slide 34 text

No content