Skip to content

Commit be9290a

Browse files
committed
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.
1 parent d424ec7 commit be9290a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/web_console/extensions.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module Kernel
2+
module_function
3+
24
# Instructs Web Console to render a console in the specified binding.
35
#
46
# If +bidning+ isn't explicitly given it will default to the binding of the

0 commit comments

Comments
 (0)