Skip to content

Instantly share code, notes, and snippets.

@aaronlerch
Last active August 29, 2015 14:16
Show Gist options
  • Save aaronlerch/e76934e2f131018c88f0 to your computer and use it in GitHub Desktop.
Save aaronlerch/e76934e2f131018c88f0 to your computer and use it in GitHub Desktop.
blink1 + guard = simple test status indicator
# ...
group :development, :test do
# ...
gem "guard", require: false
gem "guard-shell", require: false
# ...
end
# ...
# Add this to whatever your guardfile already has
notification :file, path: '.guard_result'
guard :shell do
watch '.guard_result' do
status = File.read('.guard_result').lines.first.strip if File.exists?('.guard_result')
if status == 'failed'
color = 'red'
elsif status == 'success'
color = 'green'
else
color = 'off'
end
`blink1 --#{color}` rescue nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment