Spec-Zone.ru › Homebrew

Class: URL

Inherits:
Object
  • Object
  • URL
show all
Defined in:
url.rb

Instance Attribute Summary collapse

  • #specs ⇒ Hash{Symbol => T.untyped} readonly private
  • #using ⇒ Symbol, ... readonly private

Instance Method Summary collapse

  • #download_strategy ⇒ T::Class[AbstractDownloadStrategy] private
  • #initialize(url, specs = {}) ⇒ void constructor private
  • #version ⇒ Version private

Constructor Details

#initialize(url, specs = {}) ⇒ 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:

  • url (String)
  • specs (Hash{Symbol => T.untyped}) (defaults to: {})


14
15
16
17
18
19
# File 'url.rb', line 14

def initialize(url, specs = {})
  @url = T.let(url.freeze, String)
  @specs = T.let(specs.dup, T::Hash[Symbol, T.untyped])
  @using = T.let(@specs.delete(:using), T.nilable(T.any(Symbol, T::Class[AbstractDownloadStrategy])))
  @specs.freeze
end

Instance Attribute Details

#specs ⇒ Hash{Symbol => T.untyped} (readonly)

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:

  • (Hash{Symbol => T.untyped})


8
9
10
# File 'url.rb', line 8

def specs
  @specs
end

#using ⇒ Symbol, ... (readonly)

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:

  • (Symbol, T::Class[AbstractDownloadStrategy], nil)


11
12
13
# File 'url.rb', line 11

def using
  @using
end

Instance Method Details

#download_strategy ⇒ T::Class[AbstractDownloadStrategy]

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:

  • (T::Class[AbstractDownloadStrategy])


27
28
29
30
# File 'url.rb', line 27

def download_strategy
  @download_strategy ||=
    T.let(DownloadStrategyDetector.detect(@url, @using), T.nilable(T::Class[AbstractDownloadStrategy]))
end

#version ⇒ Version

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:

  • (Version)


33
34
35
# File 'url.rb', line 33

def version
  @version ||= T.let(Version.detect(@url, **@specs), T.nilable(Version))
end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/URL.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API