Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set bundler install options, for example: -v '< 2.0' #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ So make sure to properly setup `capistrano-rbenv` and you'll be good.
For example, in `config/deploy.rb`:

set :rbenv_ruby, '2.0.0-p247'
set :rbenv_bundler_version, '> 2.0'
set :rbenv_bundler_options, '--quiet --no-documents'

Note: bundler 2 replace options --no-ri --no-rdoc with --no-documents

Other than that, this plugin does not need any setup.

Expand Down
14 changes: 12 additions & 2 deletions lib/capistrano/tasks/rbenv_install.rake
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,18 @@ namespace :rbenv do
desc 'Install bundler gem'
task install_bundler: ['rbenv:map_bins'] do
on roles fetch(:rbenv_roles) do
next if test :gem, :query, '--quiet --installed --name-matches ^bundler$'
execute :gem, :install, :bundler, '--quiet --no-rdoc --no-ri'
test_options = String.new('--quiet --installed --name-matches ^bundler$')
install_options = String.new(fetch(:rbenv_bundler_options, '--quiet --no-rdoc --no-ri'))

if fetch(:rbenv_bundler_version)
with_version = " -v '#{fetch(:rbenv_bundler_version)}'"
test_options << with_version
install_options << with_version
end

next if test :gem, :query, test_options

execute :gem, :install, :bundler, install_options
end
end

Expand Down