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
|
# File 'lib/terraspace/compiler/strategy/mod.rb', line 3
def run
klass = strategy_class(@src_path)
strategy = klass.new(@mod, @src_path) strategy.run
end
|
#strategy_class(path) ⇒ Object
9
10
11
12
13
14
|
# File 'lib/terraspace/compiler/strategy/mod.rb', line 9
def strategy_class(path)
ext = File.extname(path).sub('.','')
return Mod::Pass if ext.empty? return Mod::Pass if Terraspace.pass_file?(path)
"Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
end
|