class OptParseValidator::OptDirectoryPath

Implemetantion of the DirectoryPath Option

Public Class Methods

new(option, attrs = {}) click to toggle source
Calls superclass method
# File lib/opt_parse_validator/opts/directory_path.rb, line 6
def initialize(option, attrs = {})
  super(option, attrs)

  @attrs.merge!(directory: true)
end

Public Instance Methods

check_create(path) click to toggle source

@param [ Pathname ] path

# File lib/opt_parse_validator/opts/directory_path.rb, line 13
def check_create(path)
  FileUtils.mkdir_p(path.to_s) unless Dir.exist?(path.to_s)
end