Class: IRB::Kit::Handlers::Paster
- Defined in:
- lib/irb/kit/handlers/paster.rb
Overview
Handles pasting content from the macOS clipboard.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(processor: IO) ⇒ Paster
constructor
A new instance of Paster.
Constructor Details
#initialize(processor: IO) ⇒ Paster
Returns a new instance of Paster.
8 9 10 11 |
# File 'lib/irb/kit/handlers/paster.rb', line 8 def initialize(processor: IO, **) @processor = processor super(**) end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 |
# File 'lib/irb/kit/handlers/paster.rb', line 13 def call processor.popen "pbpaste", "r", &:read rescue Errno::ENOENT io.puts "ERROR: Unable to paste since `pbpaste` is only supported on macOS." end |