Created
March 28, 2013 05:00
-
-
Save fujimura/5260779 to your computer and use it in GitHub Desktop.
listen_spring.rb
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 'listen' | |
def run(files_to_run) | |
puts "Running: #{files_to_run}" | |
system %|bundle exec spring rspec #{files_to_run}| | |
end | |
Listen.to 'spec', filter: /.*_spec\.rb/ do |modified, added, removed| | |
file_to_run = (modified || added).first | |
run file_to_run | |
end | |
Signal.trap 'INT' do | |
exit | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment