Giter VIP home page Giter VIP logo

bultitude's Introduction

Hi there 👋

bultitude's People

Contributors

anttipoi avatar borkdude avatar cldwalker avatar danielcompton avatar davidegrayson avatar hugoduncan avatar juergenhoetzel avatar laurentpetit avatar raynes avatar ryantm avatar sfnelson avatar technomancy avatar timofreiberg avatar tobias avatar wiseman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

bultitude's Issues

(in-ns ...) forms are ignored

Files starting with (in-ns ...) instead of (ns ...) are not found since the in-ns form is ignored.
Since in-ns can create namespaces, bultitude should return those forms as well.

Created in response to #3

Broken with Java 11

Using bultitude on Java 11 gives back nothing when looking for namespaces on the classpath. Tried to look into it, but my java chops are a bit too weak to even know where to begin as RT/baseLoader is what is used as loader for dynapath.

user => (require '[bultitude.core :as b])
nil
user => (take 10 (b/namespaces-on-classpath))
()

Return all namespaces created in a file instead of the first one

Creating multiple namespaces in one file is unidiomatic, but I'd like to support it properly anyway.

Naively reading the entire file and returning all ns and in-ns forms is a bad idea because reading namespace aliased keywords without having evaluated the namespace aliases will crash (see the bug described here: #3).

The current plan is to build on the good work from the kibit project and use https://github.com/TimoFreiberg/total-reader to read the entire file.

`:prefix` argument behaves differently for directories and JARs

The optional :prefix argument filters entries that don't start with the given prefix.
bultitude searches both JAR files and directories in the classpath though, and the two implementations handle the prefix differently.

Directory
For directories, :prefix is used as the full name of a subdirectory. If such a subdirectory doesn't exist, nothing will be found.

JAR file
For JAR files, :prefix is used to filter namespaces whose name starts with the given prefix. The docstring also describes this behaviour.

Examples:

;; JAR
(def jar-path (io/file "/home/timo/.m2/repository/org/clojure/tools.reader/1.3.0-alpha3/tools.reader-1.3.0-alpha3.jar"))
(file->namespaces nil jar-path)
;; => (cljs.tools.reader.reader-types clojure.tools.reader clojure.tools.reader.edn  ...)
(file->namespaces "clj" jar-path)
;; => (cljs.tools.reader.reader-types)
(file->namespaces "cljs.tools.re" jar-path)
;; => (cljs.tools.reader.reader-types)

;; Directory
(def dir-path (io/file "/home/timo/projects/clj/bultitude/src"))
(file->namespaces nil dir-path)
;; => (bultitude.core bulti-tude.cond)
(file->namespaces "bult" dir-path)
;; => ()
(file->namespaces "bultitude" dir-path)
;; => (bultitude.core)

I think the prefix argument should be changed to match substrings for directories as well.

Find out why tests on Clojure <= 1.6 didn't run

The test-all target didn't work for Clojure 1.6 and all older versions
It failed with a
java.io.FileNotFoundException: Could not locate bulti_tude/cond__init.class or bulti_tude/cond.clj on classpath:
See https://travis-ci.org/TimoFreiberg/bultitude/builds/406565601

This worked three years ago: https://travis-ci.org/Raynes/bultitude/builds/71455962
The only thing that changed was the lein version (the exact travis script didn't even work, I changed it in 9974c0b)

I assume that something changed in leiningen which caused test/bulti_tude/cond.cljc to not be added to the classpath for older Clojure versions.
I added src/bulti_tude/cond.clj and this fixed the issue.

Since I barely understand how this library works, I'm not sure whether this is a sensible fix.
Can someone help me out? Maybe @technomancy?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.