diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-11-18 12:17:22 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-11-18 12:24:48 +0530 |
commit | efcc361b32082670aacc873b3ffa10806bf90e6c (patch) | |
tree | 0cc232fd8765ac33b4516d733dff9816015a6cfb /railties/lib | |
parent | 796049ef3e0c526a2c97418d4ba266050bc38c0a (diff) | |
download | rails-efcc361b32082670aacc873b3ffa10806bf90e6c.tar.gz rails-efcc361b32082670aacc873b3ffa10806bf90e6c.tar.bz2 rails-efcc361b32082670aacc873b3ffa10806bf90e6c.zip |
Use secure source for gems referencing "github" in the generated apps
- New apps generated on master and latest bundler give warning about
"github" source being insecure.
- Use the same solution used for Rails master in the generated app's
Gemfile to fix this issue.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/Gemfile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 422217286c..f1015b16d5 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -1,5 +1,10 @@ source 'https://rubygems.org' +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" +end + <% gemfile_entries.each do |gem| -%> <% if gem.comment -%> |