Class: Cask::URL::BlockDSL Private
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.
Defined Under Namespace
Modules: PageWithURL
Instance Method Summary collapse
-
#call ⇒ URI::Generic, ...
private
-
#initialize(uri, dsl: nil, &block) ⇒ void
constructor
private
-
#method_missing(method, *args, &block) ⇒ Object
-
#respond_to_missing?(method, include_all) ⇒ Boolean
private
Constructor Details
#initialize(uri, 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.
96 97 98 99 100 |
# File 'cask/url.rb', line 96 def initialize(uri, dsl: nil, &block) @uri = uri @dsl = dsl @block = block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
132 133 134 135 136 137 138 |
# File 'cask/url.rb', line 132 def method_missing(method, *args, &block) if @dsl.respond_to?(method) T.unsafe(@dsl).public_send(method, *args, &block) else super end end |
Instance Method Details
#call ⇒ 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.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'cask/url.rb', line 103 def call if @uri result = curl_output("--fail", "--silent", "--location", @uri) result.assert_success! page = result.stdout page.extend PageWithURL page.url = URI(@uri) instance_exec(page, &@block) else instance_exec(&@block) end end |
#respond_to_missing?(method, include_all) ⇒ 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.
140 141 142 |
# File 'cask/url.rb', line 140 def respond_to_missing?(method, include_all) @dsl.respond_to?(method, include_all) || super end |