[ANN] pasteboard 1.0 Released

E

Eric Hodel

pasteboard version 1.0 has been released!

* http://github.com/drbrain/pasteboard
* http://docs.seattlerb.org/pasteboard

Pasteboard wraps the OS X system pasteboard. Pasteboard allows you to =
add
and retrieve multiple items and multiple item flavors to the pasteboard =
unlike
+pbpaste+ and +pbcopy+ which only allow text.

=3D=3D FEATURES/PROBLEMS:

* Supports multiple pasteboards
* Returns data with the proper encoding
* Built in library of types in Pasteboard::Type
* Does not understand type conformance (Pasteboard::Type::IMAGE will not
retrieve a Pasteboard::Type::JPEG)

=3D=3D SYNOPSIS:

require 'pasteboard'

pasteboard =3D Pasteboard.new

Adding a URL to the clipboard:

pasteboard.put_url 'http://blog.segment7.net', 'my blog'

Adding a JPEG with URL to the clipboard:

pasteboard.put_jpeg_url jpeg, 'http://example', 'my cool jpeg'

Adding other data to the clipboard (TIFF + URL):

item =3D [
[Pasteboard::Type::TIFF, tiff],
[Pasteboard::Type::URL, url],
[Pasteboard::Type::URL_NAME, url],
[Pasteboard::Type::UTF_8, url],
]
=20
pasteboard.put item

Retrieving data from the clipboard:

require 'pasteboard'

pb =3D Pasteboard.new

pb.first # =3D> all flavors, see Pasteboard#[]

pb.first Pasteboard::Type::TIFF # =3D> TIFF data

See also sample/image.rb and sample/dump.rb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top