summaryrefslogtreecommitdiff
path: root/features/support/packages.rb
blob: fdbe931f6f8a404a1f756cdccf5e61d2bde6bc3f (plain)
1
2
3
4
5
6
7
8
9
10
11
# Provides a method to quickly lookup whether we have
# a given packaging system installed.
def package_system_available?(name)
  case name
  when 'MacPorts'
    uname = `uname`
    (uname =~ /Darwin/ && File.exist?('/opt') && shell_out("which port").status.success?)
  else
    false
  end
end