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
# stick it in your ~/.pryrc | |
# use 'xsel' or 'xclip' if you're in a Linux environment | |
# | |
def _cp(obj = Readline::HISTORY.entries[-2], *options) | |
if obj.respond_to?(:join) && !options.include?(:a) | |
if options.include?(:s) | |
obj = obj.map { |element| ":#{element.to_s}" } | |
end | |
out = obj.join(", ") | |
elsif obj.respond_to?(:inspect) |