Sha256: f1b51715150ffbc24595f8b28b5459dc38a17c7f23301b79ac7c299a3a9e9829
Contents?: true
Size: 573 Bytes
Versions: 9
Compression:
Stored size: 573 Bytes
Contents
class Kubes::Compiler class Strategy def initialize(options={}) @options = options @path = options[:path] end def compile klass = strategy_class return false unless klass strategy = klass.new(@options.merge(path: @path)) # Dsl or Erb result = strategy.run result.decorate!(:pre) # compile pre phase decoration result end def strategy_class ext = File.extname(@path).sub('.','').to_sym map = { rb: Dsl, yaml: Erb, yml: Erb, } map[ext] end end end
Version data entries
9 entries across 9 versions & 1 rubygems