Class: Cask::URL Private
- Includes:
- Kernel
- Defined in:
- cask/url.rb,
cask/url.rbi
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.
Class corresponding to the url
stanza.
Defined Under Namespace
Constant Summary
Constants included from Kernel
Kernel::IGNORE_INTERRUPTS_MUTEX
Instance Method Summary collapse
- #__getobj__ ⇒ Object private
- #__setobj__(dsl) ⇒ Object private
- #from_block? ⇒ Boolean private
- #initialize(uri = nil, verified: nil, using: nil, tag: nil, branch: nil, revisions: nil, revision: nil, trust_cert: nil, cookies: nil, referer: nil, header: nil, user_agent: nil, data: nil, only_path: nil, caller_location: T.must(caller_locations).fetch(0), dsl: nil, &block) ⇒ void constructor private
- #location ⇒ Homebrew::SourceLocation private
- #referer ⇒ URI::Generic, ... private
- #specs ⇒ Hash{Symbol => T.untyped} private
- #unversioned?(ignore_major_version: false) ⇒ Boolean private
- #user_agent ⇒ Symbol, ... private
- #using ⇒ T::Class[T.anything], ... private
- #verified ⇒ String? private
Methods included from Kernel
#disk_usage_readable, #ensure_executable!, #ensure_formula_installed!, #exec_browser, #exec_editor, #ignore_interrupts, #interactive_shell, #number_readable, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #paths, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled, #quiet_system, #redact_secrets, #redirect_stdout, #require?, #safe_system, #tap_and_name_comparison, #truncate_text_to_approximate_size, #which, #which_all, #which_editor, #with_custom_locale, #with_env, #with_homebrew_path
Constructor Details
#initialize(uri = nil, verified: nil, using: nil, tag: nil, branch: nil, revisions: nil, revision: nil, trust_cert: nil, cookies: nil, referer: nil, header: nil, user_agent: nil, data: nil, only_path: nil, caller_location: T.must(caller_locations).fetch(0), dsl: nil, &block) ⇒ 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.
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'cask/url.rb', line 195 def initialize( uri = nil, verified: nil, using: nil, tag: nil, branch: nil, revisions: nil, revision: nil, trust_cert: nil, cookies: nil, referer: nil, header: nil, user_agent: nil, data: nil, only_path: nil, caller_location: T.must(caller_locations).fetch(0), dsl: nil, &block ) super( if block LazyObject.new do uri2, = *BlockDSL.new(uri, dsl: T.must(dsl), &block).call ||= {} DSL.new(uri2, **) end else DSL.new( T.must(uri), verified:, using:, tag:, branch:, revisions:, revision:, trust_cert:, cookies:, referer:, header:, user_agent:, data:, only_path:, ) end ) @from_block = !block.nil? @caller_location = caller_location end |
Instance Method Details
#__getobj__ ⇒ 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.
245 246 247 |
# File 'cask/url.rb', line 245 def __getobj__ @dsl end |
#__setobj__(dsl) ⇒ 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.
249 250 251 |
# File 'cask/url.rb', line 249 def __setobj__(dsl) @dsl = dsl end |
#from_block? ⇒ 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.
281 282 283 |
# File 'cask/url.rb', line 281 def from_block? @from_block end |
#location ⇒ Homebrew::SourceLocation
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.
254 255 256 |
# File 'cask/url.rb', line 254 def location Homebrew::SourceLocation.new(@caller_location.lineno, raw_url_line&.index("url")) end |
#referer ⇒ URI::Generic, ...
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.
13 |
# File 'cask/url.rbi', line 13 def referer; end |
#specs ⇒ Hash{Symbol => T.untyped}
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.
16 |
# File 'cask/url.rbi', line 16 def specs; end |
#unversioned?(ignore_major_version: false) ⇒ 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.
270 271 272 273 274 275 276 277 278 |
# File 'cask/url.rb', line 270 def unversioned?(ignore_major_version: false) interpolated_url = raw_url_line&.then { |line| line[/url\s+"([^"]+)"/, 1] } return false unless interpolated_url interpolated_url = interpolated_url.gsub(/\#{\s*version\s*\.major\s*}/, "") if ignore_major_version interpolated_url.exclude?('#{') end |
#user_agent ⇒ Symbol, ...
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.
19 |
# File 'cask/url.rbi', line 19 def user_agent; end |
#using ⇒ T::Class[T.anything], ...
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.
Generate this
10 |
# File 'cask/url.rbi', line 10 def using; end |
#verified ⇒ 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.
22 |
# File 'cask/url.rbi', line 22 def verified; end |