Skip to content

Instantly share code, notes, and snippets.

@markjlorenz
Last active August 29, 2015 13:59
Show Gist options
  • Save markjlorenz/10485197 to your computer and use it in GitHub Desktop.
Save markjlorenz/10485197 to your computer and use it in GitHub Desktop.
replace guard with a simple while-loop, fifo combination

The Wrench

mkfifo run_anything
while true; do sh -c "`cat run_anything`"; done

Example, running specs

Becuase guard doesn't work

~/.vimrc

" Vundle package
Bundle 'thoughtbot/vim-rspec'

" vim-rspec mappings
nnoremap <Leader>t :call RunCurrentSpecFile()<CR>
nnoremap <Leader>s :call RunNearestSpec()<CR>
nnoremap <Leader>l :call RunLastSpec()<CR>
nnoremap <Leader>a :call RunAllSpecs()<CR>

let rspec_command = "clear \; spring rspec {spec}"
let rspec_options = " --require=support/vim_formatter.rb --format VimFormatter --out quickfix.out --format progress"
let g:rspec_command = "echom system('echo \"" . rspec_command . rspec_options . "\" >> run_anything')"

Wrench designed by @soodesune, named by @michaelpgee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment