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, it returns the 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 | Default |
---|---|---|
template |
ERB Template File | |
destination |
Destination file | |
placeholders |
Placeholders given as a hash | {} |
* = default value is dependent on the user's system
To show the documentation in your terminal, run
fastlane action erb