Skip to content

Instantly share code, notes, and snippets.

@jgn
Created February 10, 2012 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgn/1789086 to your computer and use it in GitHub Desktop.
Save jgn/1789086 to your computer and use it in GitHub Desktop.
If you have ever wanted to run a step through ERB . . .
require 'erb'
When /\A\(erb\) (.*)\z/ do |*matches|
s = ERB.new(matches[0]).result(binding)
if matches.size > 1
s = <<-MULTI
#{s}
"""
#{ERB.new(matches[1]).result(binding)}
"""
MULTI
end
steps "And #{s}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment