Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment