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 'rspec' | |
require 'blinky' | |
# Usage: rspec --require blink_formatter.rb --format BlinkFormatter | |
# fix issue where no light will cause lock-up | |
module Blinky | |
class LightFactory | |
class << self | |
alias :original_detect_lights :detect_lights |
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
#!/usr/bin/env ruby | |
changed = `git diff --numstat origin/master | awk '{ print $3 }' | grep -E '(\\.rb|\\.rake)$'` | |
changed = changed.split("\n").select { |c| File.exist?(c) } | |
if changed.length > 0 | |
system "rubocop #{ARGV.join(' ')} #{changed.join(' ')}" | |
else | |
puts "No changes." |