I put my favorite monkey patches in my ~/.irbrc. First I create modules (which I call class enhancers) to store every monkey patch:

module ObjectEnhancer
  # list files in current directory
  def ls
    puts `ls -CF`
  end

  # get website headers
  def head(uri="https://example.com", headers={})
    require 'open-uri'
    require 'yaml'
    puts open(uri, headers).meta.to_yaml
  end
end

module FileEnhancer
  # read and rewind a file object
  def rr(bytes=nil)
    text = read(bytes)
    rewind
    text
  end
end

Then I include the class enhancers in their respective classes:

class Object
  include ObjectEnhancer
end

class File
  include FileEnhancer
end

Finally launch irb and behold the magic:

$ irb
irb> ls
2019-09-25-quo-addon.md         2019-10-01-git-maps.md
2019-09-26-website-archive.md   2019-10-01-trick-or-treat.md
2019-09-28-requests-counter.md  2019-10-02-simple-animation.md
2019-09-28-ruby-map.md          2019-10-04-monkey-patch.md
2019-09-29-restore-pwd.md
=> nil

irb> head 'https://sergioro.mx'
---
date: Sat, 05 Oct 2019 03:14:43 GMT
server: Apache
last-modified: Thu, 03 Oct 2019 04:39:42 GMT
etag: '"ddf-593fa2c976b59"'
accept-ranges: bytes
content-length: '3551'
content-type: text/html; charset=UTF-8
=> nil

irb> f=File.open('test.txt')
=> #<File:test.txt>
irb> f.rr
=> "123\ntesting\n"
irb> f.rr
=> "123\ntesting\n"

That’s awesome, and one more reason to love Ruby.