class AdLint::Validation::DirsPresenceValidator

Public Instance Methods

execute(attr_owner) click to toggle source
# File lib/adlint/util.rb, line 320
def execute(attr_owner)
  val = target_value(attr_owner)

  bad_paths = val.reject { |path|
    File.exist?(path) && File.directory?(path)
  }

  unless bad_paths.empty?
    bad_paths.each do |path|
      @errors.push("`#{qualified_attr_name(attr_owner)}' " +
                   "contains non-existent pathname (#{path.to_s}).")
    end
    return false
  end
  true
end