Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let #console live in Kernel #182

Merged
merged 1 commit into from
Jan 24, 2016

Conversation

gsamokovarov
Copy link
Collaborator

With this change, we can render a console from any part of a Rails
application, not just in the controllers or the views. Wanna introspect
a model or your plain old Ruby class? No problem!

Hopefully, this change can boost up the usage of the #console helper.

To do this juggling we now persist a binding or an exception in a fiber
local variable. The middleware can create a console session from those,
when needed. This is a global state, so we take precautions to clean it
between requests, even in multi-threaded environments.

With this change, we can render a console from any part of an Rails
application, not just in the controllers or the views. Wanna introspect
a model or your plain old Ruby class? No problem!

Hopefully, this change can boost up the usage of the `#console` helper.

To do this juggling we now persist a binding or an exception in a fiber
local variable. The middleware can create a console session from those,
when needed. This is a global state, so we take precautions to clean it
between requests, even in multi-threaded environments.
gsamokovarov added a commit that referenced this pull request Jan 24, 2016
@gsamokovarov gsamokovarov merged commit 014f4a4 into rails:master Jan 24, 2016
@gsamokovarov gsamokovarov deleted the console-in-kernel branch January 24, 2016 16:07
@sh19910711
Copy link

Wanna introspect a model or your plain old Ruby class? No problem!

Like it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants