class DockerComposeDeploy::Actions::DockerCompose::File

Attributes

path[R]

Public Class Methods

new(path="./docker-compose.yml") click to toggle source
# File lib/docker_compose_deploy/actions/docker_compose/file.rb, line 8
def initialize(path="./docker-compose.yml")
  @path = path
end

Public Instance Methods

services() click to toggle source
# File lib/docker_compose_deploy/actions/docker_compose/file.rb, line 12
def services
  if !hash["services"]
    raise "This is build to work with version 2 or 3 of docker-compose. It requires the 'services' top level key."
  end

  hash["services"].keys
end

Private Instance Methods

hash() click to toggle source
# File lib/docker_compose_deploy/actions/docker_compose/file.rb, line 22
def hash
  @hash ||= YAML.load(string)
end
string() click to toggle source
# File lib/docker_compose_deploy/actions/docker_compose/file.rb, line 26
def string
  @string ||= ::File.read(@path)
end