Sha256: 7560923c26ab1e5ed26dfad2c2c812905346c53b376966ea9a44aaaf3c3e8963
Contents?: true
Size: 579 Bytes
Versions: 25
Compression:
Stored size: 579 Bytes
Contents
#!/usr/bin/env ruby require 'utils' inputs = ARGV.empty? ? STDIN : ARGV inputs.each do |filename_linenumber| source_location = filename_linenumber.source_location lf = Tins::LinesFile.for_filename(source_location.filename, source_location.linenumber) if spaces = lf.match_backward(/^(\s*)def\s+(?:\S+?)(?:\(|\s*$)/)&.first line_number_begin = lf.line_number lf.match_forward(/^#{spaces}end/) line_number_end = lf.line_number line_number_begin.upto(line_number_end) do |line_number| lf.line_number = line_number puts lf.line end end end
Version data entries
25 entries across 25 versions & 1 rubygems