Jay Fields discusses
the 'stack level too deep' problem with alias_method and alias_method_chain if a file gets loaded
twice (which is not uncommon in a large enough project). This is an attempt to workaround it.
bundle install
bundle exec ruby runner.rb
You can see the simple check for instance_methods.include? on the alias_method_chain for
execute prevents the chaining from happening multiple times which causes the stack level
too deep.
private and protected methods won't show in
instance_methods... so ... may need to use those variants.