Skip to content

Rework REPL and REPLSession#94

Merged
gsamokovarov merged 3 commits intorails:masterfrom
gsamokovarov:slim-down-repl-session
Jan 2, 2015
Merged

Rework REPL and REPLSession#94
gsamokovarov merged 3 commits intorails:masterfrom
gsamokovarov:slim-down-repl-session

Conversation

@gsamokovarov
Copy link
Copy Markdown
Collaborator

REPL and REPLSession doesn't hold that much for the current requirements. They have unused methods in their interfaces and do work we no longer need.

REPLSession doesn't need to be an active model. It has a lot of cruft – methods that used to be used in web-console 0.2 are unused now.

It also has a user facing problem. When a session is no longer available in memory, it is raising an exception that wasn't handled anywhere in the current code. This leaves the console seemingly hanging and raises an exception that can be seen in the server log. We can show a message to the user of the console instead. I have went with this route.

REPL received an overhaul as well. The prompt used to be dynamic, however now its not. We can just let the UI decide what to show and don't care in the server code.

After changing REPL and REPLSession behaviours, I renamed them to fit their intentions better. REPL didn't wrap an external REPL and wasn't one either. It just evaluated code and formatted its output. I think Evaluator fits its purpose better. REPLSession got renamed it to simply Session.

I also added tests along the way for the code evaluation and binding switching behaviour.

Happy new year, folks! 🎆

@gsamokovarov gsamokovarov force-pushed the slim-down-repl-session branch 3 times, most recently from 737f870 to 1d74cc0 Compare December 31, 2014 16:25
It doesn't need to be an active model. A plain PORO can do here. Plus, a
lot of cruft has been removed for both REPL and REPLSession.

Also, rename REPL to better match its intent. A REPL didn't wrap an
external REPL and wasn't one either.  It just evaluated code and
formatted its output. I think Evaluator fits its purpose better.

REPLSession got out of date after the REPL rename also. Renamed it to
simply Session.

As a bonus, I have tried to document them a bit better.
@gsamokovarov gsamokovarov force-pushed the slim-down-repl-session branch from 1d74cc0 to a8abee4 Compare January 1, 2015 15:26
@gsamokovarov gsamokovarov changed the title Abstract REPL and REPLSession away from ActiveModel Rework REPL and REPLSession Jan 1, 2015
gsamokovarov added a commit that referenced this pull request Jan 2, 2015
@gsamokovarov gsamokovarov merged commit d9d1a14 into rails:master Jan 2, 2015
@gsamokovarov gsamokovarov deleted the slim-down-repl-session branch January 27, 2016 11:10
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.

1 participant