Sha256: 8c234616b5c7342444a180150f7a46b15ac442248075bf49655b7ac4507dee5f

Contents?: true

Size: 671 Bytes

Versions: 10

Compression:

Stored size: 671 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] = "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

10 entries across 10 versions & 1 rubygems

Version Path
berkshelf-7.2.2 lib/berkshelf/locations/github.rb
berkshelf-7.2.1 lib/berkshelf/locations/github.rb
berkshelf-7.2.0 lib/berkshelf/locations/github.rb
berkshelf-7.1.0 lib/berkshelf/locations/github.rb
berkshelf-7.0.10 lib/berkshelf/locations/github.rb
berkshelf-7.0.9 lib/berkshelf/locations/github.rb
berkshelf-7.0.8 lib/berkshelf/locations/github.rb
berkshelf-7.0.7 lib/berkshelf/locations/github.rb
berkshelf-7.0.6 lib/berkshelf/locations/github.rb
berkshelf-7.0.5 lib/berkshelf/locations/github.rb