Module: ErrorHighlight::CoreExt
- Defined in:
- lib/error_highlight/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#detailed_message(highlight: false, error_highlight: true) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/error_highlight/core_ext.rb', line 41 def (highlight: false, error_highlight: true, **) return super unless error_highlight snippet = generate_snippet if highlight snippet = snippet.gsub(/.+/) { "\e[1m" + $& + "\e[m" } end super + snippet end |
#to_s ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/error_highlight/core_ext.rb', line 56 def to_s msg = super snippet = generate_snippet if snippet != "" && !msg.include?(snippet) msg + snippet else msg end end |