Sha256: 6b6f41d990a56343b0d29612d5000d57203e5febd0d8e65fd09b47af78b44b6c
Contents?: true
Size: 664 Bytes
Versions: 17
Compression:
Stored size: 664 Bytes
Contents
require 'java' class RubyClip import java.awt.datatransfer.StringSelection; import java.awt.Toolkit; include java.awt.datatransfer.ClipboardOwner def self.set_clipboard to_this stringSelection = StringSelection.new( to_this.to_s ) clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() clipboard.setContents( stringSelection, self ); end def self.lostOwnership(aClipboard, aContents) # ignore... end end if $0 == __FILE__ RubyClip.set_clipboard "from jruby1" puts 'set clipboard contents...' RubyClip.set_clipboard "from jruby2" RubyClip.set_clipboard "from jruby3" STDIN.getc end
Version data entries
17 entries across 17 versions & 1 rubygems