Skip to content

Commit b8167bc

Browse files
Matthew KennedyMatthew Kennedy
Matthew Kennedy
authored and
Matthew Kennedy
committed
Add REPL helper, instructions.
1 parent 167ecd4 commit b8167bc

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# ring-spring-security
22

3-
FIXME: write description
3+
Sample application demonstrating Spring, Spring Security and Ring integration with Jetty.
44

55
## Usage
66

7-
FIXME: write
7+
Start the REPL and follow instructions.
88

99
## License
1010

11-
Copyright (C) 2011 FIXME
11+
Copyright (C) 2011 Matthew Kennedy <[email protected]>
1212

1313
Distributed under the Eclipse Public License, the same as Clojure.

project.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
12
(defproject ring-spring-security "1.0.0-SNAPSHOT"
2-
:description "FIXME: write description"
3+
:description "Sample application demonstrating Spring, Spring Security and Ring integration with Jetty."
34
:dependencies [[org.clojure/clojure "1.2.1"]
45
[ring/ring-core "0.3.11"]
56
[ring/ring-jetty-adapter "0.3.11"]
@@ -11,4 +12,5 @@
1112
[org.slf4j/jcl-over-slf4j "1.6.1"]
1213
[ch.qos.logback/logback-classic "0.9.29"]]
1314
:exclusions [commons-logging/commons-logging]
14-
:dev-dependencies [[ring/ring-devel "0.3.11"]])
15+
:dev-dependencies [[ring/ring-devel "0.3.11"]]
16+
:repl-init ring-spring-security.repl-helper)

src/ring_spring_security/core.clj

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,18 @@
112112
([server handler]
113113
(boot-spring server handler nil)))
114114

115-
(defn boot [join?]
116-
(let [server (jetty/run-jetty #'app
117-
{:port 9090
118-
:join? join?
119-
:configurator (fn [server]
120-
(boot-spring server #'app "classpath:applicationContext.xml"))})]
121-
;this is a hack to get around the handler ring-adapter-jetty forces on us
122-
(doseq [handler (remove #(= (class %) org.mortbay.jetty.servlet.Context) (seq (.getHandlers server)))]
123-
(.removeHandler server handler))))
124-
125-
(comment
126-
(def jetty (boot true))
127-
(.stop jetty))
115+
(defn boot
116+
([join?]
117+
(let [server (jetty/run-jetty
118+
#'app
119+
{:port 9090
120+
:join? join?
121+
:configurator (fn [server]
122+
(boot-spring server #'app "classpath:applicationContext.xml"))})]
123+
;; this is a hack to get around the handler ring-adapter-jetty forces on us
124+
(doseq [handler (remove #(= (class %) org.mortbay.jetty.servlet.Context)
125+
(seq (.getHandlers server)))]
126+
(.removeHandler server handler))))
127+
([]
128+
(boot false)))
129+

src/ring_spring_security/main.clj

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
(ns ring-spring-security.repl-helper
3+
(:use [ring-spring-security.core :only [boot]]))
4+
5+
(println "Type `(boot)' to start the sample Spring application.")

0 commit comments

Comments
 (0)