Module: Dockerb

Defined in:
lib/dockerb.rb,
lib/dockerb/version.rb

Defined Under Namespace

Classes: Context

Constant Summary collapse

VERSION =
"0.2.5"

Class Method Summary collapse

Class Method Details

.compileObject



5
6
7
8
9
10
11
12
13
# File 'lib/dockerb.rb', line 5

def compile
  return (yield if block_given?) unless File.exist?("Dockerfile.erb")
  begin
    File.write("Dockerfile", Context.compile(File.read("Dockerfile.erb")))
    yield if block_given?
  ensure
    File.unlink("Dockerfile") if File.exist?("Dockerfile") && block_given?
  end
end