Class: Aptly::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/aptly/configuration.rb

Overview

Configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri: URI::HTTP.build(host: 'localhost', port: 80, path: '/'), host: nil, port: nil, path: nil) ⇒ Configuration

Creates a new instance.

Parameters:

  • uri (defaults to: URI::HTTP.build(host: 'localhost', port: 80, path: '/'))

    see #uri

  • host (defaults to: nil)

    DEPRECATED use uri

  • port (defaults to: nil)

    DEPRECATED use uri

  • path (defaults to: nil)

    DEPRECATED use uri



19
20
21
22
23
24
25
26
27
# File 'lib/aptly/configuration.rb', line 19

def initialize(uri: URI::HTTP.build(host: 'localhost',
                                    port: 80,
                                    path: '/'),
               host: nil, port: nil, path: nil)
  @uri = nil
  @uri = uri unless host || port || path
  return if @uri
  @uri = fallback_uri(host, port, path)
end

Instance Attribute Details

#hostString

Deprecated.

use #uri

Returns host name to talk to.

Returns:

  • (String)

    host name to talk to



# File 'lib/aptly/configuration.rb', line 29

#pathString

Deprecated.

use #uri

Returns path to use (defaults to /).

Returns:

  • (String)

    path to use (defaults to /)



# File 'lib/aptly/configuration.rb', line 37

#portInteger

Deprecated.

use #uri

Returns port to talk to host to on.

Returns:

  • (Integer)

    port to talk to host to on



# File 'lib/aptly/configuration.rb', line 33

#uriURI

Generally any suitable URI is allowed. This can also be a Unix domain socket which needs to be used in the notation unix:/tmp/sock.

Returns:

  • (URI)

    the base URI for the API (localhost by default)



12
13
14
# File 'lib/aptly/configuration.rb', line 12

def uri
  @uri
end