Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

bshell lets you enter into a shell where all commands happen in the bundle exec environment.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 bshell.gemspec
Octocat-spinner-32 readme.md
readme.md

bshell

Installation

Add bshell to your project's Gemfile:

gem 'bshell'
$ bundle install

Add this line to your shell config:

$ echo '/usr/bin/env bshell prompt_config' >> ~/.bash_profile

Usage

$ cd ~/projects/my_bundler_managed_project
$ type rake
rake not found
$ bshell
$ type rake
/Users/john/.rbenv/shims/rake

Customization

Add the current project name to your prompt:

export $PROMPT=$BUNDLER_PROJECT_NAME$PROMPT

Now you get:

$ cd ~/projects/awesome_project
$ bshell
AwesomeProject$

Sweet!

Notes

  • possible feature: like how rbenv or rvm pick up a ruby version, bshell could automatically pick up a bundler environment when a Gemfile is detected. This would have to be checked whenever the directory is changed... not exactly clear what should happen if a user cds out of a project... fire up a new "normal" shell? For me, this could be okay -- it's rare that I go in and out of project dirs, usually I have Terminals up for the project, and other Terminals for other stuff. But then we'd be firing up more shells inside the ruby invocation or bundler... icky.
  • n.b.: i haven't used this extensively, there might be corner cases where the environment provided doesn't work out... ruby might run out of memory or munge characters...
  • Any other feedback, criticism, and ideas are welcome :-)
Something went wrong with that request. Please try again.