Skip to content

Instantly share code, notes, and snippets.

@AbeHandler
Last active August 29, 2015 14:08
Show Gist options
  • Save AbeHandler/071a218684cc0cd6719f to your computer and use it in GitHub Desktop.
Save AbeHandler/071a218684cc0cd6719f to your computer and use it in GitHub Desktop.
osd check
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
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