diff --git a/src/babashka/impl/classpath.clj b/src/babashka/impl/classpath.clj index 7d76d912..0ae76217 100644 --- a/src/babashka/impl/classpath.clj +++ b/src/babashka/impl/classpath.clj @@ -13,7 +13,7 @@ (deftype DirectoryResolver [path] IResourceResolver - (getResource [this resource-paths {:keys [:url?]}] + (getResource [_ resource-paths {:keys [:url?]}] (some (fn [resource-path] (let [f (io/file path resource-path)] @@ -40,7 +40,7 @@ (deftype JarFileResolver [jar-file] IResourceResolver - (getResource [this resource-paths opts] + (getResource [_ resource-paths opts] (path-from-jar jar-file resource-paths opts))) (defn part->entry [part] @@ -50,9 +50,9 @@ (deftype Loader [entries] IResourceResolver - (getResource [this resource-paths opts] + (getResource [_ resource-paths opts] (some #(getResource % resource-paths opts) entries)) - (getResources [this resource-paths opts] + (getResources [_ resource-paths opts] (keep #(getResource % resource-paths opts) entries))) (defn loader [^String classpath] diff --git a/src/babashka/main.clj b/src/babashka/main.clj index b1c71bb0..5d861ff8 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -365,7 +365,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that :cp new-cp}))) nil) -(defn classpath [] +(defn get-classpath [] (:cp @cp-state)) ;;(def ^:private server-ns-obj (sci/create-ns 'clojure.core.server nil)) @@ -398,7 +398,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that (repl/start-repl! @common/ctx opts)))} 'clojure.test t/clojure-test-namespace 'babashka.classpath {'add-classpath add-classpath* - 'classpath classpath} + 'get-classpath get-classpath} 'clojure.pprint pprint-namespace 'babashka.curl curl-namespace 'babashka.pods pods/pods-namespace diff --git a/test/babashka/classpath_test.clj b/test/babashka/classpath_test.clj index 00b1bbd1..6aac175a 100644 --- a/test/babashka/classpath_test.clj +++ b/test/babashka/classpath_test.clj @@ -23,10 +23,10 @@ (deftest babashka-classpath-test (is (= "test-resources" (bb nil "--classpath" "test-resources" - "(require '[babashka.classpath :as cp]) (cp/classpath)"))) + "(require '[babashka.classpath :as cp]) (cp/get-classpath)"))) (is (= "test-resources:foobar" (bb nil "--classpath" "test-resources" - "(require '[babashka.classpath :as cp]) (cp/add-classpath \"foobar\") (cp/classpath)")))) + "(require '[babashka.classpath :as cp]) (cp/add-classpath \"foobar\") (cp/get-classpath)")))) (deftest classpath-env-test ;; for this test you have to set `BABASHKA_CLASSPATH` to test-resources/babashka/src_for_classpath_test/env