request: opt-out for "bundle exec" prefix #191

Closed
markiz opened this Issue Oct 13, 2010 · 9 comments

Projects

None yet

5 participants

@markiz
markiz commented Oct 13, 2010

As of latest rspec version, autotest automatically uses command-line 'bundle exec' whenever it detects Gemfile in current directory. Is it possible to make an option to disable such a behaviour?

Two reasons:

  • I may want to make something else without bundler but with file Gemfile in my root directory. Sure enough, that's a bad idea, but I don't want my specs to break.
  • Bundler takes a loooooong time to preload. I lose a great deal of performance whenever bundle exec is called

I think it is safe to assume bundler exec to be a reasonable default for testing but there could be a case when I want to disable that behaviour.

@dchelimsky
Member

We're making it an opt-in for the rake task, and will do the same for autotest as well.

@zerowidth

vote += 1

I had a Gemfile laying around because I was trying Bundler, but had removed all reference to it in my application. It was confusing and difficult to debug when I got unexpected "gem not found: xyz" errors, with no mention of bundler and its "cripple_rubygems" code in the backtrace. I'd rather the Rakefile / autotest code be explicit about whether or not it's using bundler, especially because gem-related errors have no indication that bundler's involved.

@markiz
markiz commented Oct 28, 2010

You can add this code to .autotest file for now:

class Autotest::Rspec2 < Autotest
  def using_bundler?
    false
  end
end
@grosser
Contributor
grosser commented Nov 16, 2010

just added a -b / --bundle-exec to autotest, so you could use if options[:bundle_exec] in the autotest-related part

@arailsdemo

I've put together a solution for this. In addition, it addresses sending command line options through Autotest to RSpec.

It requires that Autotest (ZenTest) accept an option '--extra' which receives an array argument. arailsdemo/zentest@d77e3a4

Then in rspec2.rb, we can parse out the options.
arailsdemo@ab39552

(edit - Sorry, had to fix something here .)

So for

$ autotest -x t,my_tag -x format,documentation

This would send RSpec '-t my_tag --format documentation'.
'rspec' becomes the default command. If you want to used 'bundle exec ...', you can do

$ autotest -x bundle

If this is an acceptable solution, I can write some tests.

@grosser
Contributor
grosser commented Jan 16, 2011

FYI: works in autotest-standalone 4.5.4

@dchelimsky
Member

@arailsdemo/@grosser - I'd prefer a solution that does not require any changes to Autotest. Something with the .rspec file or some such.

@dchelimsky
Member

Add -- --skip-bundler option for autotest

@dchelimsky
Member

FYI - this option ended up not working. I still don't know why - I know it worked at one point, but then when I released it, it did not :(

So I removed this entirely in the 2.5.1 release. Now the default is to not include 'bundle exec', and to include it, you can use the autotest/bundler plugin. See http://blog.davidchelimsky.net/2011/02/06/rspec-250-is-released/ and http://blog.davidchelimsky.net/2011/02/06/rspec-core-251-is-released/ for more info.

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