module Roda::RodaPlugins

  1. lib/roda.rb
  2. lib/roda/plugins.rb
  3. lib/roda/plugins/Integer_matcher_max.rb
  4. lib/roda/plugins/_after_hook.rb
  5. lib/roda/plugins/_base64.rb
  6. lib/roda/plugins/_before_hook.rb
  7. lib/roda/plugins/_optimized_matching.rb
  8. lib/roda/plugins/_symbol_regexp_matchers.rb
  9. lib/roda/plugins/additional_render_engines.rb
  10. lib/roda/plugins/additional_view_directories.rb
  11. lib/roda/plugins/all_verbs.rb
  12. lib/roda/plugins/assets.rb
  13. lib/roda/plugins/assets_preloading.rb
  14. lib/roda/plugins/autoload_hash_branches.rb
  15. lib/roda/plugins/autoload_named_routes.rb
  16. lib/roda/plugins/backtracking_array.rb
  17. lib/roda/plugins/branch_locals.rb
  18. lib/roda/plugins/break.rb
  19. lib/roda/plugins/caching.rb
  20. lib/roda/plugins/capture_erb.rb
  21. lib/roda/plugins/chunked.rb
  22. lib/roda/plugins/class_level_routing.rb
  23. lib/roda/plugins/class_matchers.rb
  24. lib/roda/plugins/common_logger.rb
  25. lib/roda/plugins/content_for.rb
  26. lib/roda/plugins/content_security_policy.rb
  27. lib/roda/plugins/cookie_flags.rb
  28. lib/roda/plugins/cookies.rb
  29. lib/roda/plugins/csrf.rb
  30. lib/roda/plugins/custom_block_results.rb
  31. lib/roda/plugins/custom_matchers.rb
  32. lib/roda/plugins/default_headers.rb
  33. lib/roda/plugins/default_status.rb
  34. lib/roda/plugins/delay_build.rb
  35. lib/roda/plugins/delegate.rb
  36. lib/roda/plugins/delete_empty_headers.rb
  37. lib/roda/plugins/direct_call.rb
  38. lib/roda/plugins/disallow_file_uploads.rb
  39. lib/roda/plugins/drop_body.rb
  40. lib/roda/plugins/early_hints.rb
  41. lib/roda/plugins/empty_root.rb
  42. lib/roda/plugins/environments.rb
  43. lib/roda/plugins/erb_h.rb
  44. lib/roda/plugins/error_email.rb
  45. lib/roda/plugins/error_handler.rb
  46. lib/roda/plugins/error_mail.rb
  47. lib/roda/plugins/exception_page.rb
  48. lib/roda/plugins/filter_common_logger.rb
  49. lib/roda/plugins/flash.rb
  50. lib/roda/plugins/h.rb
  51. lib/roda/plugins/halt.rb
  52. lib/roda/plugins/hash_branch_view_subdir.rb
  53. lib/roda/plugins/hash_branches.rb
  54. lib/roda/plugins/hash_matcher.rb
  55. lib/roda/plugins/hash_paths.rb
  56. lib/roda/plugins/hash_routes.rb
  57. lib/roda/plugins/head.rb
  58. lib/roda/plugins/header_matchers.rb
  59. lib/roda/plugins/heartbeat.rb
  60. lib/roda/plugins/hooks.rb
  61. lib/roda/plugins/host_authorization.rb
  62. lib/roda/plugins/indifferent_params.rb
  63. lib/roda/plugins/inject_erb.rb
  64. lib/roda/plugins/invalid_request_body.rb
  65. lib/roda/plugins/json.rb
  66. lib/roda/plugins/json_parser.rb
  67. lib/roda/plugins/link_to.rb
  68. lib/roda/plugins/mail_processor.rb
  69. lib/roda/plugins/mailer.rb
  70. lib/roda/plugins/match_affix.rb
  71. lib/roda/plugins/match_hook.rb
  72. lib/roda/plugins/match_hook_args.rb
  73. lib/roda/plugins/middleware.rb
  74. lib/roda/plugins/middleware_stack.rb
  75. lib/roda/plugins/module_include.rb
  76. lib/roda/plugins/multi_public.rb
  77. lib/roda/plugins/multi_route.rb
  78. lib/roda/plugins/multi_run.rb
  79. lib/roda/plugins/multi_view.rb
  80. lib/roda/plugins/multibyte_string_matcher.rb
  81. lib/roda/plugins/named_routes.rb
  82. lib/roda/plugins/named_templates.rb
  83. lib/roda/plugins/not_allowed.rb
  84. lib/roda/plugins/not_found.rb
  85. lib/roda/plugins/optimized_segment_matchers.rb
  86. lib/roda/plugins/optimized_string_matchers.rb
  87. lib/roda/plugins/padrino_render.rb
  88. lib/roda/plugins/param_matchers.rb
  89. lib/roda/plugins/params_capturing.rb
  90. lib/roda/plugins/partials.rb
  91. lib/roda/plugins/pass.rb
  92. lib/roda/plugins/path.rb
  93. lib/roda/plugins/path_matchers.rb
  94. lib/roda/plugins/path_rewriter.rb
  95. lib/roda/plugins/placeholder_string_matchers.rb
  96. lib/roda/plugins/plain_hash_response_headers.rb
  97. lib/roda/plugins/precompile_templates.rb
  98. lib/roda/plugins/public.rb
  99. lib/roda/plugins/r.rb
  100. lib/roda/plugins/recheck_precompiled_assets.rb
  101. lib/roda/plugins/redirect_http_to_https.rb
  102. lib/roda/plugins/relative_path.rb
  103. lib/roda/plugins/render.rb
  104. lib/roda/plugins/render_coverage.rb
  105. lib/roda/plugins/render_each.rb
  106. lib/roda/plugins/render_locals.rb
  107. lib/roda/plugins/request_aref.rb
  108. lib/roda/plugins/request_headers.rb
  109. lib/roda/plugins/response_request.rb
  110. lib/roda/plugins/route_block_args.rb
  111. lib/roda/plugins/route_csrf.rb
  112. lib/roda/plugins/run_append_slash.rb
  113. lib/roda/plugins/run_handler.rb
  114. lib/roda/plugins/run_require_slash.rb
  115. lib/roda/plugins/sessions.rb
  116. lib/roda/plugins/shared_vars.rb
  117. lib/roda/plugins/sinatra_helpers.rb
  118. lib/roda/plugins/slash_path_empty.rb
  119. lib/roda/plugins/static.rb
  120. lib/roda/plugins/static_routing.rb
  121. lib/roda/plugins/status_303.rb
  122. lib/roda/plugins/status_handler.rb
  123. lib/roda/plugins/streaming.rb
  124. lib/roda/plugins/strip_path_prefix.rb
  125. lib/roda/plugins/symbol_matchers.rb
  126. lib/roda/plugins/symbol_status.rb
  127. lib/roda/plugins/symbol_views.rb
  128. lib/roda/plugins/timestamp_public.rb
  129. lib/roda/plugins/type_routing.rb
  130. lib/roda/plugins/typecast_params.rb
  131. lib/roda/plugins/typecast_params_sized_integers.rb
  132. lib/roda/plugins/unescape_path.rb
  133. lib/roda/plugins/view_options.rb
  134. lib/roda/request.rb
  135. lib/roda/response.rb
  136. show all

Module in which all Roda plugins should be stored. Also contains logic for registering and loading plugins.

Classes and Modules

  1. Roda::RodaPlugins::AdditionalRenderEngines
  2. Roda::RodaPlugins::AdditionalViewDirectories
  3. Roda::RodaPlugins::AllVerbs
  4. Roda::RodaPlugins::Assets
  5. Roda::RodaPlugins::AssetsPreloading
  6. Roda::RodaPlugins::AutoloadHashBranches
  7. Roda::RodaPlugins::AutoloadNamedRoutes
  8. Roda::RodaPlugins::BacktrackingArray
  9. Roda::RodaPlugins::Base
  10. Roda::RodaPlugins::Base64_
  11. Roda::RodaPlugins::BeforeHook
  12. Roda::RodaPlugins::BranchLocals
  13. Roda::RodaPlugins::Break
  14. Roda::RodaPlugins::Caching
  15. Roda::RodaPlugins::CaptureERB
  16. Roda::RodaPlugins::Chunked
  17. Roda::RodaPlugins::ClassLevelRouting
  18. Roda::RodaPlugins::ClassMatchers
  19. Roda::RodaPlugins::CommonLogger
  20. Roda::RodaPlugins::ContentFor
  21. Roda::RodaPlugins::ContentSecurityPolicy
  22. Roda::RodaPlugins::CookieFlags
  23. Roda::RodaPlugins::Cookies
  24. Roda::RodaPlugins::Csrf
  25. Roda::RodaPlugins::CustomBlockResults
  26. Roda::RodaPlugins::CustomMatchers
  27. Roda::RodaPlugins::DefaultHeaders
  28. Roda::RodaPlugins::DefaultStatus
  29. Roda::RodaPlugins::DelayBuild
  30. Roda::RodaPlugins::Delegate
  31. Roda::RodaPlugins::DeleteEmptyHeaders
  32. Roda::RodaPlugins::DirectCall
  33. Roda::RodaPlugins::DisallowFileUploads
  34. Roda::RodaPlugins::DropBody
  35. Roda::RodaPlugins::EarlyHints
  36. Roda::RodaPlugins::EmptyRoot
  37. Roda::RodaPlugins::Environments
  38. Roda::RodaPlugins::ErbH
  39. Roda::RodaPlugins::ErrorEmail
  40. Roda::RodaPlugins::ErrorHandler
  41. Roda::RodaPlugins::ErrorMail
  42. Roda::RodaPlugins::ExceptionPage
  43. Roda::RodaPlugins::FilterCommonLogger
  44. Roda::RodaPlugins::Flash
  45. Roda::RodaPlugins::H
  46. Roda::RodaPlugins::Halt
  47. Roda::RodaPlugins::HashBranchViewSubdir
  48. Roda::RodaPlugins::HashBranches
  49. Roda::RodaPlugins::HashMatcher
  50. Roda::RodaPlugins::HashPaths
  51. Roda::RodaPlugins::HashRoutes
  52. Roda::RodaPlugins::Head
  53. Roda::RodaPlugins::HeaderMatchers
  54. Roda::RodaPlugins::Heartbeat
  55. Roda::RodaPlugins::Hooks
  56. Roda::RodaPlugins::HostAuthorization
  57. Roda::RodaPlugins::IndifferentParams
  58. Roda::RodaPlugins::InjectERB
  59. Roda::RodaPlugins::IntegerMatcherMax
  60. Roda::RodaPlugins::InvalidRequestBody
  61. Roda::RodaPlugins::Json
  62. Roda::RodaPlugins::JsonParser
  63. Roda::RodaPlugins::LinkTo
  64. Roda::RodaPlugins::MailProcessor
  65. Roda::RodaPlugins::Mailer
  66. Roda::RodaPlugins::MatchAffix
  67. Roda::RodaPlugins::MatchHook
  68. Roda::RodaPlugins::MatchHookArgs
  69. Roda::RodaPlugins::Middleware
  70. Roda::RodaPlugins::MiddlewareStack
  71. Roda::RodaPlugins::ModuleInclude
  72. Roda::RodaPlugins::MultiPublic
  73. Roda::RodaPlugins::MultiRoute
  74. Roda::RodaPlugins::MultiRun
  75. Roda::RodaPlugins::MultiView
  76. Roda::RodaPlugins::MultibyteStringMatcher
  77. Roda::RodaPlugins::NamedRoutes
  78. Roda::RodaPlugins::NamedTemplates
  79. Roda::RodaPlugins::NotAllowed
  80. Roda::RodaPlugins::NotFound
  81. Roda::RodaPlugins::OptimizedMatching
  82. Roda::RodaPlugins::OptimizedSegmentMatchers
  83. Roda::RodaPlugins::OptimizedStringMatchers
  84. Roda::RodaPlugins::PadrinoRender
  85. Roda::RodaPlugins::ParamMatchers
  86. Roda::RodaPlugins::ParamsCapturing
  87. Roda::RodaPlugins::Partials
  88. Roda::RodaPlugins::Pass
  89. Roda::RodaPlugins::Path
  90. Roda::RodaPlugins::PathMatchers
  91. Roda::RodaPlugins::PathRewriter
  92. Roda::RodaPlugins::PlaceholderStringMatchers
  93. Roda::RodaPlugins::PlainHashResponseHeaders
  94. Roda::RodaPlugins::PrecompileTemplates
  95. Roda::RodaPlugins::Public
  96. Roda::RodaPlugins::R
  97. Roda::RodaPlugins::RecheckPrecompiledAssets
  98. Roda::RodaPlugins::RedirectHttpToHttps
  99. Roda::RodaPlugins::RelativePath
  100. Roda::RodaPlugins::Render
  101. Roda::RodaPlugins::RenderCoverage
  102. Roda::RodaPlugins::RenderEach
  103. Roda::RodaPlugins::RenderLocals
  104. Roda::RodaPlugins::RequestAref
  105. Roda::RodaPlugins::RequestHeaders
  106. Roda::RodaPlugins::ResponseRequest
  107. Roda::RodaPlugins::RouteBlockArgs
  108. Roda::RodaPlugins::RouteCsrf
  109. Roda::RodaPlugins::RunAppendSlash
  110. Roda::RodaPlugins::RunHandler
  111. Roda::RodaPlugins::RunRequireSlash
  112. Roda::RodaPlugins::Sessions
  113. Roda::RodaPlugins::SharedVars
  114. Roda::RodaPlugins::SinatraHelpers
  115. Roda::RodaPlugins::SlashPathEmpty
  116. Roda::RodaPlugins::Static
  117. Roda::RodaPlugins::StaticRouting
  118. Roda::RodaPlugins::Status303
  119. Roda::RodaPlugins::StatusHandler
  120. Roda::RodaPlugins::Streaming
  121. Roda::RodaPlugins::StripPathPrefix
  122. Roda::RodaPlugins::SymbolMatchers
  123. Roda::RodaPlugins::SymbolRegexpMatchers
  124. Roda::RodaPlugins::SymbolStatus
  125. Roda::RodaPlugins::SymbolViews
  126. Roda::RodaPlugins::TimestampPublic
  127. Roda::RodaPlugins::TypeRouting
  128. Roda::RodaPlugins::TypecastParams
  129. Roda::RodaPlugins::TypecastParamsSizedIntegers
  130. Roda::RodaPlugins::UnescapePath
  131. 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