Class: Terraspace::Compiler::Strategy::Mod
- Inherits:
-
AbstractBase
show all
- Defined in:
- lib/terraspace/compiler/strategy/mod.rb,
lib/terraspace/compiler/strategy/mod/rb.rb,
lib/terraspace/compiler/strategy/mod/tf.rb,
lib/terraspace/compiler/strategy/mod/base.rb,
lib/terraspace/compiler/strategy/mod/pass.rb
Defined Under Namespace
Classes: Base, Pass, Rb, Tf
Instance Method Summary
collapse
#initialize
Instance Method Details
#run ⇒ Object
3
4
5
6
7
8
|
# File 'lib/terraspace/compiler/strategy/mod.rb', line 3
def run
ext = File.extname(@src_path).sub('.','')
klass = strategy_class(ext)
strategy = klass.new(@mod, @src_path)
strategy.run
end
|
#strategy_class(ext) ⇒ Object
10
11
12
13
|
# File 'lib/terraspace/compiler/strategy/mod.rb', line 10
def strategy_class(ext)
return Mod::Pass if ext.empty?
"Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
end
|