The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Gem: clipboard

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jan Lelis

Posts: 136
Nickname: rbjl
Registered: Aug, 2009

Jan Lelis is an IT student from Dresden/Germany
Gem: clipboard Posted: Oct 3, 2010 10:26 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jan Lelis.
Original Post: Gem: clipboard
Feed Title: rbJ*_*L.net
Feed URL: http://feeds.feedburner.com/rbJL
Feed Description: Hi, I am a fan of Ruby and like to explore it and the world around ;). So I started this blog, where I am publishing code snippets, tutorials for beginners as well as general thoughts about Ruby, the web or programming in general.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jan Lelis
Latest Posts From rbJ*_*L.net

Advertisement

The clipboard gem allows you to access the clipboard on Liunx, MacOS and Windows.

The focus is on simple text. You can copy a string with Clipboard.copy("string") and paste it with Clipboard.paste. That’s it ;). Basically. Now let’s take a closer look at the specific platforms.

Linux

For Linux support, the little utility xclip is needed, you can install on ubuntu with sudo apt-get install xclip

Furthermore, you can choose, from which clipboard you want to paste (default is PRIMARY). copy copies to all clipboards in Clipboard::CLIPBOARDS. For example: Clipboard.paste :clipboard

MacOS

On MacOS, everything works fine :).

Windows

I’ve fought with the Win32API and still not all problems are solved (e.g. pasting with 1.9). Copying should be no problem, but you need the clip.exe program (installed by default since Vista).

Please report any bug you might encounter

CC-BY (DE)

Read: Gem: clipboard

Topic: Requirements: A Mini RubyGems plugin Previous Topic   Next Topic Topic: ActionScript in Action - new column in FFD Mag

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use