Skip to content

Instantly share code, notes, and snippets.

@alastairhm
Created October 20, 2017 13:51
Show Gist options
  • Save alastairhm/1c488889ebd5db63839ff7da1d4c9ab3 to your computer and use it in GitHub Desktop.
Save alastairhm/1c488889ebd5db63839ff7da1d4c9ab3 to your computer and use it in GitHub Desktop.
Ruby ERB inline templating
require 'erb'
service = "localhost.local"
node = "localhost"
port = "port"
#simple_template = "<%= node %>:<%= port %>"
simple_template = "<%= service %>"
output = ERB.new(simple_template).result()
puts output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment