<commit_before># Capistrano::Bundler

Bundler specific tasks for Capistrano v3:

```sh
$ cap production bundler:install
```

It also prefixes certain binaries to use `bundle exec`.

## Installation

Add these lines to your application's Gemfile **[Recommended]**:

```ruby
gem 'capistrano', '~> 3.6'
gem 'capistrano-bundler', '~> 1.5'
```

And then execute:

```sh
$ bundle
```

Or install it yourself as:

```sh
$ gem install capistrano-bundler
```

## Usage

Require in `Capfile` to use the default task:

```ruby
require 'capistrano/bundler'
```

The task will run before `deploy:updated` as part of Capistrano's default deploy, or can be run in isolation with `cap production bundler:install`.

In order for Bundler to work efficiently on the server, its project configuration directory (`<release_path>/.bundle/`) should be persistent across releases.
You need to add it to the `linked_dirs` Capistrano variable:

Capistrano **3.5**+:

```ruby
# config/deploy.rb

append :linked_dirs, '.bundle'
```

Capistrano < 3.5:

```ruby
# config/deploy.rb

set :linked_dirs, fetch(:linked_dirs, []) << '.bundle'
```

It will still work fine with non-persistent configuration directory, but then it will have to re-resolve all gems on each deploy.

By default, the plugin adds `bundle exec` prefix to common executables listed in `bundle_bins` option. This currently applies for `gem`, `rake` and `rails`.

You can add any custom executable to this list:

```ruby
set :bundle_bins, fetch(:bundle_bins, []).push('my_new_binary')
```

Configurable options:

```ruby
set :bundle_roles, :all                                         # this is default
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
set :bundle_binstubs, -> { shared_path.join('bin') }            # default: nil
set :bundle_gemfile, -> { release_path.join('MyGemfile') }      # default: nil
set :bundle_path, -> { shared_path.join('bundle') }             # this is default. set it to nil for skipping the --path flag.
set :bundle_without, %w{development test}.join(' ')             # this is default
set :bundle_flags, '--deployment --quiet'                       # this is default
set :bundle_env_variables, {}                                   # this is default
set :bundle_clean_options, ""                                   # this is default. Use "--dry-run" if you just want to know what gems would be deleted, without actually deleting them
```

You can parallelize the installation of gems with bundler's jobs feature.
Choose a number less or equal than the number of cores your server.<commit_msg>Added documentation to README for bundle_check_before_install flag<commit_after># Capistrano::Bundler

Bundler specific tasks for Capistrano v3:

```sh
$ cap production bundler:install
```

It also prefixes certain binaries to use `bundle exec`.

## Installation

Add these lines to your application's Gemfile **[Recommended]**:

```ruby
gem 'capistrano', '~> 3.6'
gem 'capistrano-bundler', '~> 1.5'
```

And then execute:

```sh
$ bundle
```

Or install it yourself as:

```sh
$ gem install capistrano-bundler
```

## Usage

Require in `Capfile` to use the default task:

```ruby
require 'capistrano/bundler'
```

The task will run before `deploy:updated` as part of Capistrano's default deploy, or can be run in isolation with `cap production bundler:install`.

In order for Bundler to work efficiently on the server, its project configuration directory (`<release_path>/.bundle/`) should be persistent across releases.
You need to add it to the `linked_dirs` Capistrano variable:

Capistrano **3.5**+:

```ruby
# config/deploy.rb

append :linked_dirs, '.bundle'
```

Capistrano < 3.5:

```ruby
# config/deploy.rb

set :linked_dirs, fetch(:linked_dirs, []) << '.bundle'
```

It will still work fine with non-persistent configuration directory, but then it will have to re-resolve all gems on each deploy.

By default, the plugin adds `bundle exec` prefix to common executables listed in `bundle_bins` option. This currently applies for `gem`, `rake` and `rails`.

You can add any custom executable to this list:

```ruby
set :bundle_bins, fetch(:bundle_bins, []).push('my_new_binary')
```

Configurable options:

```ruby
set :bundle_roles, :all                                         # this is default
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
set :bundle_binstubs, -> { shared_path.join('bin') }            # default: nil
set :bundle_gemfile, -> { release_path.join('MyGemfile') }      # default: nil
set :bundle_path, -> { shared_path.join('bundle') }             # this is default. set it to nil for skipping the --path flag.
set :bundle_without, %w{development test}.join(' ')             # this is default
set :bundle_flags, '--deployment --quiet'                       # this is default
set :bundle_env_variables, {}                                   # this is default
set :bundle_clean_options, ""                                   # this is default. Use "--dry-run" if you just want to know what gems would be deleted, without actually deleting them
set :bundle_check_before_install, true                          # default: true. Set this to false to bypass running `bundle check` before executing `bundle install`
```

You can parallelize the installation of gems with bundler's jobs feature.
Choose a number less or equal than the number of cores your server.
{'fraction_non_alphanumeric': 0.11041242833364158, 'fraction_numerical': 0.003329017939707786, 'mean_word_length': 3.4473684210526314, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '998495', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1526, 'n_words': 609}