Sha256: 265086908673f84b5e5e8420ef225e3b669244af91b6702567b5a8dbe4f9339f

Contents?: true

Size: 673 Bytes

Versions: 9

Compression:

Stored size: 673 Bytes

Contents

module Berkshelf
  class GithubLocation < GitLocation
    HOST = "github.com".freeze
    def initialize(dependency, options = {})
      protocol = Berkshelf::Config.instance.github_protocol || :https
      case protocol
      when :ssh
        options[:git] = "git@#{HOST}:#{options.delete(:github)}.git"
      when :https
        options[:git] = "https://#{HOST}/#{options.delete(:github)}.git"
      when :git
        options[:git] = "https://#{HOST}/#{options.delete(:github)}.git"
      else
        # if some bizarre value is provided, treat it as :https
        options[:git] = "https://#{HOST}/#{options.delete(:github)}.git"
      end
      super
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
berkshelf-8.0.15 lib/berkshelf/locations/github.rb
berkshelf-8.0.13 lib/berkshelf/locations/github.rb
berkshelf-8.0.12 lib/berkshelf/locations/github.rb
berkshelf-8.0.9 lib/berkshelf/locations/github.rb
berkshelf-8.0.7 lib/berkshelf/locations/github.rb
berkshelf-8.0.5 lib/berkshelf/locations/github.rb
berkshelf-8.0.2 lib/berkshelf/locations/github.rb
berkshelf-8.0.1 lib/berkshelf/locations/github.rb
berkshelf-8.0.0 lib/berkshelf/locations/github.rb