Created
December 9, 2009 21:48
-
-
Save bhb/252859 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def browse_string(body) | |
Tempfile.open('browse_string') do |f| | |
# I recommend starting testing command with | |
# BROWSER="open -a firefox" on OS X | |
browser = ENV.fetch('BROWSER') { 'firefox' } | |
f.write(body) | |
f.close | |
puts "Starting browser #{browser} with response..." | |
unless system(browser + " " + f.path) | |
warn "Error starting browser #{browser}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment