crystal-community / icr

Interactive console for Crystal programming language
MIT License
505 stars 40 forks source link

Persistent side effects with Dir, File and FileUtils #91

Closed crabonature closed 6 years ago

crabonature commented 6 years ago

PR for #90.

jwoertink commented 6 years ago

Hey! thanks for submitting the PR. I'll take a look over this. One thing I am wondering just off the top of my head, when you check the with_persistent_side_effect, I'm wondering if any File operation would also fall in to this.

crabonature commented 6 years ago

So I checked File and FileUtils and this ones will be falling into this too:

File.delete(), File.link(), File.rename(), File.symlink()
FileUtils.mkdir(), FileUtils.mkdir_p(), FileUtils.mv(),
FileUtils.rm, FileUtils.rm_r(), FileUtils.rm_rf(), FileUtils.rmdir()
veelenga commented 6 years ago

@jwoertink @crabonature I don't think this is the right approach to handle it. We already added it to the list of side effects. Unfortunately, this is the best we can do here unless ICR becomes a real REPL #79

veelenga commented 6 years ago

Closing it. Please do not hesitate to continue the discussion if you have something to say. Thank you.