advertisement

Rack a framework to roll your own

0 %
100 %
advertisement
Information about Rack a framework to roll your own
Technology

Published on March 2, 2014

Author: nishantmodak

Source: slideshare.net

Description

https://github.com/nishantmodak/chotu

https://github.com/nishantmodak/ruby-talk-au/

( Ruby Conf Australia 2014 )

What is common between Rails, Sinatra and numerous other Ruby frameworks?

They are built on top of Rack or have Rack interfaces for allowing application servers to connect to them.

A deep-dive of sorts on Rack and see what it takes to build a framework, helping us understand these better and ultimately rolling our own.

Almost anyone doing a Ruby app ends up using Rack in one way or the other without ever realising the magic and simplicity that it provides. This session should help decoding that and provide ways on writing your own frameworks.

In involved live coding a framework that is very similar in structure to rails but is bare bones.
advertisement

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

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

What is Rack? SERVER SERVER APPLICATION / FRAMEWORK

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

RACK

config.ru $ rackup

Middleware HTTP INTERMEDIARIES APP

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

DSL use, run, map lib/builder.rb

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

Rack::Builder

> rake middleware

SERVER MIDDLEWARE MIDDLEWARE FRAMEWORK MIDDLEWARE ROUTING MIDDLEWARE APPLICATION APPLICATION

Yay! Full Stack Developers!

WHY ANOTHER FRAMEWORK ?

Yes, We CAN !

CRUDingly awful

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

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

justrails.rb ➔ Controllers ➔ Routing ➔ Views ➔ Models

1_application

2_Controllers - Conventions - URL Matching - Autoloading

Conventions 1. <host>/products/index 2. ProductsController#index 3. products_controller 4. <app>/application/controllers

Autoloading - const_get - const_missing - $LOAD_PATH

3_View Interface to several Ruby template engines

3_View Interface to several Ruby template engines

4_Methods as Rack Applications

5_Routing

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

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

Thank You!

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Roll Your Own Web Framework | Dr Dobb's

... is that you can use Rack to build your own frameworks and tools with ease, and then deploy them without writing server specific interfaces for ...
Read more

-svs- - Roll your own web framework in half an hour

Roll your own web framework in half ... Whatever your reason for rolling your own framework, Rack and ... A nice blog on Rails and how can we roll out our ...
Read more

Build your own web framework with Rack and Ruby - Part 1 ...

Building your own framework with Rack ... We built our first simple rack app. Stay tuned for the next parts of the series and we'll flesh out our framework ...
Read more

Roll your own JavaScript framework - This Is Not An Ambulance.

Roll your own JavaScript framework ... adopting a roll your own approach utilising whatever ... the best argument for rolling your own framework.
Read more

Rollyourown - National Cigar Store Online, Your Online ...

Want to save even more on your tobacco and tobacco supplies? ... Rollyourown pays all applicable Federal taxes and all state taxes for Iowa customers.
Read more

Why it's a good idea to roll your own CSS Framework (and ...

Build your own CSS framework in order to have a concise CSS library to match your ... Why it’s a good idea to roll your own CSS Framework (and why I ...
Read more

Roll Your Own Framework

Go Ahead, Roll Your Own Framework Thank You Ryan%Stevens ...
Read more

.net - Implementing your own MVVM vs. using an MVVM ...

I'd suggest to look at this talk: Build Your Own MVVM Framework (if you still haven't) I decided to read some resources of various frameworks first, then I ...
Read more