module Staticpress::Plugin
Public Class Methods
activate_enabled()
click to toggle source
# File lib/staticpress/plugin.rb, line 5 def self.activate_enabled config.plugins.each do |plugin_name| require find(plugin_name).to_s end end
find(name)
click to toggle source
# File lib/staticpress/plugin.rb, line 11 def self.find(name) file_name = name.end_with?('.rb') ? name : "#{name}.rb" plugin_locations.each do |location| file = location + file_name return file if file.file? end raise Staticpress::Error, "Plugin not found: #{name}" end
plugin_locations()
click to toggle source
# File lib/staticpress/plugin.rb, line 22 def self.plugin_locations [ ((Staticpress.blog_path + config.plugins_path) if config.plugins_path), (Staticpress.root + 'staticpress' + 'plugins') ].compact end