summaryrefslogtreecommitdiff
path: root/lib/bundler/dependency.rb
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-04-23 19:30:19 +0000
committerBundlerbot <bot@bundler.io>2019-04-23 19:30:19 +0000
commit58357f5bab5e7869d0532041bb44325d1832b036 (patch)
treee118b3e14015e0d3230aa653949ef89250d42d34 /lib/bundler/dependency.rb
parent69bf2bf121dccb750d0d537ff9f7a57473b0120b (diff)
parent2aab1fd231f2af3a0f0a5888a7d5bb5cd079ceb6 (diff)
downloadbundler-58357f5bab5e7869d0532041bb44325d1832b036.tar.gz
Merge #7127
7127: Add git and branch options to `bundle add` r=deivid-rodriguez a=tokachev Closes #6841 These changes will allow to add a gem with the git or branch options. ``` bundle add redis --git "https://github.com/redis/redis-rb" --branch "staging" ``` The result in Gemfile will be: ``` gem "redis", "~> 4.0", :git => "https://github.com/redis/redis-rb", :branch => "staging" ``` Co-authored-by: Baumgarten <baumgarten@localhost.localdomain>
Diffstat (limited to 'lib/bundler/dependency.rb')
-rw-r--r--lib/bundler/dependency.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index e76c2bc08e..0d588bc892 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -7,7 +7,7 @@ require_relative "rubygems_ext"
module Bundler
class Dependency < Gem::Dependency
attr_reader :autorequire
- attr_reader :groups, :platforms, :gemfile
+ attr_reader :groups, :platforms, :gemfile, :git, :branch
PLATFORM_MAP = {
:ruby => Gem::Platform::RUBY,
@@ -84,6 +84,8 @@ module Bundler
@autorequire = nil
@groups = Array(options["group"] || :default).map(&:to_sym)
@source = options["source"]
+ @git = options["git"]
+ @branch = options["branch"]
@platforms = Array(options["platforms"])
@env = options["env"]
@should_include = options.fetch("should_include", true)