### Home Classes Methods

### In Files

- lib/mcollective/pluginpackager/agent_definition.rb
- lib/mcollective/pluginpackager/standard_definition.rb
- lib/mcollective/pluginpackager.rb

### Namespace

- CLASS MCollective::PluginPackager::AgentDefinition
- CLASS MCollective::PluginPackager::StandardDefinition

### Methods

- ::[]
- ::build_tool?
- ::check_dir_present
- ::do_quietly?
- ::get_metadata
- ::load_packagers
- ::safe_system

### 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

### Public Class Methods

[](klass) click to toggle source

    # File lib/mcollective/pluginpackager.rb, line 12
    def self.[](klass)
      const_get("#{klass}")
    end

build_tool?(build_tool) click to toggle source

Checks if a build tool is present on the system

    # File lib/mcollective/pluginpackager.rb, line 52
    def self.build_tool?(build_tool)
      ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
        builder = File.join(path, build_tool)
        if File.exists?(builder)
          return true
        end
      end
      false
    end

check_dir_present(path) click to toggle source

Checks if a directory is present and not empty

    # File lib/mcollective/pluginpackager.rb, line 29
    def self.check_dir_present(path)
      (File.directory?(path) && !Dir.glob(File.join(path, "*")).empty?)
    end

do_quietly?(verbose, &block) click to toggle source

Quietly calls a block if verbose parameter is false

    # File lib/mcollective/pluginpackager.rb, line 34
    def self.do_quietly?(verbose, &block)
      unless verbose
        old_stdout = $stdout.clone
        $stdout.reopen(File.new("/dev/null", "w"))
        begin
          block.call
        rescue Exception => e
          $stdout.reopen old_stdout
          raise e
        ensure
          $stdout.reopen old_stdout
        end
      else
        block.call
      end
    end

get_metadata(path, type) click to toggle source

Fetch and return metadata from plugin DDL

    # File lib/mcollective/pluginpackager.rb, line 17
    def self.get_metadata(path, type)
      ddl = DDL.new("package", type.to_sym, false)
      begin
        ddl_file = File.read(Dir.glob(File.join(path, type, "*.ddl")).first)
      rescue Exception
        raise "failed to load ddl file in plugin directory : #{File.join(path, type)}"
      end
      ddl.instance_eval ddl_file
      ddl.meta
    end

load_packagers() click to toggle source

Package implementation plugins

    # File lib/mcollective/pluginpackager.rb, line 8
    def self.load_packagers
      PluginManager.find_and_load("pluginpackager")
    end

safe_system(*args) click to toggle source

    # File lib/mcollective/pluginpackager.rb, line 62
    def self.safe_system(*args)
      raise RuntimeError, "Failed: #{args.join(' ')}" unless system *args
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.