How to reload module without relaunch rails console.
Purpose
Because launch rails console
has highly cost, when I was debugging in a class, keeping relaunching console is annoying.
Code
# remove Class Foo
Object.send(:remove_const, :Foo)
# Reload Class Foo
load 'Foo.rb'
Written by small2kuo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#