Last active
August 29, 2015 14:08
-
-
Save AbeHandler/071a218684cc0cd6719f to your computer and use it in GitHub Desktop.
osd check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEPENDENCIES = {:java => false, :gm => false, :pdftotext => false, :pdftk => false, :pdftailor => false, :tesseract => false} | |
# Check for all dependencies, and note their absence. | |
dirs = ENV['PATH'].split(File::PATH_SEPARATOR) | |
DEPENDENCIES.each_key do |dep| | |
dirs.each do |dir| | |
if File.executable?(File.join(dir, dep.to_s)) | |
DEPENDENCIES[dep] = true | |
break | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val = %x[ #{'tesseract --list-langs'} 2>&1 >/dev/null ] | |
puts val.include? 'osd' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment