Skip to content

Instantly share code, notes, and snippets.

@cth
Created August 26, 2008 11:47
Show Gist options
  • Save cth/7247 to your computer and use it in GitHub Desktop.
Save cth/7247 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def process_line(line)
if line =~ /(.*):(\d*):(.*)/ then
"<a href=\"txmt://open?url=file://#{ENV['TM_DIRECTORY']}/#{$1}&line=#{$2}\">#{$1}:#{$2}: #{$3}</a><br/>"
else
line + "<br/>"
end
end
system "make &> /tmp/textmake.output"
File.open("/tmp/textmake.output") do |f|
f.each do |line|
puts process_line(line)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment