Skip to content

Commit

Permalink
Bump dependencies to use built-in JSON.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnewman committed May 14, 2010
1 parent 20e2483 commit bc8de84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .clojure
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
src:/opt/clojure/clojure.jar:/opt/clojure-contrib/clojure-contrib.jar:lib/apache-mime4j-0.6.jar:lib/clj-apache-http.jar:lib/clojure-json.jar:lib/commons-codec-1.3.jar:lib/commons-logging-1.1.1.jar:lib/httpclient-4.0.1.jar:lib/httpcore-4.0.1.jar:lib/httpmime-4.0.1.jar src:lib/apache-mime4j-0.6.jar:lib/clj-apache-http-2.1.0.jar:lib/clojure-1.2.0-master-20100507.230258-69.jar:lib/clojure-contrib-1.2.0-20100507.230536-107.jar:lib/commons-codec-1.3.jar:lib/commons-logging-1.1.1.jar:lib/httpclient-4.0.1.jar:lib/httpcore-4.0.1.jar:lib/httpmime-4.0.1.jar
6 changes: 2 additions & 4 deletions project.clj
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,7 @@
(defproject com.twinql.clojure/mql (defproject com.twinql.clojure/mql
"1.0.6" "1.0.7"
:description "Freebase MQL client library." :description "Freebase MQL client library."
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"] :dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"] [org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]
[org.danlarkin/clojure-json "1.1-SNAPSHOT"] [com.twinql.clojure/clj-apache-http "2.1.0"]])
; [org.clojars.rnewman/clojure-json "1.2.2-SNAPSHOT-clojure120"]
[com.twinql.clojure/clj-apache-http "2.0.2"]])


14 changes: 4 additions & 10 deletions src/com/twinql/clojure/mql.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
(org.apache.http.client CookieStore) (org.apache.http.client CookieStore)
(org.apache.http.impl.client AbstractHttpClient)) (org.apache.http.impl.client AbstractHttpClient))
(:require (:require
[com.twinql.clojure.http :as http] [clojure.contrib.json :as json]
[org.danlarkin.json :as json])) [com.twinql.clojure.http :as http]))


;;; ;;;
;;; API URIs. ;;; API URIs.
Expand Down Expand Up @@ -50,12 +50,6 @@
;;; This is bound by with-login. ;;; This is bound by with-login.
(def *cookie-store* nil) (def *cookie-store* nil)


;;; It's very convenient to always receive bodies as parsed JSON.

(defmethod http/entity-as :json
[entity as status]
(json/decode-from-reader (http/entity-as entity :reader status)))

;;; ;;;
;;; Generic utilities. ;;; Generic utilities.
;;; ;;;
Expand Down Expand Up @@ -271,7 +265,7 @@
[code content] [code content]
;; Have to do this every time so we can rewrite the ;; Have to do this every time so we can rewrite the
;; cursor part. ;; cursor part.
(let [query (alter-map-by q json/encode-to-str)] (let [query (alter-map-by q json/json-str)]
(http/get *mql-read* (http/get *mql-read*
:headers headers :headers headers
:parameters parameters :parameters parameters
Expand Down Expand Up @@ -351,7 +345,7 @@
http-options]} (apply hash-map args) http-options]} (apply hash-map args)


query (non-nil-values query (non-nil-values
{"q" (json/encode-to-str query) {"q" (json/json-str query)
"limit" limit "limit" limit
"start" start "start" start
"jsonp" jsonp})] "jsonp" jsonp})]
Expand Down

0 comments on commit bc8de84

Please sign in to comment.