Sha256: 3f038d218117ce4e92675542b834362092ea269c4b58d4c309f7bad426cdc8bf
Contents?: true
Size: 493 Bytes
Versions: 16
Compression:
Stored size: 493 Bytes
Contents
require 'fast' # Search for duplicated methods interpolating the method and collecting previous # method names. Returns true if the name already exists in the same class level. # Note that this example will work only in a single file because it does not # cover any detail on class level. def duplicated(method_name) @methods ||= [] already_exists = @methods.include?(method_name) @methods << method_name already_exists end puts Fast.search_file( '(def #duplicated)', 'example.rb')
Version data entries
16 entries across 16 versions & 1 rubygems