Class: Configspec::Backend::Dockerfile
- Inherits:
-
SpecInfra::Backend::Base
- Object
- SpecInfra::Backend::Base
- Configspec::Backend::Dockerfile
- Defined in:
- lib/configspec/backend/dockerfile.rb
Instance Method Summary collapse
- #from(base) ⇒ Object
-
#initialize ⇒ Dockerfile
constructor
A new instance of Dockerfile.
- #run_command(cmd, opts = {}) ⇒ Object
Constructor Details
#initialize ⇒ Dockerfile
Returns a new instance of Dockerfile.
6 7 8 9 10 11 |
# File 'lib/configspec/backend/dockerfile.rb', line 6 def initialize @lines = [] ObjectSpace.define_finalizer(self) { File.write("Dockerfile", @lines.join("\n")) } end |
Instance Method Details
#from(base) ⇒ Object
19 20 21 |
# File 'lib/configspec/backend/dockerfile.rb', line 19 def from(base) @lines << "FROM #{base}" end |
#run_command(cmd, opts = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/configspec/backend/dockerfile.rb', line 13 def run_command(cmd, opts={}) @lines << "RUN #{cmd}" { :stdout => nil, :stderr => nil, :exit_status => 0, :exit_signal => nil } end |