Skip to content

Instantly share code, notes, and snippets.

@chrislo
Created February 9, 2010 10:51
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 chrislo/299094 to your computer and use it in GitHub Desktop.
Save chrislo/299094 to your computer and use it in GitHub Desktop.
# put this in your ~/.irbrc
def write_to_file(content, filename = "output.txt")
File.open(filename, 'w') {|f| f.write(content)}
puts "Wrote to #{filename}"
return true
end
# then in an irb console you can do
require 'smithy'
response = ForgeProxy.get('http://some.url/')
write_to_file(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment