gorilla

onetom 2019-12-31T03:56:21.000800Z

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

onetom 2019-12-31T04:51:25.002400Z

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.

onetom 2019-12-31T04:52:33.003100Z

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

onetom 2019-12-31T05:23:58.004500Z

0.6.0 works in a fresh lein project 😕

onetom@lynx 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`.

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

onetom@lynx gorilla-test % echo "(use 'gorilla-repl.core) (run-gorilla-server {})" | lein repl
nREPL server started on port 64158 on host 127.0.0.1 - <nrepl://127.0.0.1:64158>
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=&gt; (use 'gorilla-repl.core) (run-gorilla-server {})
nil
Gorilla-REPL: develop
Unable to reach update server.
Started nREPL server on port 64167
Running at <http://127.0.0.1:64169/worksheet.html> .
Ctrl+C to exit.
nil
gorilla-test.core=&gt; Bye for now!

onetom 2019-12-31T05:46:55.005Z

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 <http://127.0.0.1:50948/worksheet.html> .
Ctrl+C to exit.

onetom 2019-12-31T05:49:04.005900Z

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

onetom 2019-12-31T05:51:45.006200Z

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 {})\""