Method: Cog::DSL::Cogfile#plugin_path

Defined in:
lib/cog/dsl/cogfile.rb

#plugin_path(path, absolute = false) ⇒ nil

Define a directory in which to find plugins. A call to this method will be ignored if the containing cogfile is itself being treated as a plugin.

Parameters:

Returns:

  • (nil)


68
69
70
71
72
73
74
75
# File 'lib/cog/dsl/cogfile.rb', line 68

def plugin_path(path, absolute=false)
  return if plugin?
  path = add_config_path :plugin, path, absolute
  if path && File.exists?(path)
    raise Errors::PluginPathIsNotADirectory.new path unless File.directory?(path)
    @cogfile_context[:config].register_plugins path
  end
end