Class: Deck::Container::Cmd

Inherits:
Object
  • Object
show all
Includes:
Repeatable, Submodule
Defined in:
lib/deck/container/cmd.rb

Instance Method Summary collapse

Methods included from Repeatable

#attributes, #next, #step

Methods included from Submodule

#attributes, #get, included, #map, #set, #value

Constructor Details

#initializeCmd

Returns a new instance of Cmd.



8
9
# File 'lib/deck/container/cmd.rb', line 8

def initialize
end

Instance Method Details

#build_command(deps) ⇒ Object



22
23
24
# File 'lib/deck/container/cmd.rb', line 22

def build_command(deps)
  "RUN cd #{attributes[:workdir]} && #{attributes[:command]}"
end

#define(command, workdir: '/') ⇒ Object



11
12
13
14
15
16
# File 'lib/deck/container/cmd.rb', line 11

def define(command, workdir: '/')
  step do
    attributes[:command] = command
    attributes[:workdir] = workdir
  end
end

#exportObject



18
19
20
# File 'lib/deck/container/cmd.rb', line 18

def export
  attributes[:command]
end