Sha256: ccb8ce5bb257ebc81952d4cde3bb3088cc0b2a6bb181fdde178dca8b247254a4

Contents?: true

Size: 559 Bytes

Versions: 6

Compression:

Stored size: 559 Bytes

Contents

# automate creating pasties
class Object
  if :macosx == Platform::IMPL
    def pastie
      pastie_url = Net::HTTP.post_form(URI.parse("http://pastie.caboo.se/pastes/create"),
                                       {"paste_parser" => "ruby",
                                        "paste[authorization]" => "burger",
                                        "paste[body]" => MacClipboard.read}).body.match(/href="([^\"]+)"/)[1]
      MacClipboard.write(pastie_url)
      system("open #{pastie_url}")
      pastie_url
    end
    alias :pst :pastie
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
utility_belt-1.0.1 lib/pastie.rb
utility_belt-1.0.6 lib/pastie.rb
utility_belt-1.0.5 lib/pastie.rb
utility_belt-1.0.2 lib/pastie.rb
utility_belt-1.0.3 lib/pastie.rb
utility_belt-1.0.4 lib/pastie.rb