Sha256: 38f49f20b03861acbd8152e9ff8d9a2100d4df40f08bb08d38206c4c61ce3190
Contents?: true
Size: 1.12 KB
Versions: 9
Compression:
Stored size: 1.12 KB
Contents
require "render_me_pretty" class Kubes::Compiler::Strategy class Erb < Base extend Kubes::Compiler::Dsl::Core::Fields include Kubes::Compiler::Dsl::Core::Helpers include Kubes::Compiler::Layering include Kubes::Compiler::Shared::CustomHelpers include Kubes::Compiler::Shared::CustomVariables include Kubes::Compiler::Shared::Helpers include Kubes::Compiler::Shared::PluginHelpers def initialize(options={}) super # For ERB scope is in this same Strategy::Erb class # For DSL scope is within the each for the Resource classes. IE: kubes/compile/dsl/core/base.rb load_plugin_helpers load_custom_variables load_custom_helpers end def render_result(path) if File.exist?(path) yaml = RenderMePretty.result(path, context: self) result = yaml_load(path, yaml) result.is_a?(Hash) ? result : {} # in case of blank yaml doc a Boolean false is returned else {} end end def yaml_load(path, yaml) YAML.load(yaml) rescue Psych::SyntaxError YamlError.new(path, yaml).show exit 1 end end end
Version data entries
9 entries across 9 versions & 1 rubygems