module Roda::RodaPlugins

def self.deprecate_constant(mod, name)

if the ruby version supports it.
Deprecate the constant with the given name in the given module,
def self.deprecate_constant(mod, name)
  # :nocov:
  if RUBY_VERSION >= '2.3'
    mod.deprecate_constant(name)
  end
  # :nocov:
end

def self.load_plugin(name)

not register itself correctly.
plugin doesn't exist, or a RodaError if it exists but it does
require it and return it. This raises a LoadError if such a
If the registered plugin already exists, use it. Otherwise,
def self.load_plugin(name)
  h = @plugins
  unless plugin = h[name]
    require "roda/plugins/#{name}"
    raise RodaError, "Plugin #{name} did not register itself correctly in Roda::RodaPlugins" unless plugin = h[name]
  end
  plugin
end

def self.register_plugin(name, mod)

Roda::RodaPlugins.register_plugin(:plugin_name, PluginModule)

with a symbol. Should be used by plugin files. Example:
Register the given plugin with Roda, so that it can be loaded using #plugin
def self.register_plugin(name, mod)
  @plugins[name] = mod
end