Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring & rvm symlink alias commands to bin/

I use Rails 4 with spring & spring-commands-rspec gem. This question have relation to this: spring using by default

When I run time rspec I get something like 5 seconds. If I run time bin/rspec I have 2 seconds. If I run time rake -T I get 3 seconds, if I run time bin/rake -T I get less than a second.

Where is the trouble? Why I need to run all commands through bin/ binstubs to parse them through spring. How can I avoid that?

Related issue at github: https://github.com/jonleighton/spring-commands-rspec/issues/17#issuecomment-43174278

like image 223
asiniy Avatar asked Nov 11 '22 09:11

asiniy


1 Answers

I avoid that by explicitly calling spring before all the commands I run, like spring rspec spec, spring rails c, spring rake. And to make that easier, I aliased spring to just s. It's kinda impossible to integrate spring right into those binaries because, among many other reasons: RSpec, Rake and Rails binaries are not aware of Spring existence, you can't assume you (and everyone else) always wants to run commands using Spring. You can open those files in your bin folder using you text editor and see what Spring is doing there.

like image 124
Douglas Camata Avatar answered Nov 14 '22 21:11

Douglas Camata