Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pbcopy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pbcopy

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Pbcopy

Enables piping and redirecting into pbcopy from within Ruby.

Mac OS X only.

This lib is intended as a development aid, not a production utility.

Note that this adds String#|

Pipe strings into pbcopy

On the command line you might do

$ which ruby | pbcopy

Which would copy the location of the ruby binary into your system's paste board. Later you could retrieve it with Command-V.

In Ruby you can pipe any string into pbcopy to achieve the same result

RUBY_VERSION | pbcopy
User.last.login | pbcopy

Redirect arbitrary objects into pbcopy

On the command line you might do

$ pbcopy < some_file

In Ruby you can do

pbcopy < 123
pbcopy < [4, 5, 6]

You can redirect any arbitrary object into pbcopy, it will be turned into a string and placed in the system clipboard

Shorter more Ruby-like version of redirect

You can omit the chevron when redirecting into pbcopy

pbcopy 123
pbcopy [4, 5, 6]

Make available in irb / pry

$ echo 'require "pbcopy"' >> ~/.irbrc
$ echo 'require "pbcopy"' >> ~/.pryrc

Installation

Add this line to your application's Gemfile:

gem 'pbcopy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pbcopy

FAQs

Package last updated on 28 Apr 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc