Commits

Alvaro Videla committed be8e6c2

starts using claude lib

  • Participants
  • Parent commits 3f92f72

Comments (0)

Files changed (4)

                  [clojurewerkz/support "0.7.0-beta2"]
                  [com.novemberain/monger "1.1.2"]
                  [com.novemberain/langohr "1.0.0-beta4"]
+                 [claude "0.1.0-SNAPSHOT"]
                  ]
   :plugins [[lein-swank "1.4.4"]]
   :main resizer.core)

File src/resizer/cfenv.clj

-(ns resizer.cfenv
-  (:use [clojure.data.json :only [read-json]]))
-
-(defn cloudfoundry? []
-  (not (nil? (System/getenv "VCAP_SERVICES"))))
-
-(defn service-config [label key]
-  (if-let [services (System/getenv "VCAP_SERVICES")]
-    (let [services-dict (read-json services false)]
-      (-> services-dict
-          (get label)
-          first ;; maybe in the future allow to use multiple services
-          (get "credentials")
-          (get key)))))
-
-(defn mongo-config [key]
-  (service-config "mongodb-2.0" key))
-
-(defn rabbit-config [key]
-  (service-config "rabbitmq-2.4" key))
-
-(defn redis-config [key]
-  (service-config "redis-2.2" key))
-
-(defn mongo-url []
-  (mongo-config "url"))
-
-(defn rabbit-url []
-  (rabbit-config "url"))

File src/resizer/consumer.clj

         [langohr.consumers :as lhcons]
         [langohr.queue :as lhq]
         [langohr.basic :as lhb]
-        [resizer.cfenv :as cf]
+        [claude.core :as cf]
         [resizer.resizer :as rz]))
 
 (defn rabbitmq-connect []

File src/resizer/resizer.clj

             [monger.core :as mg]
             [monger.gridfs :as gfs])
   (:use [monger.gridfs :only [store-file make-input-file filename content-type metadata]]
-        [resizer.cfenv :as cf])
+        [claude.core :as cf])
   (:import [java.awt.image BufferedImage]
            [java.io ByteArrayOutputStream]
            [javax.imageio ImageIO]))