Skip to content
This repository
Browse code

Leiningen dependency management.

  • Loading branch information...
commit 2c378d9b3590b7970803fa17b26ee9a6ccac6a1d 1 parent 93393b4
Mark McGranaghan authored January 16, 2010
22  README.markdown
Source Rendered
@@ -30,21 +30,21 @@ Adding simple middleware:
30 30
 Quick Start
31 31
 -----------
32 32
 
33  
-First clone the Ring source and download Ring's dependencies:
  33
+First, pull in Ring's dependencies using [Leiningen](http://github.com/technomancy/leiningen):
34 34
 
35  
-    git clone git://github.com/mmcgrana/ring.git
36  
-    cd ring  
37  
-    ant deps
  35
+    $ lein deps
38 36
 
39 37
 To see a live "Hello World" Ring app, run:
40 38
 
41  
-    java -Djava.ext.dirs=deps clojure.main src/ring/example/hello_world.clj
  39
+    $ clj src/ring/example/hello_world.clj
42 40
 
43 41
 Now visit `http://localhost:8080/` in your browser; the Ring app will respond to your request with a simple HTML page indicating the time of day.
44 42
 
  43
+Note that your `clj` script needs to add the `src` directory and the jars in `lib` to your classpath.
  44
+
45 45
 To see a more sophisticated Ring app, run:
46 46
 
47  
-    java -Djava.ext.dirs=deps clojure.main src/ring/example/wrapping.clj
  47
+    $ clj src/ring/example/wrapping.clj
48 48
 
49 49
 * If you request `http://localhost:8080/` in your browser the `ring.handler.dump` handler will respond with an HTML page representing the request map that it received (see the `SPEC` for details on the request map).
50 50
 * If you request `http://localhost:8080/clojure.png`, the `ring.middleware.file` middleware will detect that there is a `clojure.png` file in the app's `public` directory and return that image as a response.
@@ -72,15 +72,7 @@ Ring is being actively developed; you can track its progress and contribute at t
72 72
 
73 73
 To run all the Ring unit tests:
74 74
   
75  
-    java -Djava.ext.dirs=deps clojure.main test/ring/run.clj
76  
-
77  
-You can learn more about Ring's dependencies at the following sites:
78  
-
79  
-* `clojure.jar`, `clojure-contrib.jar`: [clojure.org](http://clojure.org)
80  
-* `jetty-6.1.14.jar`, `jetty-util-6.1.14.jar`, `servlet-api-2.5-6.1.14.jar`: [mortbay.org/jetty](http://www.mortbay.org/jetty)
81  
-* `httpcore-4.0.jar`, `httpcore-nio-4.0.jar`: [hc.apache.org](http://hc.apache.org/httpcomponents-core/index.html)
82  
-* `commons-io-1.4.jar`: [commons.apache.org/io](http://commons.apache.org/io/)
83  
-* `clj-html.jar`, `clj-html-helpers.jar`, `clj-stacktrace.jar`, `clj-unit`: [github.com/mmcgrana](http://github.com/mmcgrana)
  75
+    $ clj test/ring/run.clj
84 76
 
85 77
 Thanks
86 78
 ------
29  build.xml
... ...
@@ -1,29 +0,0 @@
1  
-<project name="ring" default="jar">
2  
-  <description>Pack all sources into a JAR.</description>
3  
-
4  
-  <property name="jarfile"  location="ring.jar"/>
5  
-  <property name="depsfile" location="deps.zip"/>
6  
-  <property name="depsurl"  value="http://cloud.github.com/downloads/mmcgrana/ring/deps.zip"/>
7  
-  <property name="depsdir"  location="deps/"/>
8  
-
9  
-  <target name="clean" description="Remove generated files and directories.">
10  
-    <delete file="${jarfile}"/>
11  
-    <delete file="${depsfile}"/>
12  
-    <delete dir="${depsdir}"/>
13  
-  </target>
14  
-
15  
-  <target name="jar" description="Create jar file.">
16  
-    <jar jarfile="${jarfile}">
17  
-      <path location="LICENSE"/>
18  
-      <fileset dir="./src" includes="ring/**/*.clj"/>
19  
-      <fileset dir="./test" includes="ring/**/*.clj"/>
20  
-    </jar>
21  
-  </target>
22  
-  
23  
-  <target name="deps" description="Download and unpack dependencies.">
24  
-    <get usetimestamp="true" description="Ring dependencies." 
25  
-         src="${depsurl}" dest="${depsfile}"/>
26  
-    <unzip src="${depsfile}" dest="."/>
27  
-    <delete file="${depsfile}"/>
28  
-  </target>
29  
-</project>
15  project.clj
... ...
@@ -0,0 +1,15 @@
  1
+(defproject ring "0.1.1-SNAPSHOT"
  2
+  :description "A Clojure web applications library."
  3
+  :url "http://github.com/mmcgrana/ring"
  4
+  :dependencies [[org.clojure/clojure "1.1.0"]
  5
+                 [org.clojure/clojure-contrib "1.1.0-master-SNAPSHOT"]
  6
+                 [commons-io "1.4"]
  7
+                 [org.mortbay.jetty/jetty "6.1.14"]
  8
+                 [org.mortbay.jetty/jetty-util "6.1.14"]
  9
+                 [org.mortbay.jetty/servlet-api-2.5 "6.1.14"]
  10
+                 [httpcomponents-httpcore/httpcore "4.0-alpha6"]
  11
+                 [httpcomponents-httpcore/httpcore-nio "4.0-alpha6"]
  12
+                 [clj-html "0.1.0-SNAPSHOT"]
  13
+                 [clj-stacktrace "0.1.0-SNAPSHOT"]]
  14
+  :dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]
  15
+                     [clj-unit "0.1.0-SNAPSHOT"]])

0 notes on commit 2c378d9

Please sign in to comment.
Something went wrong with that request. Please try again.