Class: DockerSync::DockerComposeSession

Inherits:
Object
  • Object
show all
Defined in:
lib/docker-sync/docker_compose_session.rb

Overview

based on ‘Docker::Compose::Compose` from `docker-compose` gem

Instance Method Summary collapse

Constructor Details

#initialize(dir: nil, files: nil) ⇒ DockerComposeSession

Returns a new instance of DockerComposeSession.



6
7
8
9
10
# File 'lib/docker-sync/docker_compose_session.rb', line 6

def initialize(dir: nil, files: nil)
  @dir = dir
  @files = files || [] # Array[String]
  @last_command = nil
end

Instance Method Details

#downObject



23
24
25
# File 'lib/docker-sync/docker_compose_session.rb', line 23

def down
  run!('down')
end

#stopObject



19
20
21
# File 'lib/docker-sync/docker_compose_session.rb', line 19

def stop
  run!('stop')
end

#up(build: false) ⇒ Object



12
13
14
15
16
17
# File 'lib/docker-sync/docker_compose_session.rb', line 12

def up(build: false)
  args = []
  args << '--build' if build

  run!('up', *args)
end