Class: Specinfra::Backend::Dockerfile

Inherits:
Base
  • Object
show all
Defined in:
lib/specinfra/backend/dockerfile.rb

Instance Method Summary collapse

Methods inherited from Base

#set_example

Constructor Details

#initializeDockerfile

Returns a new instance of Dockerfile.



4
5
6
7
8
9
# File 'lib/specinfra/backend/dockerfile.rb', line 4

def initialize
  @lines = []
  ObjectSpace.define_finalizer(self) {
    puts @lines
  }
end

Instance Method Details

#from(base) ⇒ Object



16
17
18
# File 'lib/specinfra/backend/dockerfile.rb', line 16

def from(base)
  @lines << "FROM #{base}"
end

#run_command(cmd, opts = {}) ⇒ Object



11
12
13
14
# File 'lib/specinfra/backend/dockerfile.rb', line 11

def run_command(cmd, opts={})
  @lines << "RUN #{cmd}"
  CommandResult.new
end