diff options
author | Ben Smith-Mannschott <bsmith.occs@gmail.com> | 2010-08-28 11:22:22 +0200 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2010-09-03 12:23:37 -0400 |
commit | fe4ed311166677cd571d23774171af1d830f7fc5 (patch) | |
tree | 70d6c519b8afa7bbee51bb8c3e243d4f3903b2e2 /modules/gen-html-docs | |
parent | 034d3d1703d139117b38fe6a10f552e23aa48b5c (diff) |
remove deprecated clojure.contrib.string
Since clojure.contrib.string is used by other submodules, some changes
were required:
- gen-html-docs and prxml needed changes because of functions were
renamed or arguments reordered when promoted to clojure.string.
- jmx, json, miglayout, prxml and sql gained a private one-argument
implementation of as-str.
- repl-utils gained a private copy of c.c.string/partition, named
spartition.
- repl-utils replaced a call to c.c.string/substring? with a call to
the java String method '.contains' (with swapped argument order).
Signed-off-by: Stuart Sierra <mail@stuartsierra.com>
Diffstat (limited to 'modules/gen-html-docs')
-rw-r--r-- | modules/gen-html-docs/pom.xml | 5 | ||||
-rw-r--r-- | modules/gen-html-docs/src/main/clojure/clojure/contrib/gen_html_docs.clj | 16 |
2 files changed, 6 insertions, 15 deletions
diff --git a/modules/gen-html-docs/pom.xml b/modules/gen-html-docs/pom.xml index c04d6e84..80cc2cd5 100644 --- a/modules/gen-html-docs/pom.xml +++ b/modules/gen-html-docs/pom.xml @@ -14,11 +14,6 @@ <dependencies> <dependency> <groupId>org.clojure.contrib</groupId> - <artifactId>string</artifactId> - <version>1.3.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.clojure.contrib</groupId> <artifactId>repl-utils</artifactId> <version>1.3.0-SNAPSHOT</version> </dependency> diff --git a/modules/gen-html-docs/src/main/clojure/clojure/contrib/gen_html_docs.clj b/modules/gen-html-docs/src/main/clojure/clojure/contrib/gen_html_docs.clj index 5046c163..145c040b 100644 --- a/modules/gen-html-docs/src/main/clojure/clojure/contrib/gen_html_docs.clj +++ b/modules/gen-html-docs/src/main/clojure/clojure/contrib/gen_html_docs.clj @@ -46,7 +46,7 @@ :doc "Generates a single HTML page that contains the documentation for one or more Clojure libraries."} clojure.contrib.gen-html-docs - (:require [clojure.contrib.string :as s]) + (:require [clojure.string :as s]) (:use [clojure.contrib repl-utils def prxml]) (:import [java.lang Exception] [java.util.regex Pattern])) @@ -226,7 +226,7 @@ function toggle(targetid, linkid, textWhenOpen, textWhenClosed) (if (= 0 (count l)) [:span {:class "library-member-doc-whitespace"} " "] ; We need something here to make the blank line show up l)]) - (s/split #"\n" docs)) + (s/split docs #"\n")) "")) (defn- member-type @@ -270,7 +270,7 @@ function toggle(targetid, linkid, textWhenOpen, textWhenClosed) (defn- elide-to-one-line "Elides a string down to one line." [s] - (s/replace-re #"(\n.*)+" "..." s)) + (s/replace s #"(\n.*)+" "...")) (defn- elide-string "Returns a string that is at most the first limit characters of s" @@ -282,13 +282,9 @@ function toggle(targetid, linkid, textWhenOpen, textWhenClosed) (defn- doc-elided-src "Returns the src with the docs elided." [docs src] - (s/replace-re (re-pattern (str "\"" (Pattern/quote docs) "\"")) - (str "\"" - (elide-to-one-line docs) -;; (elide-string docs 10) -;; "..." - "\"") - src)) + (s/replace src + (re-pattern (str "\"" (Pattern/quote docs) "\"")) + (str "\"" (elide-to-one-line docs) "\""))) (defn- format-source [libid memberid v] (try |