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

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, **options)
  Excon.new(url).request(default_request_options.in_depth_merge(options))
end

#request(url, **options) ⇒ Object



10
11
12
# File 'lib/dapp/dimg/docker_registry/base/request.rb', line 10

def request(url, **options)
  raw_request(url, options.in_depth_merge(authorization_options(url, method: options[:method] || :get)))
end

#url_available?(url) ⇒ Boolean

Returns:

  • (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