summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-06-16 18:53:09 +0000
committerThe Bundler Bot <bot@bundler.io>2017-06-16 18:53:09 +0000
commitd11d693e6b1b28b3e873406ff0f29a4c25e8e67e (patch)
tree88a7a5e4954500c7d92b3845c2c0028a6d57e41c
parent1ce5c35faee7004ccf723d090cdd796d6f79a6f9 (diff)
parent74adefebe765ef3ec1731051301d361972c4c78b (diff)
downloadbundler-d11d693e6b1b28b3e873406ff0f29a4c25e8e67e.tar.gz
Auto merge of #5728 - bundler:seg-bundle-gem-github-source, r=indirect
Create Gemfiles with an HTTPS github source defined ### What was the end-user problem that led to this PR? The problem was that people are creating new Gemfiles that use the built-in `github` git source, which is being removed in 2.0. Additionally, it does _not_ use an encrypted connection to GitHub. ### Was was your diagnosis of the problem? My diagnosis was that we can't change the default because of backwards compatibility, but we can encourage _new_ Gemfiles to "do the right thing". ### What is your fix for the problem, implemented in this PR? My fix is to add our new, recommended definition of the shortcut to all bundler-generated gemfiles. ### Why did you choose this fix out of the possible options? I chose this fix because it will only affect new Gemfiles.
-rw-r--r--lib/bundler/templates/Gemfile2
-rw-r--r--lib/bundler/templates/gems.rb2
-rw-r--r--lib/bundler/templates/newgem/Gemfile.tt2
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/bundler/templates/Gemfile b/lib/bundler/templates/Gemfile
index 7db8998d32..21c6283123 100644
--- a/lib/bundler/templates/Gemfile
+++ b/lib/bundler/templates/Gemfile
@@ -1,4 +1,6 @@
# frozen_string_literal: true
source "https://rubygems.org"
+git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
+
# gem "rails"
diff --git a/lib/bundler/templates/gems.rb b/lib/bundler/templates/gems.rb
index a6ef23ba3e..9495f50c0e 100644
--- a/lib/bundler/templates/gems.rb
+++ b/lib/bundler/templates/gems.rb
@@ -2,4 +2,6 @@
# A sample gems.rb
source "https://rubygems.org"
+git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
+
# gems "rails"
diff --git a/lib/bundler/templates/newgem/Gemfile.tt b/lib/bundler/templates/newgem/Gemfile.tt
index 4cd2e40f4f..c114bd6665 100644
--- a/lib/bundler/templates/newgem/Gemfile.tt
+++ b/lib/bundler/templates/newgem/Gemfile.tt
@@ -1,4 +1,6 @@
source "https://rubygems.org"
+git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
+
# Specify your gem's dependencies in <%= config[:name] %>.gemspec
gemspec