class Specinfra::Backend::Dockerfile

Public Class Methods

new(config = {}) click to toggle source
Calls superclass method Specinfra::Backend::Base.new
# File lib/specinfra/backend/dockerfile.rb, line 4
def initialize(config = {})
  super

  @lines = []
  ObjectSpace.define_finalizer(self) {
    if get_config(:dockerfile_finalizer).nil?
      puts @lines
    else
      get_config(:dockerfile_finalizer).call(@lines)
    end
  }
end

Public Instance Methods

from(base) click to toggle source
# File lib/specinfra/backend/dockerfile.rb, line 27
def from(base)
  @lines << "FROM #{base}"
end
run_command(cmd, opts={}) click to toggle source
# File lib/specinfra/backend/dockerfile.rb, line 17
def run_command(cmd, opts={})
  @lines << "RUN #{cmd}"
  CommandResult.new
end
send_file(from, to) click to toggle source
# File lib/specinfra/backend/dockerfile.rb, line 22
def send_file(from, to)
  @lines << "ADD #{from} #{to}"
  CommandResult.new
end