Class: DockerComposeDeploy::Actions::DockerCompose::File

Inherits:
Object
  • Object
show all
Defined in:
lib/docker_compose_deploy/actions/docker_compose/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = "./docker-compose.yml") ⇒ File



8
9
10
# File 'lib/docker_compose_deploy/actions/docker_compose/file.rb', line 8

def initialize(path="./docker-compose.yml")
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/docker_compose_deploy/actions/docker_compose/file.rb', line 7

def path
  @path
end

Instance Method Details

#servicesObject



12
13
14
15
16
17
18
# 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