Permalink
Browse files

some clean up before version inc

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
1 parent aa50c48 commit c23d8d5aecda6ebdf907135a874ed58bfc36637c @ibdknox ibdknox committed Jul 25, 2011
Showing with 35 additions and 6 deletions.
  1. +4 −2 README.md
  2. +12 −0 history.md
  3. +1 −1 project.clj
  4. +6 −0 src/noir/response.clj
  5. +0 −1 src/noir/server.clj
  6. +12 −2 test/noir/test/core.clj
View
@@ -2,20 +2,22 @@
A framework for writing clojure websites. Noir is currently being used in production at http://www.typewire.io
+Learn more at [Web Noir](http://www.webnoir.org)
+
## Usage
The best way to get started with noir is by downloading the lein noir plugin for [leiningen](https://github.com/technomancy/leiningen):
```bash
-lein plugin install lein-noir 1.0.0
+lein plugin install lein-noir 1.1.0
lein noir new my-website
cd my-website
lein run
```
If you want to include Noir in an already created leiningen project, simply add this to your dependencies:
```clojure
-[noir "1.0.0"]
+[noir "1.1.0"]
```
## Docs
View
@@ -0,0 +1,12 @@
+##Changes for 1.1.0
+
+* Added session/flash-put! and sesion/flash-get
+* Added alternative session storage via the :session-store server option
+* Removed dependency on contrib
+* Added defaults for session/get and cookies/get
+* Added gen-handler for interop with other ring-based libraries
+* Added test utilities under noir.util.test
+* Added noir.util.middleware
+* Moved to latest compojure/ring/hiccup
+* Added server/stop server/restart
+* Fixed bug where server/start wasn't returning a server object
View
@@ -4,7 +4,7 @@
[compojure "0.6.4"]
[org.clojure/tools.namespace "0.1.0"]
[clj-json "0.3.2"]
- [ring "0.3.10"]
+ [ring "0.3.11"]
[cssgen "0.2.4"]
[hiccup "0.3.6"]
[clj-stacktrace "0.2.2"]
View
@@ -9,6 +9,12 @@
{:header {"Content-Type" "text/xml"}
:body content})
+(defn content-type
+ "Wraps the response with the given content type and sets the body to the content."
+ [ctype content]
+ {:header {"Content-Type" ctype}
+ :body content})
+
(defn json
"Wraps the response in the json content type and stringifies the given content"
[content]
View
@@ -52,7 +52,6 @@
(cookie/wrap-noir-cookies)
(validation/wrap-noir-validation)
(statuses/wrap-status-pages)
- (wrap-file-info)
(wrap-route-updating)
(exception/wrap-exceptions)
(options/wrap-options opts))))
View
@@ -35,6 +35,12 @@
(has-content-type (content-types :json))
(has-body "{\"noir\":\"web\"}"))))
+(deftest flash-lifetime
+ (with-noir
+ (session/flash-put! "noir")
+ (is (= "noir" (session/flash-get)))
+ (is (= nil (session/flash-get)))))
+
(defpage "/test" {:keys [nme]}
(str "Hello " nme))
@@ -52,8 +58,12 @@
(has-content-type (content-types :json))
(has-body "{\"json\":\"text\"}")))
+(defpage "/utf" []
+ "ąčęė")
+
(deftest wrap-utf
(server/add-middleware middleware/wrap-utf-8)
- (-> (send-request "/test" {"nme" "chris"})
- (has-content-type "text/html; charset=utf-8")))
+ (-> (send-request "/utf")
+ (has-content-type "text/html; charset=utf-8")
+ (has-body "ąčęė")))

0 comments on commit c23d8d5

Please sign in to comment.