Sha256: 59ad7f35642d3d814f2d26b7e8c1eb921e73b059b589313179f091f9fa9122a9
Contents?: true
Size: 432 Bytes
Versions: 4
Compression:
Stored size: 432 Bytes
Contents
# frozen-string-literal: true module DidYouMean module Experimental module InitializerNameCorrection def method_added(name) super distance = Levenshtein.distance(name.to_s, 'initialize') if distance != 0 && distance <= 2 warn "warning: #{name} might be misspelled, perhaps you meant initialize?" end end end ::Class.prepend(InitializerNameCorrection) end end
Version data entries
4 entries across 4 versions & 2 rubygems