Skip to content

Instantly share code, notes, and snippets.

@alyssais
Created August 16, 2015 12:50
Show Gist options
  • Save alyssais/688ee17d3a9299d49ea7 to your computer and use it in GitHub Desktop.
Save alyssais/688ee17d3a9299d49ea7 to your computer and use it in GitHub Desktop.
Fix pry terminal corruption issues with rspec. The same file is executed by both Ruby and Bash. Isn't that cool‽
#!/bin/sh
<<SH_COMMENT
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
__END__
SH_COMMENT
ruby -x "$0" $@
stty sane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment