Class: Cask::CaskLoader::NullLoader Private

Inherits:
FromPathLoader show all
Extended by:
T::Sig
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.

Pseudo-loader which raises an error when trying to load the corresponding cask.

Instance Attribute Summary

Attributes inherited from FromPathLoader

#path, #token

Attributes inherited from FromContentLoader

#content

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref) ⇒ void

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:



190
191
192
193
# File 'cask/cask_loader.rb', line 190

def initialize(ref)
  token = File.basename(ref, ".rb")
  super CaskLoader.default_path(token)
end

Class Method Details

.can_load?Boolean

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.

Returns:

  • (Boolean)


185
186
187
# File 'cask/cask_loader.rb', line 185

def self.can_load?(*)
  true
end

Instance Method Details

#load(config:) ⇒ Object

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.



195
196
197
# File 'cask/cask_loader.rb', line 195

def load(config:)
  raise CaskUnavailableError.new(token, "No Cask with this name exists.")
end