Class: EacDocker::Images::Templatized

Inherits:
Base
  • Object
show all
Defined in:
lib/eac_docker/images/templatized.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#container

Instance Attribute Details

#provide_dirObject

Returns the value of attribute provide_dir.



14
15
16
# File 'lib/eac_docker/images/templatized.rb', line 14

def provide_dir
  @provide_dir
end

Instance Method Details

#coded_image(provide_dir) ⇒ Object



32
33
34
# File 'lib/eac_docker/images/templatized.rb', line 32

def coded_image(provide_dir)
  ::EacDocker::Images::Coded.new(provide_dir)
end

#idObject



16
17
18
# File 'lib/eac_docker/images/templatized.rb', line 16

def id
  tag
end

#provideObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/eac_docker/images/templatized.rb', line 20

def provide
  ::EacRubyUtils::Fs::Temp.on_directory do |provide_dir|
    begin
      self.provide_dir = provide_dir
      template.apply(self, provide_dir)
      coded_image(provide_dir).tag(tag).provide
    ensure
      self.provide_dir = nil
    end
  end
end