Exception: PSP::Toolchain::Errors::InvalidPrefix

Inherits:
PSP::Toolchain::Error show all
Defined in:
lib/psp/toolchain/errors/invalid_prefix.rb

Overview

Raised when the directory given for the :prefix option does not exist.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check(options) ⇒ Pathname

Returns The prefix value converted into a Pathname.

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :prefix (String)

    The prefix directory.

Returns:

  • (Pathname)

    The prefix value converted into a Pathname.



13
14
15
# File 'lib/psp/toolchain/errors/invalid_prefix.rb', line 13

def self.check(options)
  Pathname.new( options[:prefix] ).expand_path.tap { |prefix| raise self unless prefix.exist? }
end

Instance Method Details

#to_sString

Returns The error message.

Returns:

  • (String)

    The error message.



18
19
20
# File 'lib/psp/toolchain/errors/invalid_prefix.rb', line 18

def to_s
  'prefix directory does not exist'
end