Sha256: 80b5bf002b0555937d3243726db480fbf46f1e24a559271e7383fe409af3eec1
Contents?: true
Size: 455 Bytes
Versions: 5
Compression:
Stored size: 455 Bytes
Contents
module SpellCheck class Typo attr_reader :pattern, :expected, :line, :line_number def initialize(pattern: nil, expected: nil, line: nil, line_number: nil) @pattern = pattern @expected = expected @line = line @line_number = line_number end def place m = line.match(/(?<before>.{0,20})#{pattern}(?<after>.{0,20})/) [m[:before] || '', ColorString.red(pattern), m[:after] || ''].join end end end
Version data entries
5 entries across 5 versions & 1 rubygems