Skip to content

Commit

Permalink
fix Bundler patch in case gemfile is run multiple times
Browse files Browse the repository at this point in the history
Change-Id: I544033693c8b9cdec16bf5ee31539c6f4904aafb
Reviewed-on: https://gerrit.instructure.com/30793
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
  • Loading branch information
ccutrer committed Feb 25, 2014
1 parent 76264bb commit 55e9b7e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Gemfile
Expand Up @@ -30,11 +30,13 @@ end
require File.expand_path("../config/canvas_rails3", __FILE__)

# patch bundler to do github over https
class Bundler::Dsl
alias_method :_old_normalize_options, :_normalize_options
def _normalize_options(name, version, opts)
_old_normalize_options(name, version, opts)
opts['git'].sub!('git://', 'https://') if opts['git'] && opts['git'] =~ %r{^git://github.com}
unless Bundler::Dsl.private_instance_methods.include?(:_old_normalize_options)
class Bundler::Dsl
alias_method :_old_normalize_options, :_normalize_options
def _normalize_options(name, version, opts)
_old_normalize_options(name, version, opts)
opts['git'].sub!('git://', 'https://') if opts['git'] && opts['git'] =~ %r{^git://github.com}
end
end
end

Expand Down

0 comments on commit 55e9b7e

Please sign in to comment.