Skip to content

Instantly share code, notes, and snippets.

@JSchaenzle
Last active August 29, 2015 14:02
Show Gist options
  • Save JSchaenzle/835c1849d7d7382f7af4 to your computer and use it in GitHub Desktop.
Save JSchaenzle/835c1849d7d7382f7af4 to your computer and use it in GitHub Desktop.
Ruby ERB inline
def foobar
hash = `git show --pretty=%h`.strip.upcase
contents = <<-eof
#ifndef VERSION_INFO_H
#define VERSION_INFO_H
#define CURRENT_GET_HASH "#{hash}"
#endif
eof
puts contents
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment