class Jekyll::Plugin
def self.<=>(other)
other - The class to be compared.
Spaceship is priority [higher -> lower]
def self.<=>(other) PRIORITIES[other.priority] <=> PRIORITIES[self.priority] end
def self.inherited(base)
base - The Class subclass.
ever called by Ruby itself.
Install a hook so that subclasses are recorded. This method is only
def self.inherited(base) subclasses << base subclasses.sort! end
def self.priority(priority = nil)
:lowest, :low, :normal, :high, :highest
priority - The Symbol priority (default: nil). Valid options are:
set the priority.
argument it returns the priority. When an argument is given, it will
Get or set the priority of this plugin. When called without an
def self.priority(priority = nil) @priority ||= nil if priority && PRIORITIES.has_key?(priority) @priority = priority end @priority || :normal end
def self.safe(safe = nil)
safe - The Boolean safety (default: nil).
safety.
it returns the safety. When an argument is given, it will set the
Get or set the safety of this plugin. When called without an argument
def self.safe(safe = nil) if safe @safe = safe end @safe || false end
def self.subclasses
The list of Classes that have been subclassed.
def self.subclasses @subclasses ||= [] end
def initialize(config = {})
config - The Hash of configuration options.
Initialize a new plugin. This should be overridden by the subclass.
def initialize(config = {}) # no-op for default end