Ruby / Roda - Web Framework / Plugins



Introduction

This page should contain a quick overview of available Roda plugins.


Plugins - (built-in)

Core Routing

Plugin Name: Description:

:all_verbs

Adds request routing methods for all http verbs.

:backtracking_array

Allows array matchers to backtrack if later matchers do not match.

:class_level_routing

Adds class level routing methods, for a DSL similar to Sinatra.

:head

Treat HEAD requests like GET requests with an empty response body.

:multi_route

Allows for multiple named route blocks that can be dispatched to inside main route block.

:multi_run

Adds the ability to dispatch to multiple rack applications based on the request path prefix.

:not_allowed

Adds support for automatically returning 405 Method Not Allowed responses.

:run_handler

Allows for modifying rack response arrays when using r.run, and continuing routing for 404 responses.

Rendering

Plugin Name: Description:

:assets

Adds support for rendering CSS/JS javascript assets on the fly in development, or compiling them into a single compressed file in production.

:chunked

Adds support for streaming template responses using Transfer-Encoding: chunked.

:json

Allows match blocks to return arrays and hashes, using a json representation as the response body.

:named_templates

Adds the ability to create inline templates by name, instead of storing them in the file system.

:padrino_render

Makes render method that work similarly to Padrino's rendering, using a layout by default.

:partials

Adds partial method for rendering partials (templates prefixed with an underscore).

:precompile_templates

Adds support for precompiling templates, saving memory when using a forking webserver.

:render

Adds render method for rendering templates, using tilt.

:static

Adds support for serving static files using Rack::Static.

:streaming

Adds ability to stream responses.

:symbol_views

Allows match blocks to return template name symbols, uses the template view as the response body.

:view_options

Allows for setting view options on a per-request basis.

:websockets

Adds websocket support using faye-websocket.

View Helpers

Plugin Name: Description:

:content_for

Allows storage of content in one template and retrieval of that content in a different template.

:csrf

Adds CSRF protection and helper methods using rack_csrf.

:h

Adds h method for html escaping.

:render_each

Render a template for each value in an enumerable.

Request/Response Helpers

Plugin Name: Description:

:caching

Adds request and response methods related to http caching.

:cookies

Adds response methods for handling cookies.

:default_headers

Allows modifying the default headers for responses.

:default_status

Allows overriding the default status for responses.

:delegate

Adds class methods for creating instance methods that delegate to the request, response, or class.

:delete_empty_headers

Automatically delete response headers with empty values.

:drop_body

Automatically drops response body and Content-Type/Content-Length headers for response statuses indicating no body.

:halt

Augments request halt method for support for setting response status and/or response body.

:module_include

Adds request_module and response_module class methods for adding modules/methods to request/response classes.

:response_request

Gives response object access to request object.

:sinatra_helpers

Port of Sinatra::Helpers methods not covered by other plugins.

Routing Helpers

Plugin Name: Description:

:error_handler

Adds ability to automatically handle errors raised by the application.

:hooks

Adds before/after hook methods.

:not_found

Adds not_found method for handling responses not otherwise handled by a route.

:pass

Adds pass method for skipping the current matching route block as if it didn't match.

:path_rewriter

Adds support for rewriting paths before routing.

:status_handler

Adds status_handler method for handling responses without bodies for a given status code.

Matchers

Plugin Name: Description:

:empty_root

Makes root matcher match empty string in addition to single slash.

:hash_matcher

Adds hash_matcher class method for easily defining hash matchers.

:header_matchers

Adds matchers using information from the request headers.

:match_affix

Adds support for overriding default prefix/suffix used in match patterns.

:param_matchers

Adds matchers using information from the request params.

:path_matchers

Adds matchers using information from the request path.

:slash_path_empty

Considers a path of "/" as an empty path when doing a terminal match.

:symbol_matchers

Adds support for symbol-specific matching regexps.

Other

Plugin Name: Description:

:delay_build

Delay building the rack app until Roda.app is called.

:environments

Adds support for handling different execution environments (development/test/production).

:error_email

Adds ability to easily email a notification when an error is raised by the application.

:flash

Adds flash handling.

:heartbeat

Adds support for heartbeats.

:indifferent_params

Adds params method for indifferent parameters.

:json_parser

Parses request bodies in JSON format.

:mailer

Adds support for sending emails using the routing tree.

:middleware

Allows the Roda app to be used as middleware by another app.

:path

Adds support for named paths.

:per_thread_caching

Switches the thread-safe cache from a shared cache to a per-thread cache.

:shared_vars

Stores and retrieves variables shared between multiple Roda apps.



Plugins - (external)

Plugin Name: Description:

:autoforme

Adds autoforme method for automatic creation of administrative front-end for Sequel models.

:forme

Adds form method for simple creation of html forms inside erb templates.

:rodauth

Authentication Framework for Roda/Sequel/PostgreSQL.

:roda-action

Resolves actions stored in roda-container.

:roda-auth

Adds authentication support for Roda.

:roda-component

Adds realtime components using faye and opal.

:roda-container

Turns application into an inversion of control (IoC) container.

:roda-flow

Changes routing methods to delegate to containers.

:roda-i18n

Adds easy internationalization and localization support.

:roda-parse-request

Automatically parse JSON and URL-encoded requests.

:roda-route_list

Parses route metadata from comments in an app file, allowing introspection of routes.

:roda-rest_api

Adds support for easily creating RESTful APIs.

:roda-symbolized_params

Adds params method for symbolized params.

:roda-will_paginate

:will_paginate integration for Roda.

:rom-roda

Adds integration with Ruby Object Mapper.