From be9290a34f335db0090389edeff2781d6529b58f Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Thu, 28 Jan 2016 10:38:42 +0200 Subject: [PATCH] Fix rails console invocation inside a Rails app Railties can hook themselves into the `rails console` with: ```ruby class Railtie < ::Rails::Railtie console do # Do something here. end end ``` Now, since I introduced the `#console` method in `Kernel`, every object responded to it, so this block was tried to be run on railties that respond to it. Marking the `#console` method _explicitly_ as `module_function` solves this problem as it makes it `private` and the `#respond_to?` calls during the railties initialization no longer lie. Fixes #184. --- lib/web_console/extensions.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/web_console/extensions.rb b/lib/web_console/extensions.rb index cb538ee8..21bc54c7 100644 --- a/lib/web_console/extensions.rb +++ b/lib/web_console/extensions.rb @@ -1,4 +1,6 @@ module Kernel + module_function + # Instructs Web Console to render a console in the specified binding. # # If +bidning+ isn't explicitly given it will default to the binding of the