Sha256: d0321b25a9ca2f9b3ee0bbec9cbd308a0e1e32704cee32fc141953c9a1a28311

Contents?: true

Size: 951 Bytes

Versions: 1

Compression:

Stored size: 951 Bytes

Contents

require 'rubygems'
require 'os'
success = true

ENV['PATH'] = '/opt/rdp_project_local/bin/:' + ENV['PATH'] # macports' bin in first

module CheckInstalledMac

 # should output an error message...
 def self.check_for_installed name
  # check for these with generic "does it run"

  command = {"gocr" => "gocr --help", "convert" => "convert --help", "ffmpeg" => "ffmpeg -version", "mplayer" => "mplayer"}[name]

  raise 'unknown ' + name unless command # sanity check

  unless system("/opt/rdp_project_local/bin/#{command} 1>/dev/null 2>&1")
     name = 'ImageMagick' if name == 'convert' # special case...
     puts 'lacking dependency! Please install ' + name + ' by installing from the mac dependencies link from the website first'
     false
  else
    true
  end

 end
end

if $0 == __FILE__
  for name in ['gocr', 'convert', 'mplayer', 'ffmpeg'] do
    if CheckInstalledMac.check_for_installed name
      puts 'has dep:' + name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
content-editing-movie-player-0.38.0 lib/check_installed_mac.rb