This gem allows you to use your blink1 from thingm along with guard to show if your tests are failing (red) or passing (green)
After reading this guard-dev post I decided to use the resultant Guard File notification born out of that very discussion.
You need guard & guard-shell
so if you haven't already, add
gem 'guard'
gem 'guard-shell'
to your Gemfile
and also add
gem 'guard-blink1'
after this
you'll probably want to put them in your development group
group :development do
gem 'guard'
gem 'guard-shell'
gem 'guard-blink1'
end
NB.\ putting them in the test group will cause issues on machines without libusb installed. e.g/ Continuous Integration Servers
notification(:file, path: '.guard_result')
require 'guard_blink1'
guard :shell do
watch '.guard_result' do
firstline = File.read('.guard_result').lines.first.strip
GuardBlink1.blink_colour(firstline)
end
end
As we're using an intermediary file called .guard_result you'll probably want to add that to your .gitignore file, so you won't commit it to git.
Now get back to coding with your blink1 as your Red/Green testing buddy :)
Here's an example Vine I made earlier https://vine.co/v/bEjJD3UerFt for all you people from the future! :)
Many thanks to:
- amiel and his gist which gave me inspiration to create this gem.
- ngs for creating the wonderful blink1 ruby gem, rb-blink1
- All the Ruby guys & gals around the world :)
- Create your feature branch (
git checkout -b my-new-feature
) - Make changes whilst running guard (of course), & make sure all tests are green.
- Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request