Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module Kernel
alias :old_puts :puts
def puts(val)
old_puts val
split = caller.first.split(':')
yolo(split[0], split[1].to_i)
end
private
def yolo(filename, line_number)
f = File.new(filename, 'r+')
f.each_with_index do |line, i|
if i == line_number-1
f.seek(-line.length, IO::SEEK_CUR)
f.write(' ' * (line.length - 1))
f.write("\n")
end
end
f.close
end
end
puts 'what'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment