diff --git a/ruby/.pryrc b/ruby/.pryrc
index 08bb131b..5b010430 100644
--- a/ruby/.pryrc
+++ b/ruby/.pryrc
@@ -15,7 +15,8 @@ begin
rescue LoadError
end
-def pbcopy(str)
+def pbcopy(str=nil)
+ str = yield if block_given?
IO.popen(%w[pbcopy], 'w') {|io| io.write str }
end