Sha256: 43b7e5cde4dace433aeaafcd5cf4c85a215567b67364970a81810ed43f7a2626
Contents?: true
Size: 935 Bytes
Versions: 1
Compression:
Stored size: 935 Bytes
Contents
module Tlapse module Doctor CHECKS = %i(gphoto2 camera) def doctor CHECKS.each do |check| print "Checking #{check}..." send "check_#{check}!" puts "ok!" end puts "Looks good!" end def okay? CHECKS.each { |check| send "check_#{check}!" } true rescue StandardError false end private ################################################################### def check_gphoto2! raise "Could not find gphoto2 :(" if `which gphoto2`.empty? end def check_camera! cameras = `gphoto2 --auto-detect` # Output looks like this: # # Model Port # -------------------- # Camera :usb # # If there is a third line, a camera was detected unless cameras.split("\n").length > 2 raise "gphoto2 couldn't find a camera :(" end end end # Doctor end # Tlapse
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tlapse-0.1.1 | lib/tlapse/doctor.rb |