Parent

Methods

Syckle::Plugins::Custom

Custom Plugin

Use this plugin to create your own “quicky” service.

This is a useful alternative to writing a full-blown plugin class when the need is simple.

Constants

DEFAULT_PIPELINE

Default pipeline(s) in which this plugin operates.

Attributes

pipeline[RW]

Which pipeline(s) to run this custom plugin.

Public Class Methods

new(context, key, options) click to toggle source

Instantiate new custom plugin.

FIXME: Custom#initialize seems to be running twice at startup. Why?

This works by interpreting the service configuration as a hash of phase names => ruby code.

# File lib/plugins/syckle/custom.rb, line 35
def initialize(context, key, options)
  super
  options.each do |phase, script|
    # skip specific names used for configuration
    next if phase == 'service'
    next if phase == 'pipeline' or key == 'pipelines'
    next if phase == 'active'
    next if phase == 'priority'
    # remaining options are names of pipeline phases
    pipelines.each do |pipe|
      src = %{
        def #{pipe}_#{phase}
          #{script}
        end
      }
      (class << self; self; end).module_eval(src)
    end
  end
end

Public Instance Methods

pipeline=(val) click to toggle source

Special writer to allow single pipeline or a list of pipelines.

# File lib/plugins/syckle/custom.rb, line 22
def pipeline=(val)
  @pipeline = [val].flatten
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.