Class: Cask::CaskLoader::FromInstalledPathLoader Private

Inherits:
FromPathLoader show all
Defined in:
cask/cask_loader.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Loader which loads a cask from the installed cask file.

Instance Attribute Summary

Attributes inherited from FromPathLoader

#path, #token

Attributes inherited from AbstractContentLoader

#content, #tap

Class Method Summary collapse

Methods inherited from FromPathLoader

#initialize, #load

Methods included from ILoader

#load

Constructor Details

This class inherits a constructor from Cask::CaskLoader::FromPathLoader

Class Method Details

.try_new(ref, warn: false) ⇒ T.attached_class?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.attached_class, nil)


490
491
492
493
494
495
496
497
# File 'cask/cask_loader.rb', line 490

def self.try_new(ref, warn: false)
  return unless ref.is_a?(String)

  possible_installed_cask = Cask.new(ref)
  return unless (installed_caskfile = possible_installed_cask.installed_caskfile)

  new(installed_caskfile)
end