CLI: brew install blink1
Last active
August 29, 2015 14:16
-
-
Save aaronlerch/e76934e2f131018c88f0 to your computer and use it in GitHub Desktop.
blink1 + guard = simple test status indicator
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
# ... | |
group :development, :test do | |
# ... | |
gem "guard", require: false | |
gem "guard-shell", require: false | |
# ... | |
end | |
# ... |
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
# 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