Repository is archived
Low commit activity in last 3 years
No release in over a year
A simple gem for accessing the clipboard, based on libclipboard
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0.3
~> 3.10
~> 1.16.0
 Project Readme

Simple Clipboard

Overview

This is a very minimalist Ruby Gem that demonstrates how native extensions can be used to access a user's clipboard.

Dependencies

Build tools

You will need git, cmake, and an appropriate C++ compiler tool-chain (e.g. GCC) to install this gem.

libclipboard

Assuming you have git, cmake, and a compatible C++ compiler tool-chain installed, you should be able to install libclipboard by following these steps:

git clone https://github.com/jtanx/libclipboard
cd libclipboard
mkdir build
cd build
cmake ..
make -j4
sudo make install

Build

Building the gem should be as simple as:

gem build simple_clipboard.gemspec

Installation

Assuming that libclipboard has been installed, you will be able to install the gem:

gem install simple_clipboard-0.0.1.gem

Usage

This gem defines a module called SimpleClipboard, with two methods for interacting with a user's clipboard:

  • get_text - returns the current clipboard contents as a string
  • set_text(new_text) - replaces the contents of the clipboard with the value of new_text, and returns the previous contents of the clipboard

License

This project is licensed under the MIT License.

See the LICENSE file for more information.