Module: CheckInstalledMac
- Defined in:
- lib/check_installed_mac.rb
Class Method Summary collapse
-
.check_for_installed(name) ⇒ Object
should output an error message…
Class Method Details
.check_for_installed(name) ⇒ Object
should output an error message…
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/check_installed_mac.rb', line 10 def self.check_for_installed name if name == 'mencoder' output = `mencoder --fail 2>&1` if output =~ /mencoder/i # success, it is installed return true else # fall through end end if name == 'mplayer' unless File.exist?('/opt/rdp_project_local/bin/mplayer') puts "please install mplayer edl, please install mplayer-edl, see website http://rogerdpack.t28.net/sensible-cinema/content_editor.html" return false end return true end # check for the others generically command = {"gocr" => "gocr --help", "convert" => "convert --help", "ffmpeg" => "ffmpeg -version"}[name] raise 'unknown ' + name unless command # sanity check unless system(command + " 1> " + OS.dev_null + " 2>" + OS.dev_null) name = 'ImageMagick' if name == 'convert' # special case... puts 'lacking dependency! Please install ' + name + ' by installing the contrib pkg from the website' false else true end end |