Skip to content

Commit 4daba14

Browse files
authored
refactor(bundler): Remove bundle_install and just use: bundle install (ohmyzsh#13617)
1 parent bec3f22 commit 4daba14

2 files changed

Lines changed: 13 additions & 45 deletions

File tree

plugins/bundler/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ plugins=(... bundler)
1111

1212
## Aliases
1313

14-
| Alias | Command | Description |
15-
|--------|--------------------------------------|------------------------------------------------------------------------------------------|
16-
| `ba` | `bundle add` | Add gem to the Gemfile and run bundle install |
17-
| `bck` | `bundle check` | Verifies if dependencies are satisfied by installed gems |
18-
| `bcn` | `bundle clean` | Cleans up unused gems in your bundler directory |
19-
| `be` | `bundle exec` | Execute a command in the context of the bundle |
20-
| `bi` | `bundle install --jobs=<core_count>` | Install the dependencies specified in your Gemfile (using all cores in bundler >= 1.4.0) |
21-
| `bl` | `bundle list` | List all the gems in the bundle |
22-
| `bo` | `bundle open` | Opens the source directory for a gem in your bundle |
23-
| `bout` | `bundle outdated` | List installed gems with newer versions available |
24-
| `bp` | `bundle package` | Package your needed .gem files into your application |
25-
| `bu` | `bundle update` | Update your gems to the latest available versions |
14+
| Alias | Command | Description |
15+
| ------ | ----------------- | -------------------------------------------------------- |
16+
| `ba` | `bundle add` | Add gem to the Gemfile and run bundle install |
17+
| `bck` | `bundle check` | Verifies if dependencies are satisfied by installed gems |
18+
| `bcn` | `bundle clean` | Cleans up unused gems in your bundler directory |
19+
| `be` | `bundle exec` | Execute a command in the context of the bundle |
20+
| `bi` | `bundle install` | Install the dependencies specified in your Gemfile |
21+
| `bl` | `bundle list` | List all the gems in the bundle |
22+
| `bo` | `bundle open` | Opens the source directory for a gem in your bundle |
23+
| `bout` | `bundle outdated` | List installed gems with newer versions available |
24+
| `bp` | `bundle package` | Package your needed .gem files into your application |
25+
| `bu` | `bundle update` | Update your gems to the latest available versions |
2626

2727
## Gem wrapper
2828

plugins/bundler/bundler.plugin.zsh

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,13 @@ alias ba="bundle add"
44
alias bck="bundle check"
55
alias bcn="bundle clean"
66
alias be="bundle exec"
7-
alias bi="bundle_install"
7+
alias bi="bundle install"
88
alias bl="bundle list"
99
alias bo="bundle open"
1010
alias bout="bundle outdated"
1111
alias bp="bundle package"
1212
alias bu="bundle update"
1313

14-
## Functions
15-
16-
bundle_install() {
17-
# Bail out if bundler is not installed
18-
if (( ! $+commands[bundle] )); then
19-
echo "Bundler is not installed"
20-
return 1
21-
fi
22-
23-
# Bail out if not in a bundled project
24-
if ! _within-bundled-project; then
25-
echo "Can't 'bundle install' outside a bundled project"
26-
return 1
27-
fi
28-
29-
# Check the bundler version is at least 1.4.0
30-
autoload -Uz is-at-least
31-
local bundler_version=$(bundle version | cut -d' ' -f3)
32-
if ! is-at-least 1.4.0 "$bundler_version"; then
33-
bundle install "$@"
34-
return $?
35-
fi
36-
37-
# If bundler is at least 1.4.0, use all the CPU cores to bundle install
38-
if [[ "$OSTYPE" = (darwin|freebsd)* ]]; then
39-
local cores_num="$(sysctl -n hw.ncpu)"
40-
else
41-
local cores_num="$(nproc)"
42-
fi
43-
BUNDLE_JOBS="$cores_num" bundle install "$@"
44-
}
45-
4614
## Gem wrapper
4715

4816
bundled_commands=(

0 commit comments

Comments
 (0)