Sha256: 8b03208437eef8c384793b2563820bac10ba88c1cc0db788e422588d3481777a

Contents?: true

Size: 802 Bytes

Versions: 521

Compression:

Stored size: 802 Bytes

Contents

module Fastlane
  class ErbTemplateHelper
    require "erb"
    def self.load(template_name)
      path = "#{Fastlane::ROOT}/lib/assets/#{template_name}.erb"
      load_from_path(path)
    end

    def self.load_from_path(template_filepath)
      unless File.exist?(template_filepath)
        UI.user_error!("Could not find template at path '#{template_filepath}'")
      end
      File.read(template_filepath)
    end

    def self.render(template, template_vars_hash, trim_mode = nil)
      Fastlane::ErbalT.new(template_vars_hash, trim_mode).render(template)
    end
  end
  class ErbalT < OpenStruct
    def initialize(hash, trim_mode = nil)
      super(hash)
      @trim_mode = trim_mode
    end

    def render(template)
      ERB.new(template, nil, @trim_mode).result(binding)
    end
  end
end

Version data entries

521 entries across 521 versions & 2 rubygems

Version Path
fastlane-2.132.0.beta.20190922200014 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190921200021 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190920200012 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190919200100 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190918200023 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190917200011 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190916200055 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190915200038 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190914200034 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190913200058 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.132.0.beta.20190912200052 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190911200010 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190910200104 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190909200058 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190908200041 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190907200030 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190906200026 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190905200113 fastlane/lib/fastlane/erb_template_helper.rb
fastlane-2.131.0.beta.20190904200040 fastlane/lib/fastlane/erb_template_helper.rb