Alternate binstubs support #23

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants

Builds on request #22 but could be reimplemented independent of it.

When using more than one ruby, "bundle install --binstubs" will continually be overwriting the binstubs put into bin/.

This patch builds on request #22 (Rakefile bundler awareness) and makes it possible to specify an alternative binstub directory at install and run-time. If using an alternative binstub directory, you can't run the tests with the :default task anymore, you need to use :runtests[rake] to specify which rake will be called (e.g., jruby-bin/rake if you used :setup[jruby-bin]).

This review is primarily about 39b5129; request #22 is about 62fa3d2.

Austin Ziegler added some commits Aug 25, 2011

Austin Ziegler The top-level Rakefile requires Bundler awareness.
When running the bin/rake Bundler binstub, the binstub sets
ENV['BUNDLE_GEMFILE'] which is inherited by calls to the rake
environments of the Projects. The top level Gemfile only includes Rake
and Thor, so it's not surprising that the builds can't continue. MRI
1.9.2 appears to be able to work around this with "export
RUBYOPT=rubygems", but that seems inelegant at best.

This change determines if the Rakefile was launched through a bundled
rake; if so, it uses Bundler.with_clean_env (and deletes the
BUNDLE_GEMFILE for good measure; necessary if you use the binstub, less
necessary if you use "bundle exec rake") and instead of running 'rake',
it runs 'bin/rake' to force the use of the Project rake binstub, forcing
the use of the correct Gemfile and bundler environment.

The non-bundler path works as it always has.
62fa3d2
Austin Ziegler Support for alternate binstubs.
When using more than one ruby, "bundle install --binstubs" will
continually be overwriting the binstubs put into bin/.

This patch builds on request #22 (Rakefile bundler awareness) and makes
it possible to specify an alternative binstub directory at install and
run-time. If using an alternative binstub directory, you can't run the
tests with the :default task anymore, you need to use :runtests[rake] to
specify which rake will be called (e.g., jruby-bin/rake if you used
:setup[jruby-bin]).
39b5129
Austin Ziegler Removing explicit task invocation.
Rake is smarter than I initially assumed about passing parameters to
dependent tasks.[1] This means that the :setup task does not require an
explicit body and does not require Rake::Task#invoke for its dependent
tasks, making rspec-dev Rakefile closer to being drake-compatible.

[1] quix/rake#1
ddb5069
Owner

JonRowe commented Mar 15, 2014

Seems we dropped the ball on this, sorry @halostatue, I'm going to close this because it'll be way out of date.

JonRowe closed this Mar 15, 2014

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