Fork me on GitHub
#gorilla
<
2019-12-31
>
onetom03:12:21

is there an example of using gorilla with clojure cli tools? (quick googling hasn't yielded any useful results)

onetom04:12:25

I've looked into what does the lein-gorilla plugin do, but when I try to replicate it in a tools deps project I get the following error:

$ clj -Srepro -Sdeps '{org.clojure/clojure {:mvn/version "1.10.1"} org.clojars.benfb/gorilla-repl {:mvn/version "0.5.2"}}' -e "(use 'gorilla-repl.core)"
Execution error (FileNotFoundException) at user/eval1 (REPL:1).
Could not locate gorilla_repl/core__init.class, gorilla_repl/core.clj or gorilla_repl/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

onetom04:12:33

and the error is the same regardless of the gorilla version (0.5.0, 0.5.1, 0.6.0)

onetom05:12:58

0.6.0 works in a fresh lein project 😕

[email protected] gorilla % lein new gorilla-test
Generating a project called gorilla-test based on the 'default' template.
The default template is intended for library projects, not applications.
To see other templates (app, plugin, etc), try `lein help new`.

[email protected] gorilla % cd gorilla-test
[email protected] gorilla-test % lein change :dependencies conj '[org.clojars.benfb/gorilla-repl "0.6.0"]'

[email protected] gorilla-test % echo "(use 'gorilla-repl.core) (run-gorilla-server {})" | lein repl
nREPL server started on port 64158 on host 127.0.0.1 - 
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 1.8.0_222-b10
...
gorilla-test.core=> (use 'gorilla-repl.core) (run-gorilla-server {})
nil
Gorilla-REPL: develop
Unable to reach update server.
Started nREPL server on port 64167
Running at  .
Ctrl+C to exit.
nil
gorilla-test.core=> Bye for now!

onetom05:12:55

ok, my deps specification was incorrect. this works:

% clj -Srepro -Sdeps '{:deps {org.clojars.benfb/gorilla-repl {:mvn/version "0.6.0"}}}' -e "(use 'gorilla-repl.core) (run-gorilla-server {})"
Gorilla-REPL: develop
Unable to reach update server.
Started nREPL server on port 50946
Running at  .
Ctrl+C to exit.

onetom05:12:04

now, it just giving that namespace error in cursive, but i will read up on that in the docs first.

onetom05:12:45

also, via a nix-shell:

nix-shell -p clojure --run "clj -Srepro -Sdeps '{:deps {org.clojars.benfb/gorilla-repl {:mvn/version \"0.6.0\"}}}' -e \"(use 'gorilla-repl.core) (run-gorilla-server {})\""