Sha256: a3f511da2f7f52ea27e4f644396b0b6b82b117433601ad196ae607d1e88f1d2e

Contents?: true

Size: 483 Bytes

Versions: 39

Compression:

Stored size: 483 Bytes

Contents

module Terraspace::Compiler::Strategy
  class Mod < AbstractBase
    def run
      ext = File.extname(@src_path).sub('.','')
      klass = strategy_class(ext)
      strategy = klass.new(@mod, @src_path) # IE: Terraspace::Compiler::Strategy::Mod::Rb.new
      strategy.run
    end

    def strategy_class(ext)
      return Mod::Pass if ext.empty? # infinite loop without this
      "Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
terraspace-0.6.5 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.4 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.3 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.2 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.1 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.0 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.12 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.11 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.10 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.9 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.8 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.7 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.6 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.5 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.4 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.3 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.2 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.1 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.5.0 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.4.4 lib/terraspace/compiler/strategy/mod.rb