Class/Module Index [+]

Quicksearch

Ramaze::Plugin

Public Instance Methods

add_path(path) click to toggle source
# File lib/ramaze/plugin.rb, line 38
def add_path(path)
  PATH.unshift(File.expand_path(path))
  PATH.uniq!
end
add_pool(pool) click to toggle source
# File lib/ramaze/plugin.rb, line 31
def add_pool(pool)
  POOL.unshift(pool)
  POOL.uniq!
end
glob(name = '*') click to toggle source
# File lib/ramaze/plugin.rb, line 61
def glob(name = '*')
  "{#{paths.join(',')}}/plugin/#{name}.{#{EXTS.join(',')}}"
end
load(name, options) click to toggle source
# File lib/ramaze/plugin.rb, line 46
def load(name, options)
  name = name.to_s
  try_require(name.snake_case)
  PLUGIN_LIST << [name, const_get(name.camel_case), options]
rescue Exception => exception
  Log.error(exception)
  raise LoadError, "Plugin #{name} not found"
end
paths() click to toggle source
# File lib/ramaze/plugin.rb, line 65
def paths
  PATH
end
setup() click to toggle source
# File lib/ramaze/plugin.rb, line 19
def setup
  PLUGIN_LIST.each do |name, const, options|
    const.setup(options) if const.respond_to?(:setup)
  end
end
teardown() click to toggle source
# File lib/ramaze/plugin.rb, line 25
def teardown
  PLUGIN_LIST.each do |name, const, options|
    const.teardown if const.respond_to?(:teardown)
  end
end
try_require(name) click to toggle source
# File lib/ramaze/plugin.rb, line 55
def try_require(name)
  found = Dir[glob(name)].first
  require(File.expand_path(found)) if found
rescue LoadError
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.