loading...

Happy Easter from Ruby 2.7.1

philnash profile image Phil Nash ・1 min read

Ruby 2.7.1 was released recently and while it included a couple of security fixes it also brought with it a little bonus.

Discovered on Reddit, there is an Easter egg that has been hidden in Ruby 2.7.1. You can trigger it a couple of ways. If you don't want to know how, stop reading here!

First, open IRB for Ruby version 2.7.1

$ ruby -v 
ruby 2.7.1
$ irb

Then either enter RubyVM and press TAB twice or sneakily send the private method easter_egg to IRB: IRB.send(:easter_egg).

It may not actually be to do with Easter at all, but I couldn't help point it out since it was released so close.

I hope you enjoyed your Easter and had fun with this bit of developer whimsy new to the Ruby codebase.

Posted on by:

philnash profile

Phil Nash

@philnash

Developer evangelist for Twilio and Authy. I write JavaScript and Ruby. Probably listening to ska punk right now. console.log('🍻');

Discussion

markdown guide
 

Another way to run it is ruby -rirb -e 'IRB.send(:easter_egg)'. There are two versions of the easter egg and which one runs seems to be random.

 

Good to know. Thank for this tips

IRB easter egg