Class: Itamae::Resource::Template

Inherits:
File
  • Object
show all
Defined in:
lib/itamae/resource/template.rb

Defined Under Namespace

Classes: RenderContext

Instance Attribute Summary

Attributes inherited from Base

#attributes, #current_attributes, #notifications, #recipe, #resource_name, #subscriptions, #updated

Instance Method Summary collapse

Methods inherited from File

#action_create, #action_delete, #set_current_attributes, #show_differences

Methods inherited from Base

#action_nothing, define_attribute, inherited, #initialize, #resource_type, #run

Constructor Details

This class inherits a constructor from Itamae::Resource::Base

Instance Method Details

#pre_actionObject



11
12
13
14
15
16
# File 'lib/itamae/resource/template.rb', line 11

def pre_action
  src = ::File.expand_path(attributes.source, ::File.dirname(@recipe.path))
  attributes.content = RenderContext.new(self).render_file(src)

  super
end