Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Leiningen dependency management.

  • Loading branch information...
commit 2c378d9b3590b7970803fa17b26ee9a6ccac6a1d 1 parent 93393b4
@mmcgrana authored
Showing with 22 additions and 44 deletions.
  1. +7 −15 README.markdown
  2. +0 −29 build.xml
  3. +15 −0 project.clj
View
22 README.markdown
@@ -30,21 +30,21 @@ Adding simple middleware:
Quick Start
-----------
-First clone the Ring source and download Ring's dependencies:
+First, pull in Ring's dependencies using [Leiningen](http://github.com/technomancy/leiningen):
- git clone git://github.com/mmcgrana/ring.git
- cd ring
- ant deps
+ $ lein deps
To see a live "Hello World" Ring app, run:
- java -Djava.ext.dirs=deps clojure.main src/ring/example/hello_world.clj
+ $ clj src/ring/example/hello_world.clj
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.
+Note that your `clj` script needs to add the `src` directory and the jars in `lib` to your classpath.
+
To see a more sophisticated Ring app, run:
- java -Djava.ext.dirs=deps clojure.main src/ring/example/wrapping.clj
+ $ clj src/ring/example/wrapping.clj
* 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).
* 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
To run all the Ring unit tests:
- java -Djava.ext.dirs=deps clojure.main test/ring/run.clj
-
-You can learn more about Ring's dependencies at the following sites:
-
-* `clojure.jar`, `clojure-contrib.jar`: [clojure.org](http://clojure.org)
-* `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)
-* `httpcore-4.0.jar`, `httpcore-nio-4.0.jar`: [hc.apache.org](http://hc.apache.org/httpcomponents-core/index.html)
-* `commons-io-1.4.jar`: [commons.apache.org/io](http://commons.apache.org/io/)
-* `clj-html.jar`, `clj-html-helpers.jar`, `clj-stacktrace.jar`, `clj-unit`: [github.com/mmcgrana](http://github.com/mmcgrana)
+ $ clj test/ring/run.clj
Thanks
------
View
29 build.xml
@@ -1,29 +0,0 @@
-<project name="ring" default="jar">
- <description>Pack all sources into a JAR.</description>
-
- <property name="jarfile" location="ring.jar"/>
- <property name="depsfile" location="deps.zip"/>
- <property name="depsurl" value="http://cloud.github.com/downloads/mmcgrana/ring/deps.zip"/>
- <property name="depsdir" location="deps/"/>
-
- <target name="clean" description="Remove generated files and directories.">
- <delete file="${jarfile}"/>
- <delete file="${depsfile}"/>
- <delete dir="${depsdir}"/>
- </target>
-
- <target name="jar" description="Create jar file.">
- <jar jarfile="${jarfile}">
- <path location="LICENSE"/>
- <fileset dir="./src" includes="ring/**/*.clj"/>
- <fileset dir="./test" includes="ring/**/*.clj"/>
- </jar>
- </target>
-
- <target name="deps" description="Download and unpack dependencies.">
- <get usetimestamp="true" description="Ring dependencies."
- src="${depsurl}" dest="${depsfile}"/>
- <unzip src="${depsfile}" dest="."/>
- <delete file="${depsfile}"/>
- </target>
-</project>
View
15 project.clj
@@ -0,0 +1,15 @@
+(defproject ring "0.1.1-SNAPSHOT"
+ :description "A Clojure web applications library."
+ :url "http://github.com/mmcgrana/ring"
+ :dependencies [[org.clojure/clojure "1.1.0"]
+ [org.clojure/clojure-contrib "1.1.0-master-SNAPSHOT"]
+ [commons-io "1.4"]
+ [org.mortbay.jetty/jetty "6.1.14"]
+ [org.mortbay.jetty/jetty-util "6.1.14"]
+ [org.mortbay.jetty/servlet-api-2.5 "6.1.14"]
+ [httpcomponents-httpcore/httpcore "4.0-alpha6"]
+ [httpcomponents-httpcore/httpcore-nio "4.0-alpha6"]
+ [clj-html "0.1.0-SNAPSHOT"]
+ [clj-stacktrace "0.1.0-SNAPSHOT"]]
+ :dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]
+ [clj-unit "0.1.0-SNAPSHOT"]])
Please sign in to comment.
Something went wrong with that request. Please try again.