Sha256: 1e08cac3f67c4fb0e981135c7a4f36c13e0cdfbe6b6268f5c4a975977cda6680
Contents?: true
Size: 1.55 KB
Versions: 3
Compression:
Stored size: 1.55 KB
Contents
module Processor def load_tags(content, cdb) begin context = Radius::Context.new do |c| # map all parameters from 'content' to a tag with the same name content.each do |content_param| c.define_tag "#{content_param.first}" do |_tag| tag = content_param.last # rubocop:disable Lint/UselessAssignment end end # include external file c.define_tag 'include' do |tag| result = '' ext_file = File.join(ENV['WORKSPACE'], tag.attr['file']) if File.exist?(ext_file) result = File.open(ext_file).read else puts 'Warning: can not read static data ' + ext_file end result end c.define_tag 'cdb' do |tag| result = '' if not cdb.nil? or cdb[tag.attr['key']].nil? result = cdb[tag.attr['key']] else puts "Warning: CDB not set for Template-Engine in tag 'cdb'" end result end c.define_tag 'feature_flag' do |tag| result = '' if not cdb.nil? feature = tag.attr['name'] result = cdb[cdb[feature]] else puts "Warning: CDB not set for Template-Engine in tag 'feature_flag'" end result end c.define_tag 'echo' do |tag| tag.expand end end rescue => e $log.writer.error "Error in tag definition: #{e.message}" $log.writer.error e.backtrace exit 1 end context end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
depengine-3.0.23 | lib/depengine/processor/tags.rb |
depengine-3.0.22 | lib/depengine/processor/tags.rb |
depengine-3.0.21 | lib/depengine/processor/tags.rb |