Permalink
Browse files

Bumping version to 0.02.01 and adding VersionString

  • Loading branch information...
paulbellamy committed May 28, 2011
1 parent 63047b8 commit 0ab6fb4ffa2466e002d306865f909b26dab7c55f
Showing with 11 additions and 3 deletions.
  1. +8 −3 mango.go
  2. +3 −0 mango_test.go
View
@@ -100,8 +100,13 @@ type Stack struct {
app App
}
func (this *Stack) Version() []int {
return []int{0, 2}
func Version() []int {
return []int{0, 2, 1}
}
func VersionString() string {
v := Version()
return fmt.Sprintf("%d.%02d.%02d", v[0], v[1], v[2])
}
func (this *Stack) Middleware(middleware ...Middleware) {
@@ -118,7 +123,7 @@ func (this *Stack) HandlerFunc(app App) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
env := make(map[string]interface{})
env["mango.request"] = &Request{r}
env["mango.version"] = this.Version()
env["mango.version"] = Version()
status, headers, body := compiled_app(env)
View
@@ -5,6 +5,7 @@ import (
"io/ioutil"
"testing"
"bytes"
"fmt"
"log"
"runtime"
)
@@ -43,6 +44,8 @@ func routingBTestServer(env Env) (Status, Headers, Body) {
func init() {
runtime.GOMAXPROCS(4)
fmt.Println("Testing Mango Version:", VersionString())
testRoutes := make(map[string]App)
testRoutes["/hello"] = new(Stack).Compile(helloWorld)

0 comments on commit 0ab6fb4

Please sign in to comment.