Sha256: 4068c5ed09c1e66ee0391c971dac5b4532ef80b5420b87273f894232b30d6a03

Contents?: true

Size: 672 Bytes

Versions: 9

Compression:

Stored size: 672 Bytes

Contents

module Fastlane
  class ErbTemplateHelper
    require "erb"
    def self.load(template_name)
      path = "#{Helper.gem_path('fastlane')}/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)
      Fastlane::ErbalT.new(template_vars_hash).render(template)
    end
  end
  class ErbalT < OpenStruct
    def render(template)
      ERB.new(template).result(binding)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fastlane-1.100.0 lib/fastlane/erb_template_helper.rb
fastlane-1.99.0 lib/fastlane/erb_template_helper.rb
fastlane-1.98.0 lib/fastlane/erb_template_helper.rb
fastlane-1.97.2 lib/fastlane/erb_template_helper.rb
fastlane-1.97.1 lib/fastlane/erb_template_helper.rb
fastlane-1.97.0 lib/fastlane/erb_template_helper.rb
fastlane-1.96.0 lib/fastlane/erb_template_helper.rb
fastlane-1.95.0 lib/fastlane/erb_template_helper.rb
fastlane-1.94.1 lib/fastlane/erb_template_helper.rb