Class: Berkshelf::GithubLocation
- Inherits:
-
GitLocation
- Object
- BaseLocation
- GitLocation
- Berkshelf::GithubLocation
- Defined in:
- lib/berkshelf/locations/github.rb
Constant Summary collapse
- HOST =
"github.com".freeze
Instance Attribute Summary
Attributes inherited from GitLocation
#branch, #ref, #rel, #revision, #tag, #uri
Attributes inherited from BaseLocation
Instance Method Summary collapse
-
#initialize(dependency, options = {}) ⇒ GithubLocation
constructor
A new instance of GithubLocation.
Methods inherited from GitLocation
#==, #cached_cookbook, #install, #installed?, #to_lock, #to_s
Methods included from Mixin::Git
Methods included from ShellOut
Methods inherited from BaseLocation
#cached_cookbook, #install, #installed?, #to_lock, #validate_cached!
Constructor Details
#initialize(dependency, options = {}) ⇒ GithubLocation
Returns a new instance of GithubLocation.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/berkshelf/locations/github.rb', line 4 def initialize(dependency, = {}) protocol = Berkshelf::Config.instance.github_protocol || :https case protocol when :ssh [:git] = "git@#{HOST}:#{.delete(:github)}.git" when :https [:git] = "https://#{HOST}/#{.delete(:github)}.git" when :git [:git] = "https://#{HOST}/#{.delete(:github)}.git" else # if some bizarre value is provided, treat it as :https [:git] = "https://#{HOST}/#{.delete(:github)}.git" end super end |