diff options
author | The Bundler Bot <bot@bundler.io> | 2017-07-03 04:42:40 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-07-03 04:42:40 +0000 |
commit | 9207a4a211ae123704e889ffc93f75eae01b3477 (patch) | |
tree | 2840d3c7566bd732cee39e1824ff69440133d908 | |
parent | 5e8243ba4845bd87238eb9dfb8ca765683f9229f (diff) | |
parent | 32eb2a38effdca6df339b7da42e2e43a1d9b0087 (diff) | |
download | bundler-9207a4a211ae123704e889ffc93f75eae01b3477.tar.gz |
Auto merge of #5833 - bundler:seg-bundle-binstub, r=colby-swandale
Add a bin/bundle binstub
### What was the end-user problem that led to this PR?
The problem was that developing bundler can be difficult, and letting users use the in-development bundler locally should be as easy as possible.
### What was your diagnosis of the problem?
My diagnosis was we could use a binstub that handles setting up the load path for bundler, ensures the gem spec is activated, and loads the local bundler code.
### What is your fix for the problem, implemented in this PR?
My fix adds such a binstub.
-rwxr-xr-x | bin/bundle | 8 | ||||
-rw-r--r-- | doc/development/SETUP.md | 2 | ||||
-rw-r--r-- | lib/bundler/version.rb | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000000..85ce199a8d --- /dev/null +++ b/bin/bundle @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "rubygems" +bundler_gemspec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__)) +bundler_gemspec.instance_variable_set(:@full_gem_path, File.expand_path("../..", __FILE__)) +bundler_gemspec.activate if bundler_gemspec.respond_to?(:activate) +load File.expand_path("../../exe/bundle", __FILE__) diff --git a/doc/development/SETUP.md b/doc/development/SETUP.md index d4ec555fef..2f971de92b 100644 --- a/doc/development/SETUP.md +++ b/doc/development/SETUP.md @@ -20,7 +20,7 @@ Bundler doesn't use a Gemfile to list development dependencies, because when we 4. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias: - `$ alias dbundle='ruby -I /path/to/bundler/lib /path/to/bundler/exe/bundle'` + `$ alias dbundle='/path/to/bundler/repo/bin/bundle'` ## Debugging with `pry` diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index 3f9a1211fb..dad4a88a26 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: true +# frozen_string_literal: false # Ruby 1.9.3 and old RubyGems don't play nice with frozen version strings # rubocop:disable MutableConstant |