lib/opt_parse_validator/opts/path.rb
def validate(value)
      path = Pathname.new(value)

      allowed_attrs.each do |key|
        method = "check_#{key}"
        send(method, path) if respond_to?(method) && attrs[key]
      end

      path.to_s
    end
def validate(value)
      path = Pathname.new(value)

      allowed_attrs.each do |key|
        method = "check_#{key}"
        send(method, path) if respond_to?(method) && attrs[key]
      end

      path.to_s
    end
Initialize attrs:

 :create     if set to true, will create the path

 :exists     if set to false, will ignore the file? and directory? checks

 :file       Check if the path is a file
 :directory  Check if the path is a directory

 :executable
 :readable
 :writable

 @param [ String ] value

 @return [ String ]