Module in which all Roda
plugins should be stored. Also contains logic for registering and loading plugins.
Classes and Modules
- Roda::RodaPlugins::AdditionalRenderEngines
- Roda::RodaPlugins::AdditionalViewDirectories
- Roda::RodaPlugins::AllVerbs
- Roda::RodaPlugins::Assets
- Roda::RodaPlugins::AssetsPreloading
- Roda::RodaPlugins::AssumeSSL
- Roda::RodaPlugins::AutoloadHashBranches
- Roda::RodaPlugins::AutoloadNamedRoutes
- Roda::RodaPlugins::BacktrackingArray
- Roda::RodaPlugins::Base
- Roda::RodaPlugins::Base64_
- Roda::RodaPlugins::BeforeHook
- Roda::RodaPlugins::BranchLocals
- Roda::RodaPlugins::Break
- Roda::RodaPlugins::Caching
- Roda::RodaPlugins::CaptureERB
- Roda::RodaPlugins::Chunked
- Roda::RodaPlugins::ClassLevelRouting
- Roda::RodaPlugins::ClassMatchers
- Roda::RodaPlugins::CommonLogger
- Roda::RodaPlugins::ConditionalSessions
- Roda::RodaPlugins::ContentFor
- Roda::RodaPlugins::ContentSecurityPolicy
- Roda::RodaPlugins::CookieFlags
- Roda::RodaPlugins::Cookies
- Roda::RodaPlugins::Csrf
- Roda::RodaPlugins::CustomBlockResults
- Roda::RodaPlugins::CustomMatchers
- Roda::RodaPlugins::DefaultHeaders
- Roda::RodaPlugins::DefaultStatus
- Roda::RodaPlugins::DelayBuild
- Roda::RodaPlugins::Delegate
- Roda::RodaPlugins::DeleteEmptyHeaders
- Roda::RodaPlugins::DirectCall
- Roda::RodaPlugins::DisallowFileUploads
- Roda::RodaPlugins::DropBody
- Roda::RodaPlugins::EarlyHints
- Roda::RodaPlugins::EmptyRoot
- Roda::RodaPlugins::Environments
- Roda::RodaPlugins::ErbH
- Roda::RodaPlugins::ErrorEmail
- Roda::RodaPlugins::ErrorHandler
- Roda::RodaPlugins::ErrorMail
- Roda::RodaPlugins::ExceptionPage
- Roda::RodaPlugins::FilterCommonLogger
- Roda::RodaPlugins::Flash
- Roda::RodaPlugins::H
- Roda::RodaPlugins::Halt
- Roda::RodaPlugins::HashBranchViewSubdir
- Roda::RodaPlugins::HashBranches
- Roda::RodaPlugins::HashMatcher
- Roda::RodaPlugins::HashPaths
- Roda::RodaPlugins::HashRoutes
- Roda::RodaPlugins::Head
- Roda::RodaPlugins::HeaderMatchers
- Roda::RodaPlugins::Heartbeat
- Roda::RodaPlugins::HmacPaths
- Roda::RodaPlugins::Hooks
- Roda::RodaPlugins::HostAuthorization
- Roda::RodaPlugins::HostRouting
- Roda::RodaPlugins::Hsts
- Roda::RodaPlugins::IndifferentParams
- Roda::RodaPlugins::InjectERB
- Roda::RodaPlugins::IntegerMatcherMax
- Roda::RodaPlugins::InvalidRequestBody
- Roda::RodaPlugins::Json
- Roda::RodaPlugins::JsonParser
- Roda::RodaPlugins::LinkTo
- Roda::RodaPlugins::MailProcessor
- Roda::RodaPlugins::Mailer
- Roda::RodaPlugins::MatchAffix
- Roda::RodaPlugins::MatchHook
- Roda::RodaPlugins::MatchHookArgs
- Roda::RodaPlugins::Middleware
- Roda::RodaPlugins::MiddlewareStack
- Roda::RodaPlugins::ModuleInclude
- Roda::RodaPlugins::MultiPublic
- Roda::RodaPlugins::MultiRoute
- Roda::RodaPlugins::MultiRun
- Roda::RodaPlugins::MultiView
- Roda::RodaPlugins::MultibyteStringMatcher
- Roda::RodaPlugins::NamedRoutes
- Roda::RodaPlugins::NamedTemplates
- Roda::RodaPlugins::NotAllowed
- Roda::RodaPlugins::NotFound
- Roda::RodaPlugins::OptimizedMatching
- Roda::RodaPlugins::OptimizedSegmentMatchers
- Roda::RodaPlugins::OptimizedStringMatchers
- Roda::RodaPlugins::PadrinoRender
- Roda::RodaPlugins::ParamMatchers
- Roda::RodaPlugins::ParamsCapturing
- Roda::RodaPlugins::Partials
- Roda::RodaPlugins::Pass
- Roda::RodaPlugins::Path
- Roda::RodaPlugins::PathMatchers
- Roda::RodaPlugins::PathRewriter
- Roda::RodaPlugins::PermissionsPolicy
- Roda::RodaPlugins::PlaceholderStringMatchers
- Roda::RodaPlugins::PlainHashResponseHeaders
- Roda::RodaPlugins::PrecompileTemplates
- Roda::RodaPlugins::Public
- Roda::RodaPlugins::R
- Roda::RodaPlugins::RecheckPrecompiledAssets
- Roda::RodaPlugins::RedirectHttpToHttps
- Roda::RodaPlugins::RelativePath
- Roda::RodaPlugins::Render
- Roda::RodaPlugins::RenderCoverage
- Roda::RodaPlugins::RenderEach
- Roda::RodaPlugins::RenderLocals
- Roda::RodaPlugins::RequestAref
- Roda::RodaPlugins::RequestHeaders
- Roda::RodaPlugins::ResponseRequest
- Roda::RodaPlugins::RouteBlockArgs
- Roda::RodaPlugins::RouteCsrf
- Roda::RodaPlugins::RunAppendSlash
- Roda::RodaPlugins::RunHandler
- Roda::RodaPlugins::RunRequireSlash
- Roda::RodaPlugins::Sessions
- Roda::RodaPlugins::SharedVars
- Roda::RodaPlugins::SinatraHelpers
- Roda::RodaPlugins::SlashPathEmpty
- Roda::RodaPlugins::Static
- Roda::RodaPlugins::StaticRouting
- Roda::RodaPlugins::Status303
- Roda::RodaPlugins::StatusHandler
- Roda::RodaPlugins::Streaming
- Roda::RodaPlugins::StripPathPrefix
- Roda::RodaPlugins::SymbolClassMatchers_
- Roda::RodaPlugins::SymbolMatchers
- Roda::RodaPlugins::SymbolRegexpMatchers
- Roda::RodaPlugins::SymbolStatus
- Roda::RodaPlugins::SymbolViews
- Roda::RodaPlugins::TimestampPublic
- Roda::RodaPlugins::TypeRouting
- Roda::RodaPlugins::TypecastParams
- Roda::RodaPlugins::TypecastParamsSizedIntegers
- Roda::RodaPlugins::UnescapePath
- Roda::RodaPlugins::ViewOptions
Constants
EMPTY_ARRAY | = | [].freeze | ||
OPTS | = | {}.freeze |
Public Class methods
deprecate_constant(mod, name)
Deprecate the constant with the given name in the given module, if the ruby version supports it.
[show source]
# File lib/roda/plugins.rb 45 def self.deprecate_constant(mod, name) 46 # :nocov: 47 if RUBY_VERSION >= '2.3' 48 mod.deprecate_constant(name) 49 end 50 # :nocov: 51 end
load_plugin(name)
If the registered plugin already exists, use it. Otherwise, require it and return it. This raises a LoadError if such a plugin doesn’t exist, or a RodaError
if it exists but it does not register itself correctly.
[show source]
# File lib/roda/plugins.rb 26 def self.load_plugin(name) 27 h = @plugins 28 unless plugin = h[name] 29 require "roda/plugins/#{name}" 30 raise RodaError, "Plugin #{name} did not register itself correctly in Roda::RodaPlugins" unless plugin = h[name] 31 end 32 plugin 33 end
register_plugin(name, mod)
Register the given plugin with Roda
, so that it can be loaded using plugin with a symbol. Should be used by plugin files. Example:
Roda::RodaPlugins.register_plugin(:plugin_name, PluginModule)
[show source]
# File lib/roda/plugins.rb 39 def self.register_plugin(name, mod) 40 @plugins[name] = mod 41 end