class Derelict::Parser::Version

Parses the output of “vagrant –version”

Constants

PARSE_VERSION_FROM_OUTPUT

Regexp to extract the version from the “vagrant –version” output

Public Instance Methods

description() click to toggle source

Provides a description of this Parser

Mainly used for log messages.

# File lib/derelict/parser/version.rb, line 24
def description
  "Derelict::Parser::Version instance"
end
version() click to toggle source

Determines the version of Vagrant based on the output

# File lib/derelict/parser/version.rb, line 13
def version
  logger.debug "Parsing version from output using #{description}"
  matches = output.match PARSE_VERSION_FROM_OUTPUT
  raise InvalidFormat.new output if matches.nil?
  matches.captures[0]
end