Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created November 28, 2008 06:27
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 ahoward/29918 to your computer and use it in GitHub Desktop.
Save ahoward/29918 to your computer and use it in GitHub Desktop.
def write(content, private_gist)
url = URI.parse('http://gist.github.com/gists')
req = Net::HTTP.post_form(url, data(nil, nil, content, private_gist))
created = copy(req['Location'])
"#=> #{ created }\n\n#{ content }"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment