Method: Beaker::Options::Validator#validate_path

Defined in:
lib/beaker/options/validator.rb

#validate_path(path) ⇒ Object

Raise an error if path is not a valid file or directory

Parameters:

  • path (String)

    File path

Raises:

  • (ArgumentError)

    Raises if path is not a valid file or directory



139
140
141
142
143
# File 'lib/beaker/options/validator.rb', line 139

def validate_path(path)
  if !File.file?(path) && !File.directory?(path)
    validator_error("#{path} used as a file option but is not a file or directory!")
  end
end