utility_belt tweak 2 - passing a string directly to pastie
Instead of having to run it through the clipboard first:
def pastie(string=nil)
pastie_url = Net::HTTP.post_form(URI.parse(“http://pastie.caboo.se/pastes/create”),
{"paste_parser" => “ruby”,
“paste[authorization]” => “burger”,
“paste[body]” => (string || MacClipboard.read)}).body.match(/href=“([^\”]+)“/)1
MacClipboard.write(pastie_url)
system(”open #{pastie_url}")
pastie_url
end
If you are wondering WTF is going on, read the previous post