Module: Derelict

Extended by:
Utils::Logger
Defined in:
lib/derelict.rb,
lib/derelict/box.rb,
lib/derelict/utils.rb,
lib/derelict/parser.rb,
lib/derelict/plugin.rb,
lib/derelict/version.rb,
lib/derelict/executer.rb,
lib/derelict/instance.rb,
lib/derelict/exception.rb,
lib/derelict/connection.rb,
lib/derelict/box/manager.rb,
lib/derelict/utils/logger.rb,
lib/derelict/box/not_found.rb,
lib/derelict/parser/status.rb,
lib/derelict/parser/version.rb,
lib/derelict/plugin/manager.rb,
lib/derelict/parser/box_list.rb,
lib/derelict/virtual_machine.rb,
lib/derelict/instance/invalid.rb,
lib/derelict/plugin/not_found.rb,
lib/derelict/connection/invalid.rb,
lib/derelict/instance/not_found.rb,
lib/derelict/parser/plugin_list.rb,
lib/derelict/connection/not_found.rb,
lib/derelict/instance/non_directory.rb,
lib/derelict/instance/command_failed.rb,
lib/derelict/instance/missing_binary.rb,
lib/derelict/virtual_machine/invalid.rb,
lib/derelict/exception/optional_reason.rb,
lib/derelict/utils/logger/invalid_type.rb,
lib/derelict/virtual_machine/not_found.rb,
lib/derelict/utils/logger/raw_formatter.rb,
lib/derelict/parser/status/invalid_format.rb,
lib/derelict/utils/logger/array_outputter.rb,
lib/derelict/parser/version/invalid_format.rb,
lib/derelict/parser/box_list/invalid_format.rb,
lib/derelict/parser/plugin_list/invalid_format.rb,
lib/derelict/parser/plugin_list/needs_reinstall.rb

Overview

Main module/entry point for Derelict

Defined Under Namespace

Modules: Utils Classes: Box, Connection, Exception, Executer, Instance, Parser, Plugin, VirtualMachine

Constant Summary collapse

VERSION =
"0.6.2"

Class Method Summary collapse

Methods included from Utils::Logger

logger

Class Method Details

.debug!(options = {}) ⇒ Object

Enables (or disables) Derelict’s debug mode

When in debug mode, Derelict will log to stderr. The debug level can be controlled as well (which affects the verbosity of the logging).

Valid (symbol) keys for the options hash include:

* enabled: Whether debug mode should be enabled (defaults to true)
* level:   Allows setting a custom log level (defaults to INFO)


47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/derelict.rb', line 47

def debug!(options = {})
  options = debug_options_defaults.merge options
  logger.level = options[:enabled] ? options[:level] : Log4r::OFF

  if options[:enabled]
    logger.add stderr unless logger.outputters.include? stderr
    logger.info "enabling debug mode"
  else
    logger.info "disabling debug mode"
    logger.remove "stderr"
  end

  self
end

.instance(path = Instance::DEFAULT_PATH) ⇒ Object

Creates a new Derelict instance for a Vagrant installation

* path: The path to the Vagrant installation (optional, defaults
        to Instance::DEFAULT_PATH)


32
33
34
35
# File 'lib/derelict.rb', line 32

def instance(path = Instance::DEFAULT_PATH)
  logger.info "Creating and validating new instance for '#{path}'"
  Instance.new(path).validate!
end