Skip to content

GeoffTidey/guard-blink1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This gem allows you to use your blink1 from thingm along with guard to show if your tests are failing (red) or passing (green)

Background

After reading this guard-dev post I decided to use the resultant Guard File notification born out of that very discussion.

Installation

Install guard-blink1

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

Now add this to the end of your Guardfile

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

.gitignore

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.

Winning

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! :)

Credit

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 :)

Contributing/Making it better/Fixing my bugs ;)

  1. Create your feature branch (git checkout -b my-new-feature)
  2. Make changes whilst running guard (of course), & make sure all tests are green.
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Red/Green TDD fun with guard & blink1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages