Use spring with `bin/rake` instead of `spring rake` by default
genericsteele opened this issue · 9 comments
With Rails 4.1 now including spring by default I wonder if using bin/rake
by default instead of spring rake test
would make setup easier.
I'm happy to work on a PR, but I think there should be a discussion first about scope, side effects, and if it's even necessary.
Hi, thanks for the proposal.
Unfortunately, I cannot discuss this myself since I'm not using Rails that much anymore (and btw I'm looking for new maintainers, more info here: https://groups.google.com/forum/#!msg/guard-dev/2Td0QTvTIsE/cegvVofIJ8AJ) so I don't really now what's best...
Did you have any feedbacks from other Rails users yet (obviously not in this issue ^^)?
Ok, I've actually tried to used spring bin/rake test
as the default command and that works out of the box. I've change the default Spring command to bin/rake test
for the version 2.3.0.
Thanks!
Version 2.3.0 released!
Hi, I'm commenting because I've been asked to opine on this from issue #111 . I'm only very superficially acquainted with how things work here, but to me, spring bin/rake ...
, even though it may work, doesn't make sense. From the manual (spring --help) it seems that rake
after spring
refers to a subfunction of spring
rather than an executable, and it doesn't work with paths to other executables.
As for whether spring rake test
is equivalent to bin/rake test
on rails 4, it doesn't seem to be on my machine. I've tested it in the command line on a rails 4.1 application I'm currently toying with, and timing it reveals that the spring version is several times faster, which would indicate that a bare bin/rake
doesn't make use of the spring server.
What the command might need is a bundle exec
before spring rake ...
. I think bundle exec spring rake paths_to_tests...
is the safest option to use.
Sorry, my bad, I've made a typo, the default is now bin/rake test
not spring bin/rake test
!
Regarding spring rake test
vs bin/rake test
, looking at the implementation of bin/rake
, it looks like it tries to load Spring indeed:
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
Sorry for not weighing in until now. This is great news!
Just a little background: Rails 4.1 bundles in Spring and installs spring-specific binstubs by default. Prior to that, it's pretty safe to assume that bin/rake and bin/rails still point to the bundler-specific version. It should fail pretty gracefully, but I'm interested to see if any issues pop up.
@rymai I'm also willing to take a bigger maintainer role, but not sure of what would be involved. I dig the project and want to help.
Ok cool!
Re. the maintainer thing: I took over the maintenance of this plugin (and some others) as a service to the community since the author(s) were no longer maintaining them.
As a Guard core team member I didn't want to have major Guard plugins to be left unmaintained.
Frankly I love to hack on Guard plugins, the thing is that since I don't actually use them, it doesn't really make sense that I'm their maintainer! :P
I'd simply prefer to have actual users of the plugins as maintainers.
Then I'd be happy to take over guard-minitest!