Upload
elliando-dias
View
1.475
Download
3
Tags:
Embed Size (px)
Citation preview
Introduction to RangoJakub Šťastný aka Botanicus
Monday, November 30, 2009
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
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
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
• 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
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
Routers
• Usher, Rack-mount
• URLMap, Rack-router
• Rango::UrlHelper for url(:post, id)
• env[“rango.router.params”]
Monday, November 30, 2009
Rendering
• You don’t need controllers for it
• Or just include Rango::RenderMixin
Monday, November 30, 2009
Template Inheritance
• Default values for blocks
• Block can return whichever value
• AJAX
Monday, November 30, 2009
Basic Example
Monday, November 30, 2009
Returning values
Monday, November 30, 2009
AJAX
Monday, November 30, 2009
Generic Views
Monday, November 30, 2009
Monday, November 30, 2009
Monday, November 30, 2009
HTTP Errors Handling
Monday, November 30, 2009
Monday, November 30, 2009
Monday, November 30, 2009
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
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
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
Related Projects: Simple-templater
• Highly-opinionated
• Reusable hooks
• Redefine partially or the whole
• ~/.simple-templater/rango/project
Monday, November 30, 2009
• Thank you for your attention!
Monday, November 30, 2009