Class: Devkitkat::Executor::Docker

Inherits:
Object
  • Object
show all
Defined in:
lib/devkitkat/executor/docker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service) ⇒ Docker

Returns a new instance of Docker.



11
12
13
# File 'lib/devkitkat/executor/docker.rb', line 11

def initialize(service)
  @service = service
end

Instance Attribute Details

#script_fileObject (readonly)

Returns the value of attribute script_file.



7
8
9
# File 'lib/devkitkat/executor/docker.rb', line 7

def script_file
  @script_file
end

#serviceObject (readonly)

Returns the value of attribute service.



7
8
9
# File 'lib/devkitkat/executor/docker.rb', line 7

def service
  @service
end

Instance Method Details

#cleanupObject



19
20
21
# File 'lib/devkitkat/executor/docker.rb', line 19

def cleanup
  stop_container
end

#commit(script_file) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/devkitkat/executor/docker.rb', line 23

def commit(script_file)
  @script_file = script_file

  rewrite_root_path!
  new_path = script_path_in_container

  container.exec([new_path])
end

#prepareObject



15
16
17
# File 'lib/devkitkat/executor/docker.rb', line 15

def prepare
  start_container
end