Sha256: 5c2ce8dbc099bcd3fefa57741356b6484cb4114aafe95f9b0409aa3e209edd70
Contents?: true
Size: 724 Bytes
Versions: 37
Compression:
Stored size: 724 Bytes
Contents
module Terraspace::Compiler::Strategy class Mod < AbstractBase def run klass = strategy_class(@src_path) strategy = klass.new(@mod, @src_path) # IE: Terraspace::Compiler::Strategy::Mod::Rb.new strategy.run end def strategy_class(path) ext = File.extname(path).sub('.','') return Mod::Pass if ext.empty? # infinite loop without this return Mod::Pass if Terraspace.pass_file?(path) or !text_file?(path) # Fallback to Mod::Tf for all other files. ERB useful for terraform.tfvars "Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass end private def text_file?(filename) TextFile.new(filename).check end end end
Version data entries
37 entries across 37 versions & 1 rubygems