Sha256: 9c43a5d78b1859281e551210db9307e7629c1a7a5a99e92edd589cd4f7c1f7c7

Contents?: true

Size: 539 Bytes

Versions: 12

Compression:

Stored size: 539 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)
      "Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
terraspace-0.6.18 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.17 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.16 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.15 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.13 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.12 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.11 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.10 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.9 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.8 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.7 lib/terraspace/compiler/strategy/mod.rb
terraspace-0.6.6 lib/terraspace/compiler/strategy/mod.rb