Skip to content

Commit

Permalink
Better docstring for \*traditional\* and other fixes
Browse files Browse the repository at this point in the history
Fixes #74
  • Loading branch information
hlship committed May 16, 2021
1 parent 304dfb9 commit dd1dedd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/lein-plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ of your :file:`project.clj`.
.. code-block:: clojure
(defproject ...
:plugins [[io.aviso/pretty "X.Y.Z"]]
:plugins [[io.aviso/pretty "1.0"]]
:middleware [io.aviso.lein-pretty/inject]
:dependencies [...
[io.aviso/pretty "X.Y.Z"]]
[io.aviso/pretty "1.0"]]
...)
Adjust the version number for the current version, "|release|".
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.10.3"]
[org.clojure/tools.logging "1.1.0" :optional true]]
:plugins [[lein-codox "0.10.4"]]
:plugins [[lein-codox "0.10.7"]]
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:dev {:dependencies [[criterium "0.4.6"]
Expand Down
2 changes: 1 addition & 1 deletion src/io/aviso/binary.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Allows various data sources to be treated as a byte-array data type that
supports a length and random access to individual bytes.
BinaryData is extended onto byte arrays, onto `String`, and onto nil."
BinaryData is extended onto byte arrays, java.nio.ByteBuffer, java.lang.String, java.lang.StringBuilder, and onto nil."

(data-length [this] "The total number of bytes available.")
(byte-at [this index] "The byte value at a specific offset."))
Expand Down
9 changes: 5 additions & 4 deletions src/io/aviso/exception.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@
(def ^{:dynamic true
:added "0.1.15"}
*traditional*
"If bound to true, then exceptions will be formatted the traditional way (the only option prior to 0.1.15)."
"If bound to true, then exceptions will be formatted the traditional way - the same as Java exceptions
with the deepest stack frame first. By default, the stack trace is inverted, so that the deepest
stack frames come last, mimicking chronological order."
false)

(defn ^:private length [^String s] (.length s))

(defn ^:private strip-prefix
[^String prefix ^String input]
(let [prefix-len (.length prefix)]
(if (and (.startsWith input prefix)
(if (and (str/starts-with? input prefix)
(< prefix-len (.length input)))
(.substring input prefix-len)
(subs input prefix-len)
input)))

(def ^:private current-dir-prefix
Expand All @@ -67,7 +69,6 @@
(sort-by #(-> % first length))
reverse))


(defn ^:private match-mangled
[^String s i]
(->> clojure->java
Expand Down

0 comments on commit dd1dedd

Please sign in to comment.