Class: Terminal::Renderer
- Inherits:
-
Object
- Object
- Terminal::Renderer
- Defined in:
- lib/terminal/renderer.rb
Constant Summary collapse
- MEGABYTES =
1024 * 1024
- ESCAPE_CONTROL_CHARACTERS =
"qQmKGgKAaBbCcDd".freeze
- ESCAPE_CAPTURE_REGEX =
/\e\[(.*)([#{ESCAPE_CONTROL_CHARACTERS}])/- INTERESTING_PARTS_REGEX =
/[\n\r\b]|\e\[[\d;]*[#{ESCAPE_CONTROL_CHARACTERS}]|./
Instance Method Summary collapse
-
#initialize(output, options = {}) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
Constructor Details
Instance Method Details
#render ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/terminal/renderer.rb', line 21 def render return "" if @output.nil? output = @output.dup render_to_screen(output) # Convert the screen to a string output = convert_screen_to_string # Escape any HTML escaped_html = escape_html(output) # Now convert the colors to HTML convert_to_html!(escaped_html) escaped_html end |