Class: RSpecDocumentation::Formatters::Ansi
- Inherits:
-
Object
- Object
- RSpecDocumentation::Formatters::Ansi
- Defined in:
- lib/rspec_documentation/formatters/ansi.rb
Overview
Outputs a string containing ANSI color code escape sequences into HTML with attached classes for each matched color code. Cleans any remaining escape codes.
Instance Method Summary collapse
-
#initialize(subject:) ⇒ Ansi
constructor
A new instance of Ansi.
- #prettified_output ⇒ Object
- #render_raw? ⇒ Boolean
- #rendered_output ⇒ Object
Constructor Details
#initialize(subject:) ⇒ Ansi
Returns a new instance of Ansi.
10 11 12 |
# File 'lib/rspec_documentation/formatters/ansi.rb', line 10 def initialize(subject:) @subject = subject end |
Instance Method Details
#prettified_output ⇒ Object
14 15 16 |
# File 'lib/rspec_documentation/formatters/ansi.rb', line 14 def prettified_output nil end |
#render_raw? ⇒ Boolean
22 23 24 |
# File 'lib/rspec_documentation/formatters/ansi.rb', line 22 def render_raw? false end |
#rendered_output ⇒ Object
18 19 20 |
# File 'lib/rspec_documentation/formatters/ansi.rb', line 18 def rendered_output "<div class='ansi-html border m-1 p-4'><span>#{subbed_content}</span></div>" end |