Sha256: c571a9da71d2fb2c53a36c43b245357e05e7cadaebdd94c76bb0c21e33f5db9f
Contents?: true
Size: 1.01 KB
Versions: 31
Compression:
Stored size: 1.01 KB
Contents
module Lono # 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::Erb#run method generates the CloudFormation templates # and embeds user-data script into the template. class UserData def initialize(blueprint, options) @blueprint, @options = blueprint, options @name = options[:name] @path = "#{Lono.root}/app/user_data/#{@name}.sh" end 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".color(:red) exit 1 end end # Context for ERB rendering. # This is where we control what references get passed to the ERB rendering. def context @context ||= Lono::Template::Context.new(@blueprint, @options) end end end
Version data entries
31 entries across 31 versions & 1 rubygems