Implement reload-all by regex #14
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First try to implement reload-all by regex as described in #10
Per requirements on the issue this PR :
The main thing here is
clj-reload/reload-all
. As mentioned in the docstring it will only reload already loaded namespaces that have at least one var. The one var limitation is because I don't know any other way of getting the files to all namespaces, but I also think this is not an important limitation since reloading a namespace with no vars isn't probably useful.There are a couple of small changes to the existing code like :
clj-reload.core/ns-load
work on resources urls as well as files.clj-reload.parse/read-file
try catch on the implementation signature, so both sigs are coveredclj-reload.util/ns-load-file
require only a file-name instead of a ^File objectI don't expect this to be merged as is but we have something to start with.