module Thoth::Plugin
Namespace for Thoth
plugins. See wiki.github.com/pagojo/rethoth/creating-plugins for more info on creating and using plugins.
Public Class Methods
const_missing(name)
click to toggle source
# File lib/thoth/plugin.rb, line 36 def self.const_missing(name) self.load(name) self.const_get(name) end
load(name)
click to toggle source
Attempts to load the specified plugin, first from the project's /plugin
directory, then from Thoth's and then as a gem.
# File lib/thoth/plugin.rb, line 43 def self.load(name) plugin = "thoth_#{name.to_s.downcase.gsub(/^thoth_/, '')}" files = Dir["{#{HOME_DIR}/plugin,#{LIB_DIR}/plugin," << "#{$:.join(',')}}/#{plugin}.rb"] # First try to load a local copy of the plugin, then try the gem. unless (files.any? && require(files.first)) || require(plugin) raise LoadError, "Thoth::Plugin::#{name} not found" end Ramaze::Log.info "Loaded plugin: #{plugin}" true end