Class: ShellCast::Recorder
- Inherits:
-
Object
- Object
- ShellCast::Recorder
- Defined in:
- lib/shellcast/recorder.rb
Constant Summary collapse
- HEADER =
" \u2588 \u2588 \n \u2588\u2588\u2588\u2588\u2588 \u2588 \n \u2588 \u2593\u2588 \u2588 \n \u2588 \u2588 \u2588\u2588\u2588 \u2593\u2588\u2588\u2592 \u2588\u2588\u2588 \u2588\u2592\u2588\u2588\u2592 \u2588\u2588\u2593\u2588 \u2588\u2588\u2588 \u2588\u2592\u2588\u2588\u2592 \u2588\u2588\u2593\u2588 \n \u2588 \u2592\u2588 \u2593\u2593 \u2592\u2588 \u2593\u2588 \u2593 \u2588\u2593 \u2593\u2588 \u2588\u2588 \u2588 \u2588\u2593 \u2593\u2588 \u2588 \u2588\u2593 \u2592\u2588 \u2588\u2593 \u2593\u2588 \n \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588\u2591 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \n \u2588 \u2591\u2588\u2592 \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \n \u2588 \u2591\u2588 \u2588 \u2588\u2591 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \n \u2588 \u2588 \u2593\u2593 \u2588 \u2593\u2588 \u2593 \u2588\u2593 \u2593\u2588 \u2588 \u2588\u2593 \u2593\u2588 \u2588 \u2588 \u2588 \u2588\u2593 \u2593\u2588 \u2588 \u2588 \n \u2588 \u2592 \u2588\u2588\u2588\u2592 \u2593\u2588\u2588\u2592 \u2588\u2588\u2588 \u2588 \u2588\u2588\u2593\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588\u2588\u2592\u2588 \u2588 \u2588 \n \u2588 \n \u2593 \u2592\u2588 \n \u2592\u2588\u2588\u2591 \n"- FOOTER =
" \u2588 \u2588 \u2588 \u2588 \n \u2588\u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588 \n \u2588 \u2588 \u2588 \u2588 \n \u2588 \u2588\u2588\u2588 \u2588\u2592\u2588\u2588\u2592 \u2588\u2588\u2588 \u2592\u2588\u2588\u2588\u2592 \u2588\u2592\u2588\u2588\u2592 \u2588\u2588\u2588 \u2588\u2588\u2593\u2588 \u2588 \n \u2588 \u2588 \u2588\u2593 \u2592\u2588 \u2588 \u2588\u2592 \u2591\u2588 \u2588\u2593 \u2592\u2588 \u2593\u2593 \u2592\u2588 \u2588\u2593 \u2593\u2588 \u2588 \n \u2588\u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2592\u2591 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \n \u2588 \u2588 \u2588 \u2588 \u2588 \u2591\u2588\u2588\u2588\u2592 \u2588 \u2588 \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588 \n \u2588 \u2588 \u2588 \u2588 \u2588 \u2592\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \n \u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2591 \u2592\u2588 \u2588 \u2588 \u2593\u2593 \u2588 \u2588\u2593 \u2593\u2588 \u2588 \n \u2588 \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588\u2588\u2588\u2588\u2588 \u2592\u2588\u2588\u2588\u2592 \u2588 \u2588 \u2588\u2588\u2588\u2592 \u2588\u2588\u2593\u2588 \u2588 \n\n"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Recorder
constructor
A new instance of Recorder.
- #record! ⇒ Object
- #request_metadata ⇒ Object
Constructor Details
#initialize ⇒ Recorder
Returns a new instance of Recorder.
39 40 41 |
# File 'lib/shellcast/recorder.rb', line 39 def initialize = {} end |
Class Method Details
.record! ⇒ Object
35 36 37 |
# File 'lib/shellcast/recorder.rb', line 35 def self.record! new.record! end |
Instance Method Details
#record! ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/shellcast/recorder.rb', line 43 def record! test_shellcast_data_dir puts HEADER.black_on_white puts "Your session started" puts "Type Ctrl+D or exit to finish recording" init_terminal system(script_cmd) restore_terminal puts FOOTER.black_on_white puts "hint $ shellcast play #{shellcast_id}".green end |
#request_metadata ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/shellcast/recorder.rb', line 56 def print "Provide name for Your shellcast: " ["title"] = STDIN.gets.strip ["created_at"] = shellcast_id puts shellcast_file('meta') File.open(shellcast_file('meta'), 'w+') do || .puts .to_json end end |