class Berkshelf::Location

def init(dependency, options = {})

Returns:
  • (~BaseLocation, nil) -

Parameters:
  • options (Hash) --
  • dependency (Dependency) --

Other tags:
    Example: Create a GitHub location -
    Example: Create a git location -
def init(dependency, options = {})
  if ( klass = klass_from_options(options) )
    klass.new(dependency, options)
  else
    nil
  end
end

def klass_from_options(options)

Returns:
  • (Class, nil) -
def klass_from_options(options)
  options.each do |key, _|
    id = key.to_s.capitalize
    begin
      return Berkshelf.const_get("#{id}Location")
    rescue NameError; end
  end
  nil
end