Class: Kitchen::Command::DriverDiscover

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/command/driver_discover.rb

Overview

Command to discover drivers published on RubyGems.

Author:

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Constructor Details

This class inherits a constructor from Kitchen::Command::Base

Instance Method Details

#callObject

Invoke the command.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/kitchen/command/driver_discover.rb', line 36

def call
  # We are introducing the idea of using the Chef configuration as a
  # unified config for all the ChefDK tools.  The first practical
  # implementation of this is 1 location to setup proxy configurations.
  if defined?(ChefConfig::WorkstationConfigLoader)
    ChefConfig::WorkstationConfigLoader.new(options[:chef_config_path]).load
  end
  ChefConfig::Config.export_proxies if defined?(ChefConfig::Config.export_proxies)

  specs = fetch_gem_specs.sort_by { |spec| spec[0] }
  specs = specs[0, 49].push(["...", "..."]) if specs.size > 49
  specs = specs.unshift(["Gem Name", "Latest Stable Release"])
  print_table(specs, indent: 4)
end