aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-03-19 09:39:15 +0100
committerlolwut <lol@wut.com>2012-03-19 19:02:22 +0100
commit7ea338f06332cb397e3d4ead548463e39c863932 (patch)
tree69fe44c1ed2dbde62eba866272b45d8dcc19fc35 /spec/support
parent92d6ede5011f3b67a0ea1133217fca46f9a3a4cb (diff)
downloadbundler-7ea338f06332cb397e3d4ead548463e39c863932.tar.gz
Initial implementation of local git repos.
The proposal of this patch is to implement a functionality that allow developers to work against a git repository locally. This can be achieved by setting up a local override: bundle config rack.local ~/path/to/local/rack Now, instead of checking out a git repository, the local override will be used. This implies a few things: Similar to path, every time the local git repository change, changes will be automatically picked up by Bundler; This means a commit in the local git repo will update the revision in the Gemfile.lock to the local git repo revision. This requires the same attention as git submodules. Before pushing to remote, you need to ensure the local override was pushed, otherwise you may point to a commit that only exists in your local machine. Also, we are doing many checks to ensure a developer won't work with invalid references. Particularly, we force a developer to specify a branch in the Gemfile in order to use local overrides and, if your local repository is on another branch, we will abort. This allows a developer to change between topic or release branches without accidentally changing the reference in the Gemfile.lock. We also ensure that the current revision in the Gemfile.lock exists in the current local override. By doing this, we force the local override to fetch the latest changes in the remotes. There are a few things missing before this change can be merged in: 1) We could improve `bundle check` to validate the conditions above. With this in mind, a developer could add a pre-commit hook that invokes `bundle check` to ensure he isn't pushing an old or invalid reference. However, it will be up to the developer to ensure his local overrides are not dirty or that they were pushed to remote. 2) Currently, every time there is a local override, we are automatically by passing locked specs, regardless if there was a change or not. We need to improve this scenario in order to improve performance. 3) `bundle config foo bar` sets the configuration value for the current user (~). We need to be able to set project configuration and delete them as well.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index c7f5c5bc..c5500cf1 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -56,7 +56,7 @@ module Spec
def bundle(cmd, options = {})
expect_err = options.delete(:expect_err)
exitstatus = options.delete(:exitstatus)
- options["no-color"] = true unless options.key?("no-color") || cmd.to_s[0..3] == "exec"
+ options["no-color"] = true unless options.key?("no-color") || %w(exec conf).include?(cmd.to_s[0..3])
bundle_bin = File.expand_path('../../../bin/bundle', __FILE__)