Module: Dapp::Dimg::DockerRegistry::Base::Request
- Included in:
- Dapp::Dimg::DockerRegistry::Base
- Defined in:
- lib/dapp/dimg/docker_registry/base/request.rb
Class Method Summary collapse
Instance Method Summary collapse
- #raw_request(url, **options) ⇒ Object
- #request(url, **options) ⇒ Object
- #url_available?(url) ⇒ Boolean
Class Method Details
.included(base) ⇒ Object
6 7 8 |
# File 'lib/dapp/dimg/docker_registry/base/request.rb', line 6 def self.included(base) base.extend(self) end |
Instance Method Details
#raw_request(url, **options) ⇒ Object
14 15 16 |
# File 'lib/dapp/dimg/docker_registry/base/request.rb', line 14 def raw_request(url, **) Excon.new(url).request(.in_depth_merge()) end |
#request(url, **options) ⇒ Object
10 11 12 |
# File 'lib/dapp/dimg/docker_registry/base/request.rb', line 10 def request(url, **) raw_request(url, .in_depth_merge((url, method: [:method] || :get))) end |
#url_available?(url) ⇒ Boolean
18 19 20 21 22 23 |
# File 'lib/dapp/dimg/docker_registry/base/request.rb', line 18 def url_available?(url) raw_request(url, expects: [200]) true rescue Excon::Error false end |