Class: MCollective::PluginPackager::StandardDefinition

### Home Classes Methods

### In Files

- lib/mcollective/pluginpackager/standard_definition.rb

### Parent

Object

### Methods

- ::new
- #common
- #identify_packages
- #plugin

### Files

- COPYING
- README
- Rakefile
- PLACEHOLDER
- PLACEHOLDER

### Class/Module Index

Quicksearch

- MCollective
- MCollective::Agent
- MCollective::Agents
- MCollective::Aggregate
- MCollective::Aggregate::Base
- MCollective::Aggregate::Result
- MCollective::Aggregate::Result::Base
- MCollective::Aggregate::Result::CollectionResult
- MCollective::Aggregate::Result::NumericResult
- MCollective::Application
- MCollective::Applications
- MCollective::Client
- MCollective::Config
- MCollective::Connector
- MCollective::Connector::Base
- MCollective::DDL
- MCollective::DDLValidationError
- MCollective::Data
- MCollective::Data::Base
- MCollective::Data::Result
- MCollective::Discovery
- MCollective::Facts
- MCollective::Facts::Base
- MCollective::Generators
- MCollective::Generators::AgentGenerator
- MCollective::Generators::Base
- MCollective::Generators::DataGenerator
- MCollective::InvalidRPCData
- MCollective::Log
- MCollective::Logger
- MCollective::Logger::Base
- MCollective::Logger::Console_logger
- MCollective::Logger::File_logger
- MCollective::Logger::Syslog_logger
- MCollective::Matcher
- MCollective::Matcher::Parser
- MCollective::Matcher::Scanner
- MCollective::Message
- MCollective::MissingRPCData
- MCollective::MsgDoesNotMatchRequestID
- MCollective::MsgTTLExpired
- MCollective::NotTargettedAtUs
- MCollective::Optionparser
- MCollective::PluginManager
- MCollective::PluginPackager
- MCollective::PluginPackager::AgentDefinition
- MCollective::PluginPackager::StandardDefinition
- MCollective::RPC
- MCollective::RPC::ActionRunner
- MCollective::RPC::Agent
- MCollective::RPC::Audit
- MCollective::RPC::Client
- MCollective::RPC::Helpers
- MCollective::RPC::Progress
- MCollective::RPC::Reply
- MCollective::RPC::Request
- MCollective::RPC::Result
- MCollective::RPC::Stats
- MCollective::RPCAborted
- MCollective::RPCError
- MCollective::Registration
- MCollective::Registration::Base
- MCollective::Runner
- MCollective::RunnerStats
- MCollective::SSL
- MCollective::Security
- MCollective::Security::Base
- MCollective::SecurityValidationFailed
- MCollective::Shell
- MCollective::UnixDaemon
- MCollective::UnknownRPCAction
- MCollective::UnknownRPCError
- MCollective::Util
- MCollective::WindowsDaemon
- Array
- Dir
- Object
- String
- Symbol

No matching classes.

# MCollective::PluginPackager::StandardDefinition

### Attributes

dependencies[RW]
iteration[RW]
mccommon[RW]
mcserver[RW]
metadata[RW]
packagedata[RW]
path[RW]
plugintype[RW]
postinstall[RW]
preinstall[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 51
    def common
      common = {:files => [],
                :dependencies => @dependencies.clone << @mccommon,
                :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 26
    def identify_packages
      common_package = common
      @packagedata[:common] = common_package if common_package
      plugin_package = plugin
      @packagedata[@plugintype] = plugin_package if plugin_package
    end

plugin() click to toggle source

Obtain standard plugin files and dependencies

    # File lib/mcollective/pluginpackager/standard_definition.rb, line 34
    def plugin
      plugindata = {:files => [],
                    :dependencies => @dependencies.clone << @mcserver,
                    :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", @metadata[:version]] if @packagedata[:common]
      plugindata
    end

### Public Class Methods

new(path, name, vendor, preinstall, postinstall, iteration, dependencies, mcodependency, plugintype) click to toggle source

    # File lib/mcollective/pluginpackager/standard_definition.rb, line 8
    def initialize(path, name, vendor, preinstall, postinstall, iteration, dependencies, mcodependency, plugintype)
      @plugintype = plugintype
      @path = path
      @packagedata = {}
      @iteration = iteration || 1
      @preinstall = preinstall
      @postinstall = postinstall
      @vendor = vendor || "Puppet Labs"
      @dependencies = dependencies || []
      @mcserver = mcodependency[:server] || "mcollective"
      @mccommon = mcodependency[:common] || "mcollective-common"
      @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.