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

Added fallback if cognitect.rebl is not found #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaidetree
Copy link

@jaidetree jaidetree commented Dec 13, 2018

Features

  • Setup middleware to just forward requests to next handler if cognitect.rebl could be imported
  • Warns user cognitect.rebl could not be found WARNING: cognitect.rebl namespace was not found on classpath. nrebl.middlware could not be started.

Testing

  1. Create a test directory like test/deps-repl-test

  2. Create a deps.edn file in test/deps-repl-test

    {:aliases {:nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.4.5"}}}
               :rebl {:extra-deps {org.clojure/clojure {:mvn/version "1.10.0-RC5"}
                                   rickmoynihan/rebl.middleware {:local/root "../.."}
                                   org.clojure/core.async {:mvn/version "0.4.490"}}}}}
                                   ; com.cognitect/rebl {:local/root "../../resources/REBL-0.9.109.jar"}}}
  3. Run clj -A:nrepl:rebl -m nrepl.cmdline --middleware '[nrebl.middleware/wrap-nrebl]' --interactive

If you leave the rebl dep in deps.edn commented out, it fails safely.

If you uncomment the rebl dep line and run the repl again it should work as expected.

Alternatively you could run git fetch test-configs && git checkout test-configs test to use preset deps and lein test configurations. See https://github.com/jayzawrotny/nrebl.middleware/tree/test-configs.

Merging

You can see all these pull requests merged together in https://github.com/jayzawrotny/nrebl.middleware/blob/develop/src/nrebl/middleware.clj

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