Flowdock
method

add_git_sources

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: Dsl
  • 1_8_6_287
  • 1_8_7_72
  • 1_8_7_330
  • 1_9_1_378
  • 1_9_2_180
  • 1_9_3_125
  • 1_9_3_392
  • 2_1_10
  • 2_2_9
  • 2_4_6
  • 2_5_5
  • 2_6_3 (0)
  • What's this?
add_git_sources() private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/bundler/dsl.rb, line 286
    def add_git_sources
      return if Bundler.feature_flag.skip_default_git_sources?

      git_source(:github) do |repo_name|
        warn_deprecated_git_source(:github, "https://github.com/#{repo_name}.git".strip, 'Change any "reponame" :github sources to "username/reponame".')
        # It would be better to use https instead of the git protocol, but this
        # can break deployment of existing locked bundles when switching between
        # different versions of Bundler. The change will be made in 2.0, which
        # does not guarantee compatibility with the 1.x series.
        #
        # See https://github.com/bundler/bundler/pull/2569 for discussion
        #
        # This can be overridden by adding this code to your Gemfiles:
        #
        #   git_source(:github) do |repo_name|
        #     repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
        #     "https://github.com/#{repo_name}.git"
        #   end
        repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
        # TODO: 2.0 upgrade this setting to the default
        if Bundler.feature_flag.github_https?
          Bundler::SharedHelpers.major_deprecation 2, "The `github.https` setting will be removed"
          "https://github.com/#{repo_name}.git"
        else
          "git://github.com/#{repo_name}.git"
        end
      end

      # TODO: 2.0 remove this deprecated git source
      git_source(:gist) do |repo_name|
        warn_deprecated_git_source(:gist, '"https://gist.github.com/#{repo_name}.git"')

        "https://gist.github.com/#{repo_name}.git"
      end

      # TODO: 2.0 remove this deprecated git source
      git_source(:bitbucket) do |repo_name|
        warn_deprecated_git_source(:bitbucket, user_name, repo_name = repo_name.split("/")repo_name ||= user_name"https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git".strip)

        user_name, repo_name = repo_name.split("/")
        repo_name ||= user_name
        "https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git"
      end
    end
Register or log in to add new notes.