Created
October 16, 2017 14:52
-
-
Save ll14m4n/8a480880e174fdd9b6c99b1f668aaf24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'nokogiri' | |
require 'curb' | |
Pry.config.editor = "vim" | |
if `uname` =~ /Darwin/ | |
['pbcopy', 'pbpaste'] | |
else | |
[ 'xclip -selection clipboard -in', | |
'xclip -selection clipboard -out' ] | |
end.tap do |copy,paste| | |
define_method(:_copy) do |arg| | |
IO.popen(copy, "w") { |pipe| pipe.write arg } | |
end | |
define_method(:_paste) do | |
IO.popen(paste, "r", &:read) | |
end | |
end | |
def __copy | |
_copy ObjectSpace.each_object(Pry::HistoryArray).to_a.last[-1].chomp; | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment