Skip to content

Instantly share code, notes, and snippets.

View joeljunstrom's full-sized avatar
🥰

Joel Junström joeljunstrom

🥰
  • Stockholm, Sweden
View GitHub Profile
# 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)