aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/spec/support/file_helper.rb
blob: 8eb78f759fd7cf45f96326c511ccc9b6bce1097e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module FileHelper
  class << self
    def local_binary_path(name)
      File.expand_path(File.join(File.dirname(__FILE__), "binaries", name))
    end

    def local_binary_url(name)
      "file://" + local_binary_path(name)
    end

    def valid_alias?(candidate)
      return false unless candidate.symlink?
      candidate.readlink.exist?
    end
  end
end