Managing warnings emitted by Ruby 2.7

Ruby 2.7 is released on Christmas 2019.If you don't know what Ruby 2.7 offers, I have you covered.I tried running codetriage on Ruby 2.7. When I run rails c it prints tons of warnings about various deprecations./Users/prathamesh/.rbenv/versions/2.7.0-rc2/lib/…

Understanding how Ruby initializes objects

Deep buried in Rails source code, there is a code snippet:class DeprecationProxy def self.new(*args, &block) object = args.first return object unless object super end ... end It was added 9 years ago and the commit message said:Override new on proxy objects so that they never wrap…

Installing eventmachine gem on El Capitan

I keep forgetting how to install eventmachine on El Capitan Mac OS X.So adding this post to lookup when required.$ gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/include More details can be found here and here…

Setting up Ruby development setup with rbenv

I wanted to setup ruby source code on my machine. The source on Github has detailed instructions on how to do the setup.git clone github.com/ruby/ruby cd ruby autoconf ./configure make make install worked correctly on Mac OS X and Ruby was installed in usr/local/bin.…

Weirdness of Bigdecimal.new

Recently i was bitten by this weirdness of BigDecimal in Ruby.BigDecimal.new excepts initial value and number of significant digits. In one of my app, BigDecimal.new was called with string initial value without precision. Everything was working great and suddenly something changed. And this error started coming.can't…

Enable minitest again

If you have skipped minitest/test-unit while creating a rails app with -T or want to move to minitest from rspec or want to start with minitest in an existing rails project without tests, its very easy.Just include require "rails/test_unit/railtie" in config/application.rb.After this…