Sha256: 2f64dbafbe72428fca97883b7438a6de9672e4c1ed45683fa03b5a14a03d9d3f

Contents?: true

Size: 699 Bytes

Versions: 3

Compression:

Stored size: 699 Bytes

Contents

require 'chef/knife'
require 'yaml'

module KnifeSpork
  class SporkInfo < Chef::Knife

    deps do
      require 'knife-spork/runner'
    end

    banner 'knife spork info'

    def run
      self.class.send(:include, KnifeSpork::Runner)
      self.config = Chef::Config.merge!(config)

      run_plugins(:before_info)
      info
      run_plugins(:after_info)
    end

    private
    def info
      ui.msg "Config Hash:"
      ui.msg spork_config.to_yaml
      ui.msg ""
      ui.msg "Plugins:"
      KnifeSpork::Plugins.klasses.each do |klass|
        plugin = klass.new(:config => spork_config)
        ui.msg "#{klass}: #{plugin.enabled? ? 'enabled' : 'disabled'}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
knife-spork-1.7.2 lib/chef/knife/spork-info.rb
knife-spork-1.7.1 lib/chef/knife/spork-info.rb
knife-spork-1.7.0 lib/chef/knife/spork-info.rb