Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Writing Plugins

botanicus edited this page Sep 13, 2010 · 10 revisions

Generators Support

Will be introduced in some next release

Settings

This will be probably reworked very soon.

class Rango::Plugin::MyPlugin
  include Rango::Settings
end

Bootloaders Support

Rango.after_boot(:register_pupu) do
  Pupu.root = Project.root
  Pupu.media_prefix = Project.settings.media_prefix
  Pupu.media_root = Project.settings.media_root
  Rango::Controller.send(:include, Pupu::PupuHelpersMixin)
  Rango.logger.info("Pupu plugin registered")
end

Middleware Registration

I will think about it, so far it’s not supported.

Tasks

There is no direct support for task registration as it is in Merb or Rails. The reason is simple: user may be interested in your plugin, but he may not be interested in your tasks. So if you want to provide tasks, simply add them to your project and tell user to puts @load “your-plugin/tasks” to his Thorfile.

If you have a lot of tasks, it may be useful to divide them into more taskfiles, so user may load just what he really want to.

Mountable Applications

There is no support for mountable applications in Rango. The reason is it’s more about router than about the framework. If your router supports including routes from mountable applications, you will be able to write mountable applications in Rango.

Clone this wiki locally