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

Add reload! to lotus console #46

Merged
merged 1 commit into from Jul 11, 2014
Merged

Add reload! to lotus console #46

merged 1 commit into from Jul 11, 2014

Conversation

davidcelis
Copy link
Contributor

This patch adds a reload! method during lotus console sessions, much
like what is available during a rails console session. reload! will
simply call Kernel.exec $0 to re-execute the running process after
outputting a message that it is doing so.

Signed-off-by: David Celis me@davidcel.is

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 33f023e on davidcelis:reload into 18786b3 on lotus:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 7a05638 on davidcelis:reload into 18786b3 on lotus:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 33f023e on davidcelis:reload into 18786b3 on lotus:master.

opts[:applications] = 'test/fixtures/microservices/config/applications'
console.stub(:engine, @engine) { console.start }

@main.verify
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also @engine.verify

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right!

@jodosha
Copy link
Member

jodosha commented Jul 10, 2014

@davidcelis Thanks for this PR. Because we don't have a proper web reloading process (see #24 ), I'm wondering how this works, and if it does, do you think it may be a viable solution for the other features?

EDIT: I'm not wondering how this works w/ Ruby, but if this simple trick resolves all the complexity of Lotus.. ✨ 💯 ✨

@davidcelis
Copy link
Contributor Author

I think that Rack::Reloader is still gonna be the best bet for reloading the web app as code changes in development, since Kernel.exec will totally replace the process. If I change code and try to quickly make a request, I think that it would just get lost

This patch adds a `reload!` method during `lotus console` sessions, much
like what is available during a `rails console` session. `reload!` will
simply call `Kernel.exec $0` to re-execute the running process after
outputting a message that it is doing so.

Signed-off-by: David Celis <me@davidcel.is>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 380ac3d on davidcelis:reload into 18786b3 on lotus:master.

@jodosha
Copy link
Member

jodosha commented Jul 11, 2014

@davidcelis Alright, merging this for now. Thanks!

jodosha added a commit that referenced this pull request Jul 11, 2014
Add `reload!` to `lotus console`
@jodosha jodosha merged commit 3bd5f24 into hanami:master Jul 11, 2014
@davidcelis davidcelis deleted the reload branch July 11, 2014 15:07
@jodosha jodosha added this to the v0.2.0 milestone Oct 6, 2016
@jodosha jodosha self-assigned this Oct 6, 2016
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.

None yet

3 participants