Created
July 12, 2011 18:39
-
-
Save yoshuki/1078641 to your computer and use it in GitHub Desktop.
Works with SW Notifier(http://saikyoline.jp/air/swn/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
require 'autotest/tmux' | |
Autotest.add_hook :ran_command do |at, *args| | |
next false unless Autotest::Tmux.execute? | |
output = at.results.join | |
result = Autotest::Tmux.parse_output(output, at.class.name) | |
TCPSocket.open('localhost', 12345) do |s| | |
prefix = case result[:color] | |
when :red; 'R:' | |
when :yellow; 'Y:' | |
when :green; 'G:' | |
else '' | |
end | |
s.write "#{prefix}#{output}" | |
end | |
next false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment