Skip to content

Commit

Permalink
Prepare command with bundle exec using SSH prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kirs committed Nov 23, 2013
1 parent 8c40862 commit 0a5d479
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Configurable options, shown here with defaults:
set :bundle_binstubs, -> { shared_path.join('bin') }
set :bundle_roles, :all

By default, this integrations adds `bundle exec` prefix to common executables like `rake`, `ruby` and `rails`.

If you want to use `bundle exec` prefix with other executables, you can do it with setting:

```ruby
set :bundle_bins, %w(ruby rake rails any_other_executable)
```

## Contributing

1. Fork it
Expand Down
10 changes: 9 additions & 1 deletion lib/capistrano/tasks/bundler.cap
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ namespace :bundler do
end
end

before 'deploy:updated', 'bundler:install'
task :map_bins do
fetch(:bundle_bins).each do |command|
SSHKit.config.command_map.prefix[command.to_sym].push("bundle exec")
end
end

before 'deploy:starting', 'bundler:map_bins'
before 'deploy:updated', 'bundler:install'
end

namespace :load do
Expand All @@ -37,5 +44,6 @@ namespace :load do
set :bundle_without, %w{development test}.join(' ')
set :bundle_binstubs, -> { shared_path.join('bin') }
set :bundle_roles, :all
set :bundle_bins, %w(ruby rake rails)
end
end

0 comments on commit 0a5d479

Please sign in to comment.