Skip to content

Instantly share code, notes, and snippets.

Created Dec 8, 2014
What would you like to do?
Pipe compiler errors to it.
#!/usr/bin/env ruby
# coding: utf-8
require 'smart_colored'
STDIN.each_line do |l|
if m = l.match(%r{((/.*?)+)\:(\d+)})
fn, _, ln = m.captures
next unless File.exist? fn
ln = ln.to_i
puts m.to_s.colored.bold
system "cat #{fn} | head -n#{ln+1} | tail -n#{3}"
print "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment