Module
Constants
This is a marker to let ‘DidYouMean::Correctable#original_message` skip the following method definition of `to_s`. See github.com/ruby/did_you_mean/pull/152
Instance Methods
lib/error_highlight/core_ext.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/error_highlight/core_ext.rb, line 12
def detailed_message(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
No documentation available
lib/error_highlight/core_ext.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/error_highlight/core_ext.rb, line 5
def generate_snippet
spot = ErrorHighlight.spot(self)
return "" unless spot
return ErrorHighlight.formatter.message_for(spot)
end
No documentation available
#
lib/error_highlight/core_ext.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/error_highlight/core_ext.rb, line 27
def to_s
msg = super
snippet = generate_snippet
if snippet != "" && !msg.include?(snippet)
msg + snippet
else
msg
end
end
No documentation available