lib/pigeon/support.rb
def find_writable_directory(*list)
    list.flatten.compact.find do |dir|
      File.exist?(dir) and File.writable?(dir)
    end
  end
# Finds the first directory in the given list that exists and is
# writable. Returns nil if none match.
Finds the first directory in the given list that exists and is
writable. Returns nil if none match.
Finds the first directory in the given list that exists and is writable . Returns nil if none match .
def find_writable_directory(*list)
    list.flatten.compact.find do |dir|
      File.exist?(dir) and File.writable?(dir)
    end
  end
def find_writable_directory ( * list ) list . flatten . compact . find do | dir | File . exist? ( dir ) and File . writable? ( dir ) end end
Finds the first directory in the given list that exists and is
writable.
Finds the first directory in the given list that exists and is writable .
list