Skip to content

Instantly share code, notes, and snippets.

View ruralocity's full-sized avatar

Aaron Sumner ruralocity

View GitHub Profile
@smerchek
smerchek / blinky_formatter.rb
Created January 15, 2015 03:44
Blink(1) rspec formatter
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
@mipearson
mipearson / rubocop.rb
Last active July 7, 2018 13:26
Run Rubocop against all files that are different from upstream's master
#!/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."