From 4daba1431696953a7737c7b64fc46cb05a736282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C3=96zg=C3=BCr?= <226712+halilim@users.noreply.github.com> Date: Wed, 18 Mar 2026 19:26:47 +0300 Subject: [PATCH] refactor(bundler): Remove bundle_install and just use: bundle install (#13617) --- plugins/bundler/README.md | 24 ++++++++++----------- plugins/bundler/bundler.plugin.zsh | 34 +----------------------------- 2 files changed, 13 insertions(+), 45 deletions(-) diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md index 7b79cbcdc..ddf547276 100644 --- a/plugins/bundler/README.md +++ b/plugins/bundler/README.md @@ -11,18 +11,18 @@ plugins=(... bundler) ## Aliases -| Alias | Command | Description | -|--------|--------------------------------------|------------------------------------------------------------------------------------------| -| `ba` | `bundle add` | Add gem to the Gemfile and run bundle install | -| `bck` | `bundle check` | Verifies if dependencies are satisfied by installed gems | -| `bcn` | `bundle clean` | Cleans up unused gems in your bundler directory | -| `be` | `bundle exec` | Execute a command in the context of the bundle | -| `bi` | `bundle install --jobs=` | Install the dependencies specified in your Gemfile (using all cores in bundler >= 1.4.0) | -| `bl` | `bundle list` | List all the gems in the bundle | -| `bo` | `bundle open` | Opens the source directory for a gem in your bundle | -| `bout` | `bundle outdated` | List installed gems with newer versions available | -| `bp` | `bundle package` | Package your needed .gem files into your application | -| `bu` | `bundle update` | Update your gems to the latest available versions | +| Alias | Command | Description | +| ------ | ----------------- | -------------------------------------------------------- | +| `ba` | `bundle add` | Add gem to the Gemfile and run bundle install | +| `bck` | `bundle check` | Verifies if dependencies are satisfied by installed gems | +| `bcn` | `bundle clean` | Cleans up unused gems in your bundler directory | +| `be` | `bundle exec` | Execute a command in the context of the bundle | +| `bi` | `bundle install` | Install the dependencies specified in your Gemfile | +| `bl` | `bundle list` | List all the gems in the bundle | +| `bo` | `bundle open` | Opens the source directory for a gem in your bundle | +| `bout` | `bundle outdated` | List installed gems with newer versions available | +| `bp` | `bundle package` | Package your needed .gem files into your application | +| `bu` | `bundle update` | Update your gems to the latest available versions | ## Gem wrapper diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index c1cbb13dd..53b36f092 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -4,45 +4,13 @@ alias ba="bundle add" alias bck="bundle check" alias bcn="bundle clean" alias be="bundle exec" -alias bi="bundle_install" +alias bi="bundle install" alias bl="bundle list" alias bo="bundle open" alias bout="bundle outdated" alias bp="bundle package" alias bu="bundle update" -## Functions - -bundle_install() { - # Bail out if bundler is not installed - if (( ! $+commands[bundle] )); then - echo "Bundler is not installed" - return 1 - fi - - # Bail out if not in a bundled project - if ! _within-bundled-project; then - echo "Can't 'bundle install' outside a bundled project" - return 1 - fi - - # Check the bundler version is at least 1.4.0 - autoload -Uz is-at-least - local bundler_version=$(bundle version | cut -d' ' -f3) - if ! is-at-least 1.4.0 "$bundler_version"; then - bundle install "$@" - return $? - fi - - # If bundler is at least 1.4.0, use all the CPU cores to bundle install - if [[ "$OSTYPE" = (darwin|freebsd)* ]]; then - local cores_num="$(sysctl -n hw.ncpu)" - else - local cores_num="$(nproc)" - fi - BUNDLE_JOBS="$cores_num" bundle install "$@" -} - ## Gem wrapper bundled_commands=(