(TODO: Update this to be easier to read)
You may package your entire
app/ folder as an extension by copying it into
extensions/my_extension/. You may then redistribute it for using in other
(All files and folders above are optional. Just use what you need!)
- Each extension can have
helpers/and all Ruby files inside them are autoloaded.
- You may also have a YAML file called
info.yml, which hosts metadata about your extension.
- The directories described above are all optional.
Custom extensions go into
Here's what happens when the extension is loaded:
- After everything is set up,
init.rbis called after all extensions are loaded.
- All Ruby files are loaded from
info.yml in your extension.
[extensions/twitter/info.yml (yaml)] name: Twitter integration author: Rico Sta. Cruz description: Shows twitter feeds in the home page.
config/extensions.rb of your app.
[config/extensions.rb (ruby)] Main.configure do |m| m.set :additional_extensions, %w(default_theme) end