Class: Ready::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ready/configuration.rb

Overview

Resolves ready's runtime configuration (paths, prefixes, the readyfile) from the environment, falling back to conventional defaults.

Instance Method Summary collapse

Instance Method Details

#build_dirObject



16
17
18
# File 'lib/ready/configuration.rb', line 16

def build_dir
  prefix / "builds"
end

#prefixObject



10
11
12
13
14
# File 'lib/ready/configuration.rb', line 10

def prefix
  fetched = fetch_env :prefix, default: "/tmp/ready"

  Pathname(fetched).expand_path
end

#project_pathObject



6
7
8
# File 'lib/ready/configuration.rb', line 6

def project_path
  Pathname(__dir__).parent.parent.expand_path
end

#readyfileObject



28
29
30
# File 'lib/ready/configuration.rb', line 28

def readyfile
  @readyfile ||= open_readyfile
end

#sock_pathObject



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

def sock_path
  fetched = fetch_env :sock_path do
    prefix / "ready.sock"
  end

  Pathname(fetched)
end