Sha256: 364ac029a070211bd138bc5c549d9c4988f1487cf0c0e770184ac96482f444c2
Contents?: true
Size: 841 Bytes
Versions: 17
Compression:
Stored size: 841 Bytes
Contents
require "json" module Lono::Configset::Strategy class Erb < Base include Helpers::Erb def find_evaluation_path paths = %w[configset.yml configset.json].map { |p| "#{@root}/lib/#{p}" } paths.find { |p| File.exist?(p) } end def load content = RenderMePretty.result(@evaluation_path, context: self) # init structure if File.extname(@evaluation_path) == ".yml" load_yaml(content) else JSON.load(content) end end def authentication # noop end def load_yaml(content) # Write to file so can use Yamler::Validator path = "/tmp/lono/configset.yml" FileUtils.mkdir_p(File.dirname(path)) IO.write(path, content) Lono::Yamler::Validator.new(path).validate! Lono::Yamler::Loader.new(content).load end end end
Version data entries
17 entries across 17 versions & 1 rubygems