Class: Yetty::Recorder

Inherits:
Shelr::Recorder
  • Object
show all
Defined in:
lib/yetty/record.rb

Instance Method Summary collapse

Instance Method Details

#record!(options = {}) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/yetty/record.rb', line 39

def record!(options={})
  ensure_terminal_has_good_size
  check_record_dir
  with_lock_file do
    init_terminal
    
    Shelr.terminal.puts_line
    STDOUT.puts "=> Your session started"
    STDOUT.puts "=> Please, do not resize your terminal while recording"
    STDOUT.puts "=> Press Ctrl+D or 'exit' to finish recording"
    Shelr.terminal.puts_line
    start_sound_recording if options[:sound]
    system(recorder_cmd)
    stop_sound_recording if options[:sound]
    save_as_typescript if Shelr.backend == 'ttyrec'
    Shelr.terminal.puts_line
    STDOUT.puts "=> Session finished"
  end
end