Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
Use clojure.string instead of clojure.contrib.str-utils2
Browse files Browse the repository at this point in the history
Additionally drop the clojure.contrib dependency.
  • Loading branch information
jstepien committed Oct 7, 2011
1 parent f5850a6 commit c1f9e3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
1 change: 0 additions & 1 deletion project.clj
@@ -1,7 +1,6 @@
(defproject clodoc "0.0.1-SNAPSHOT"
:description "The description"
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/clojure-contrib "1.2.0"]
[compojure "0.6.5"]
[hiccup "0.3.6"]
[ring/ring-servlet "0.3.11"]
Expand Down
4 changes: 1 addition & 3 deletions src/clodoc/core.clj
Expand Up @@ -4,13 +4,11 @@
[ring.util.codec :only [url-encode]]
[hiccup.core :only [html escape-html]]
hiccup.page-helpers
[clojure.contrib.repl-utils :only [get-source]]
clodoc.common)
(:require [compojure.route :as route]
[compojure.handler :as handler]
clojure.pprint
[clojure.string :as string]
[clojure.contrib.str-utils2 :as str2]
[hiccup.form-helpers :as form]
[clodoc.cache :as cache]
[clodoc.persistent :as persistent]
Expand Down Expand Up @@ -188,7 +186,7 @@
(reduce
(fn [hash ns]
(try
(let [vars (filter #(str2/contains? (str %) x)
(let [vars (filter #(.contains (str %) x)
(persistent/get! (str "ns:" ns)))]
(if (empty? vars)
hash
Expand Down
23 changes: 11 additions & 12 deletions src/clodoc/jars_handler.clj
@@ -1,6 +1,5 @@
(ns clodoc.jars-handler
(:require [clojure.xml :as xml]
[clojure.contrib.str-utils2 :as str2]
[clojure.string :as string]
[clojure-http.resourcefully :as res]
[clodoc.persistent :as persistent]
Expand All @@ -15,16 +14,16 @@

(defn get-url-for
[name]
(let [pkg (str2/replace name #".*/" "")
path (str2/replace name \. \/)
(let [pkg (string/replace name #".*/" "")
path (string/replace name \. \/)
main-url (str "http://clojars.org/repo/" path "/")
pkg-meta (parse-xml-str (get-body (str main-url "maven-metadata.xml")))
versions (:content (first (:content (first
(filter #(= (:tag %) :versioning)
(:content pkg-meta))))))
newest-version (last
(filter
#(not (str2/contains? % "SNAPSHOT"))
#(not (.contains ^String % "SNAPSHOT"))
(map #(first (:content %)) versions)))
jar-url (str main-url newest-version "/" pkg "-" newest-version ".jar")]
jar-url))
Expand Down Expand Up @@ -56,14 +55,14 @@

(defn doc-string
[def]
(str2/join "\n"
(map str2/trim
(str2/split-lines
(or
(:doc (meta (second def)))
(let [doc (second (rest def))]
(and (string? doc) doc))
"")))))
(string/join "\n"
(map string/trim
(string/split-lines
(or
(:doc (meta (second def)))
(let [doc (second (rest def))]
(and (string? doc) doc))
"")))))

(defn log [& msg]
(println (.format (java.text.DateFormat/getDateTimeInstance)
Expand Down

0 comments on commit c1f9e3a

Please sign in to comment.