Skip to content

Commit

Permalink
Set version to 2023.11.09-407
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Nov 8, 2023
1 parent c8f70f1 commit b16e584
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 2023.11.09-407

- Fix deprecation warning


## Version 2023.10.15-405

- Add performance improvement on `word?` predicate (x3 aprox)
Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(:require [clojure.tools.build.api :as b]))

(def lib 'funcool/cuerdas)
(def version (format "2023.10.15-%s" (b/git-count-revs nil)))
(def version (format "2023.11.09-%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))
Expand Down
10 changes: 3 additions & 7 deletions doc/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ aljibe de madera.
Add the following dependency to your project.clj file:

```clojure
funcool/cuerdas {:mvn/version "2023.10.15-405"}
funcool/cuerdas {:mvn/version "2023.11.09-407"}
```

## Quick start
Expand Down Expand Up @@ -64,26 +64,22 @@ cljs.user=> (str/collapse-whitespace " foo bar ")
**NOTE**: this section expalins only a limited set of functions, for
complete overview look at the namespace functions reference.

### <<-
### unindent

Unindent lines. Either strip preceding whitespace automatically or
with a user supplied regex.

```clojure
(str/<<- "first line
(str/unindent "first line
second line (indented)
another line")
```

yields the string

```clojure
first line

second line (indented)

another line
```

Expand Down
17 changes: 9 additions & 8 deletions src/cuerdas/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -899,14 +899,15 @@
DEPRECTED: replaced by `uninindent`"
{:deprecated true}
([s]
(let [all-indents (->> (rest (lines s)) ;; ignore the first line
(remove blank?)
(c/concat [(last (lines s))]) ;; in case all lines are indented
(map #(->> % (re-find #"^( +)") second count)))
min-indent (re-pattern (format "^ {%s}"
(apply min all-indents)))]
(<<- min-indent s)))
([r s] (->> s lines (map #(replace % r "")) unlines)))
(let [re (->> (rest (lines s)) ;; ignore the first line
(remove blank?)
(c/concat [(last (lines s))]) ;; in case all lines are indented
(map #(->> % (re-find #"^( +)") second count))
(apply min)
(format "^ {%s}")
(re-pattern))]
(->> s lines (map #(replace % re "")) unlines)))
([re s] (->> s lines (map #(replace % re "")) unlines)))

;; --- String Interpolation

Expand Down

0 comments on commit b16e584

Please sign in to comment.