Module: Consist::Commands::Erbable

Included in:
Exec, Mutate, Upload
Defined in:
lib/consist/commands/includes/erbable.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



8
9
10
# File 'lib/consist/commands/includes/erbable.rb', line 8

def self.included(klass)
  klass.extend ClassMethods
end

Instance Method Details

#erb_template(contents) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/consist/commands/includes/erbable.rb', line 12

def erb_template(contents)
  b = binding
  Consist.config.keys.each do |key|
    b.local_variable_set(key, Consist.config[key])
  end
  ERB.new(contents).result(b)
end