def check
      stat = File.stat(directory) if File.exist?(directory)
      if stat
        if stat.directory?
          if !stat.readable?
            mark_message "Directory '#{directory}' is not readable."
            mark_failure
          elsif writable && !stat.writable?
            mark_message "Directory '#{directory}' is not writable."
            mark_failure
          elsif !writable && stat.writable?
            mark_message "Directory '#{directory}' is writable (undesired)."
            mark_failure
          else
            mark_message "Directory '#{directory}' is #{writable ? nil : 'NOT '}writable (as expected)."
          end
        else
          mark_message "'#{directory}' is not a directory."
          mark_failure
        end
      else
        mark_message "Directory '#{directory}' does not exist."
        mark_failure
      end
    end
def check
      stat = File.stat(directory) if File.exist?(directory)
      if stat
        if stat.directory?
          if !stat.readable?
            mark_message "Directory '#{directory}' is not readable."
            mark_failure
          elsif writable && !stat.writable?
            mark_message "Directory '#{directory}' is not writable."
            mark_failure
          elsif !writable && stat.writable?
            mark_message "Directory '#{directory}' is writable (undesired)."
            mark_failure
          else
            mark_message "Directory '#{directory}' is #{writable ? nil : 'NOT '}writable (as expected)."
          end
        else
          mark_message "'#{directory}' is not a directory."
          mark_failure
        end
      else
        mark_message "Directory '#{directory}' does not exist."
        mark_failure
      end
    end
Public: Initialize a new directory check.

 directory - the path of the directory.  Can be relative or absolute.
 writable - true if directory should allow writes;  false if not.
 Public: Return the status of the directory check