Class: Lono::UserData
- Inherits:
-
Object
- Object
- Lono::UserData
- Defined in:
- lib/lono/user_data.rb
Overview
This class is not use by lono internally. It is really only meant to be exposed to the lono userdata command so users can debug their generated app/user_data scripts. It is useful for debugging.
Normally, the Lono::DSL#run method generates the CloudFormation templates and embeds user-data script into the template.
Instance Method Summary collapse
-
#context ⇒ Object
Context for ERB rendering.
- #generate ⇒ Object
-
#initialize(options) ⇒ UserData
constructor
A new instance of UserData.
Constructor Details
Instance Method Details
#context ⇒ Object
Context for ERB rendering. This is where we control what references get passed to the ERB rendering.
27 28 29 |
# File 'lib/lono/user_data.rb', line 27 def context @context ||= Lono::Template::Context.new(@options) end |
#generate ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/lono/user_data.rb', line 15 def generate puts "Generating user_data for '#{@name}' at #{@path}" if File.exist?(@path) puts RenderMePretty.result(@path, context: context) else puts "ERROR: #{@path} does not exist".colorize(:red) exit 1 end end |