diff --git a/README.md b/README.md index 564c6fc..bc2128e 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,14 @@ It slows the process down slightly, and therefore defaults to `false`. If you're even lazier, you can tell `git-up` to run `bundle install` for you if it finds missing gems. Make sure `git-up.bundler.check` is also set to `true` or it won't do anything. +### `git-up.bundler.local [true|false]` + +If you've `bundle package`-ed your project gems, you can tell `git-up` to run `bundle install --local` for you if it finds missing gems. Much faster than just a plain old `bundle install`. Don't worry if you're missing gems, it will backtrack to `bundle install` if anything goes wrong. Make sure `git-up.bundler.autoinstall` is also set to `true` or it won't do anything. + +### `git-up.bundler.rbenv [true|false]` + +If you have rbenv installed, you can tell `git-up` to run `rbenv rehash` for you after it installs your gems so any binaries will be available right away. Make sure `git-up.bundler.autoinstall` is also set to `true` or it won't do anything. + ### `git-up.fetch.prune [true|false]` By default, `git-up` will append the `--prune` flag to the `git fetch` command if your git version supports it (1.6.6 or greater), telling it to [remove any remote tracking branches which no longer exist on the remote](http://linux.die.net/man/1/git-fetch). Set this option to `false` to disable it. diff --git a/RVM.md b/RVM.md index 676f7a0..09282fc 100644 --- a/RVM.md +++ b/RVM.md @@ -14,19 +14,19 @@ ruby interpreter in the environment, and the way git interprets and executes `git up`. When you run `git [some command]` git will first look internally to see -if it can fulfil the command, then it will attempt to "shell out" and run +if it can fulfill the command, then it will attempt to "shell out" and run whatever `git-[some command]` executable it can find in your $PATH. When git "shells out" all of the environmental variables will be exposed, and it will be able to find our `git-up` executable in the $PATH. However because of the way RVM magically sets your ruby interpreter, -when `git-up` is ran `ruby` still points to the non-RVM system default. +when `git-up` is run `ruby` still points to the non-RVM system default. workaround ---------- To fix this we need to make sure that RVM gets to do it's business -before `git-up` is ran. +before `git-up` is run. RVM provides a handy way of doing this called "wrappers", so let's generate a wrapper for git-up like so: diff --git a/lib/git-up.rb b/lib/git-up.rb index 6efe0da..752ea62 100644 --- a/lib/git-up.rb +++ b/lib/git-up.rb @@ -172,8 +172,21 @@ def check_bundler print 'Gems are missing. '.yellow if config("bundler.autoinstall") == 'true' - puts "Running `bundle install`.".yellow - system "bundle", "install" + if config("bundler.local") == 'true' + puts "Running `bundle install --local`.".yellow + unless system "bundle", "install", "--local" + puts "Problem running `bundle install --local`. Running `bundle install` instead.".yellow + system "bundle", "install" + end + else + puts "Running `bundle install`.".yellow + system "bundle", "install" + end + + if config("bundler.rbenv") == 'true' + puts "Running `rbenv rehash`.".yellow + system "rbenv", "rehash" + end else puts "You should `bundle install`.".yellow end diff --git a/lib/git-up/version.rb b/lib/git-up/version.rb index 73b481b..bb5666a 100644 --- a/lib/git-up/version.rb +++ b/lib/git-up/version.rb @@ -1,3 +1,3 @@ class GitUp - VERSION = "0.5.8" + VERSION = "0.5.9" end