Spec-Zone.ru › Homebrew

Class: Version::StemParser Private

Inherits:
RegexParser
  • Object
  • Parser
  • RegexParser
  • Version::StemParser
show all
Defined in:
version/parser.rb

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.

Constant Summary collapse

SOURCEFORGE_DOWNLOAD_REGEX =

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

%r{(?:sourceforge\.net|sf\.net)/.*/download$}
NO_FILE_EXTENSION_REGEX =

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

/\.[^a-zA-Z]+$/

Class Method Summary collapse

  • .process_spec(spec) ⇒ String private

Methods inherited from RegexParser

#initialize, #parse

Methods inherited from Parser

#parse

Constructor Details

This class inherits a constructor from Version::RegexParser

Class Method Details

.process_spec(spec) ⇒ String

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:

  • spec (Pathname)

Returns:

  • (String)


54
55
56
57
58
59
60
61
62
# File 'version/parser.rb', line 54

def self.process_spec(spec)
  return spec.basename.to_s if spec.directory?

  spec_s = spec.to_s
  return spec.dirname.stem if spec_s.match?(SOURCEFORGE_DOWNLOAD_REGEX)
  return spec.basename.to_s if spec_s.match?(NO_FILE_EXTENSION_REGEX)

  spec.stem
end

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

Spec-Zone.ru

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