Sha256: aaeba1d69d1a73016407420bab237c3a9c18c305e52f73d9a09b1350e22e2b36

Contents?: true

Size: 667 Bytes

Versions: 71

Compression:

Stored size: 667 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)
        raise "Could not find Template at path '#{template_filepath}'".red
      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

71 entries across 71 versions & 1 rubygems

Version Path
fastlane-1.68.0 lib/fastlane/erb_template_helper.rb
fastlane-1.67.0 lib/fastlane/erb_template_helper.rb
fastlane-1.66.0 lib/fastlane/erb_template_helper.rb
fastlane-1.65.0 lib/fastlane/erb_template_helper.rb
fastlane-1.64.0 lib/fastlane/erb_template_helper.rb
fastlane-1.63.1 lib/fastlane/erb_template_helper.rb
fastlane-1.63.0 lib/fastlane/erb_template_helper.rb
fastlane-1.62.0 lib/fastlane/erb_template_helper.rb
fastlane-1.61.0 lib/fastlane/erb_template_helper.rb
fastlane-1.60.0 lib/fastlane/erb_template_helper.rb
fastlane-1.59.0 lib/fastlane/erb_template_helper.rb
fastlane-1.58.0 lib/fastlane/erb_template_helper.rb
fastlane-1.57.0 lib/fastlane/erb_template_helper.rb
fastlane-1.56.0 lib/fastlane/erb_template_helper.rb
fastlane-1.55.0 lib/fastlane/erb_template_helper.rb
fastlane-1.54.0 lib/fastlane/erb_template_helper.rb
fastlane-1.53.0 lib/fastlane/erb_template_helper.rb
fastlane-1.52.0 lib/fastlane/erb_template_helper.rb
fastlane-1.51.0 lib/fastlane/erb_template_helper.rb
fastlane-1.50.0 lib/fastlane/erb_template_helper.rb