Module: Tlapse::Doctor

Defined in:
lib/tlapse/doctor.rb

Constant Summary collapse

CHECKS =
%i(gphoto2 camera)

Instance Method Summary collapse

Instance Method Details

#doctorObject



5
6
7
8
9
10
11
12
13
# File 'lib/tlapse/doctor.rb', line 5

def doctor
  CHECKS.each do |check|
    print "Checking #{check}..."
    send "check_#{check}!"
    puts "ok!"
  end

  puts "Looks good!"
end

#okay?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/tlapse/doctor.rb', line 22

def okay?
  status == "OK"
end

#statusObject



15
16
17
18
19
20
# File 'lib/tlapse/doctor.rb', line 15

def status
  CHECKS.each { |check| send "check_#{check}!" }
  "OK"
rescue StandardError => e
  e.message
end