Skip to main content

Featured

Ruby Tips - How to figure out where a method is defined

The other day when I was dabbling with the huge codebase, I was wondering where a particular method was being declared for a specific method. I wanted to know this because my greps didn't turn out to volatile and didn't return any results



The Solution The Ruby interpreter has certain methods that can be used for identifying under which module or class, the particular method is being defined. See the example below.

So using the .source_location you will be able to figure which file it has been declared.

Uninstall docker and rerun docker on ubuntu 16.04

If you copy paste the following lines into the terminal of your ubuntu, it will automatically uninstall docker and reinstall it for you. This is clean sweep of your docker setting files. This is very handy when docker has gone beserk and you want to clean it up.

sudo service docker stop && sudo apt-get purge -y docker-engine && sudo apt-get autoremove — purge -y docker-engine && sudo rm -rf /var/lib/docker && sudo apt-get update && sudo apt-get install -y docker-engine && sudo service docker start && sudo docker run hello-world && sudo usermod -aG docker $USER

 Source: https://gist.github.com/gten/2eac49482def3fad647b66521b77593e


Thanks for your support and appreciation.

You can also follow me at Twitter, Facebook, LinkedIn and Website.

Comments

Alexander said…
Found useful

Popular Posts

You will receive wonderful short stories written by him and inspirational articles once every month.