Top Banner
Introduction to Rango Jakub Šťastný aka Botanicus Monday, November 30, 2009
23
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rango

Introduction to RangoJakub Šťastný aka Botanicus

Monday, November 30, 2009

Page 2: Rango

About me

• Designer & author fo Rango

• Contributor to many OSS include rSpec, Merb, Usher, Racksh etc

• http://twitter.com/botanicus

• Currently looking for a job or contract

• http://static.101ideas.cz/CV.html

Monday, November 30, 2009

Page 3: Rango

What is Rango?

• Rack-based lightweight web framework

• As agnostic as possible

• The goal is to provide solid framework for building sites in Ruby. More robust than Sinatra, but smaller than Rails or Merb.

Monday, November 30, 2009

Page 4: Rango

Features

• Ruby 1.9-only

• Provides generators, but don’t insist on a certain structure

• Code reloading by shotgun

• Bundler support

• Inspired by Django & Merb

Monday, November 30, 2009

Page 5: Rango

• Django terminology (template, view = view, action in controller)

• Very flexible, you can use just whichever subset of Rango you want and it will work.

• No conventions, just recommendations

Monday, November 30, 2009

Page 6: Rango

Boot Process

• Script init.rb should setup environment

• Work as runner: ./init.rb myscript.rb

• And as a console: ./init.rb -i

• Or both altogether: ./init.rb -i myscript.rb

• Start web server: ./config.ru

• Rewrite arguments: ./config.ru -s thin

Monday, November 30, 2009

Page 7: Rango

Routers

• Usher, Rack-mount

• URLMap, Rack-router

• Rango::UrlHelper for url(:post, id)

• env[“rango.router.params”]

Monday, November 30, 2009

Page 8: Rango

Rendering

• You don’t need controllers for it

• Or just include Rango::RenderMixin

Monday, November 30, 2009

Page 9: Rango

Template Inheritance

• Default values for blocks

• Block can return whichever value

• AJAX

Monday, November 30, 2009

Page 10: Rango

Basic Example

Monday, November 30, 2009

Page 11: Rango

Returning values

Monday, November 30, 2009

Page 12: Rango

AJAX

Monday, November 30, 2009

Page 13: Rango

Generic Views

Monday, November 30, 2009

Page 14: Rango

Monday, November 30, 2009

Page 15: Rango

Monday, November 30, 2009

Page 16: Rango

HTTP Errors Handling

Monday, November 30, 2009

Page 17: Rango

Monday, November 30, 2009

Page 18: Rango

Monday, November 30, 2009

Page 19: Rango

Future

• January 2010 in Rango 0.3: Mountable apps via Pancake: each app can run standalone or be used as a library (can be distributed as gems with assets & templates)

Monday, November 30, 2009

Page 20: Rango

Links

• GitHub: http://github.com/botanicus/rango

• Wiki: http://wiki.github.com/botanicus/rango

• Issues: http://github.com/botanicus/rango/issues

• Blog: http://botanicus.github.com/rango

• Twitter: http://twitter.com/RangoProject

Monday, November 30, 2009

Page 21: Rango

Related Projects: Pupu

• Package manager for media stuff

• JS/CSS frameworks & plugins, icon sets ...

• pupu install autocompleter

• Helper: pupu :autocompleter

• Can handle dependencies

Monday, November 30, 2009

Page 22: Rango

Related Projects: Simple-templater

• Highly-opinionated

• Reusable hooks

• Redefine partially or the whole

• ~/.simple-templater/rango/project

Monday, November 30, 2009

Page 23: Rango

• Thank you for your attention!

Monday, November 30, 2009