Parent

Class/Module Index [+]

Quicksearch

MCollective::PluginPackager::StandardDefinition

Attributes

iteration[RW]
metadata[RW]
packagedata[RW]
path[RW]
plugintype[RW]
postinstall[RW]
target_path[RW]
vendor[RW]

Public Instance Methods

common() click to toggle source

Obtain list of common files

# File lib/mcollective/pluginpackager/standard_definition.rb, line 44
def common
  common = {:files => [],
            :dependencies => ["mcolelctive-common"],
            :description => "Common libraries for #{@name} connector plugin"}

  commondir = File.join(@path, "util")
  if PluginPackager.check_dir_present commondir
    common[:files] = Dir.glob(File.join(commondir, "*"))
    return common
  else
    return nil
  end
end
identify_packages() click to toggle source

Identify present packages and populate the packagedata hash

# File lib/mcollective/pluginpackager/standard_definition.rb, line 21
def identify_packages
  @packagedata[:common] = common
  @packagedata[@plugintype] = plugin
end
plugin() click to toggle source

Obtain standard plugin files and dependencies

# File lib/mcollective/pluginpackager/standard_definition.rb, line 27
def plugin
  plugindata = {:files => [],
                :dependencies => ["mcollective"],
                :description => "#{@name} #{@plugintype} plugin for the Marionette Collective."}

  plugindir = File.join(@path, @plugintype.to_s)
  if PluginPackager.check_dir_present plugindir
    plugindata[:files] = Dir.glob(File.join(plugindir, "*"))
  else
    return nil
  end

  plugindata[:dependencies] <<"mcollective-#{@metadata[:name]}-common" if @packagedata[:common]
  plugindata
end

Public Class Methods

new(path, name, vendor, postinstall, iteration, plugintype) click to toggle source
# File lib/mcollective/pluginpackager/standard_definition.rb, line 7
def initialize(path, name, vendor, postinstall, iteration, plugintype)
  @plugintype = plugintype
  @path = path
  @packagedata = {}
  @iteration = iteration || 1
  @postinstall = postinstall
  @vendor = vendor || "Puppet Labs"
  @target_path = File.expand_path(@path)
  @metadata = PluginPackager.get_metadata(@path, @plugintype)
  @metadata[:name] = (name || @metadata[:name]).downcase.gsub(" ", "_")
  identify_packages
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.