erb

Allows to Generate output files based on ERB templates

Renders an ERB template with placeholders given as a hash via parameter, if no :destination is set, returns rendered template as string

erb
Supported platforms ios, android, mac
Author @hjanuschka

1 Example

# Example `erb` template:

# Variable1 <%= var1 %>
# Variable2 <%= var2 %>
# <% for item in var3 %>
#        <%= item %>
# <% end %>

erb(
  template: "1.erb",
  destination: "/tmp/rendered.out",
  placeholders: {
    :var1 => 123,
    :var2 => "string",
    :var3 => ["element1", "element2"]
  }
)

Parameters

Key Description
template ERB Template File
destination Destination file
placeholders Placeholders given as a hash


To show the documentation in your terminal, run

fastlane action erb

View source code


Back to actions