Sha256: 45fe89327a909be1fc5275cc57172a150010443c2ee320976071375ae7cdc45f

Contents?: true

Size: 664 Bytes

Versions: 6

Compression:

Stored size: 664 Bytes

Contents

module Berkshelf
  class GithubLocation < GitLocation
    HOST = 'github.com'
    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] = "git://#{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

6 entries across 6 versions & 1 rubygems

Version Path
berkshelf-5.5.0 lib/berkshelf/locations/github.rb
berkshelf-5.4.0 lib/berkshelf/locations/github.rb
berkshelf-5.3.0 lib/berkshelf/locations/github.rb
berkshelf-5.2.0 lib/berkshelf/locations/github.rb
berkshelf-5.1.0 lib/berkshelf/locations/github.rb
berkshelf-5.0.0 lib/berkshelf/locations/github.rb