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
* 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