Class: Kitchen::Docker::ERBContext
- Inherits:
-
Object
- Object
- Kitchen::Docker::ERBContext
- Defined in:
- lib/kitchen/docker/erb_context.rb
Overview
Evaluation context for a user-supplied Dockerfile template.
Each configuration key becomes an instance variable, so a template can
refer to @image, @username, and the rest.
Instance Method Summary collapse
-
#get_binding ⇒ Binding
A binding for ERB to evaluate the template in.
-
#initialize(config = {}) ⇒ ERBContext
constructor
Exposes each config key to the template as an instance variable, so a custom Dockerfile can refer to
@image,@username, and the rest.
Constructor Details
#initialize(config = {}) ⇒ ERBContext
Exposes each config key to the template as an instance variable, so a
custom Dockerfile can refer to @image, @username, and the rest.
29 30 31 32 33 |
# File 'lib/kitchen/docker/erb_context.rb', line 29 def initialize(config = {}) config.each do |key, value| instance_variable_set("@" + key.to_s, value) end end |
Instance Method Details
#get_binding ⇒ Binding
Returns a binding for ERB to evaluate the template in.
36 37 38 |
# File 'lib/kitchen/docker/erb_context.rb', line 36 def get_binding binding end |