Skip to content
golive edited this page Feb 7, 2012 · 1 revision

Useful functions for pry console

Put it on ~/.pryrc

Preview html from string into default browser

def preview_html(content)
  file = Tempfile.new([nil, '.html'])
  file.write(content)
  file.flush
  system "open #{file.path}"
end

Clone this wiki locally