Skip to content

Commit

Permalink
Fix mw.echo and mw.echoText
Browse files Browse the repository at this point in the history
  • Loading branch information
vifino committed May 13, 2015
1 parent d86fa87 commit 60a2958
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 4 additions & 2 deletions lua/RouteGlue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ end
function mw.echo(code, resp)
local resp = tonumber(resp) or 200
if type(code) == "string" then
return mw.Echo(code, resp)
return mw.Echo(resp, code)
elseif type(code) == "table" then
return mw.Echo(code:render(), resp)
return mw.Echo(resp, code:render())
else
return mw.echoText(resp, tostring(code))
end
end
function mw.echoText(text, resp)
Expand Down
6 changes: 3 additions & 3 deletions modules/glue/generated_lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ func mainglue_lua() (*asset, error) {
return nil, err
}

info := bindata_file_info{name: "MainGlue.lua", size: 3884, mode: os.FileMode(420), modTime: time.Unix(1431432189, 0)}
info := bindata_file_info{name: "MainGlue.lua", size: 3884, mode: os.FileMode(420), modTime: time.Unix(1431533815, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

var _routeglue_lua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x51\xbd\x4e\xc3\x30\x10\x9e\x93\xa7\x38\x75\x4a\xa4\xb6\xaa\x18\x91\xba\xc1\x06\x0c\x05\x66\x94\x26\x17\x62\xc9\xb5\xa3\xf3\x99\xd0\x85\x67\xe7\xec\xc4\x4d\x29\x85\xc5\x4a\x7c\xdf\xaf\x6f\xb5\x82\x47\xd5\x34\x1a\x87\x8a\x10\x3a\xd4\x3d\x92\x5b\x82\xb1\x0c\x84\x95\xd6\x47\xf0\x0e\x5b\xaf\x61\x50\xdc\x41\x65\x8e\xdc\x29\xf3\x0e\x7b\xcf\xc0\x1d\x82\x43\xfa\x40\x02\x65\x14\x83\xab\x49\xf5\x9c\xb7\xde\xd4\xac\xac\x81\xc3\xb0\x36\x38\x14\xad\x11\x39\x1c\x1c\x57\x8c\x65\x9e\x69\x5b\x57\x1a\x6a\xdb\x20\x6c\x61\xb1\xc8\x33\xd5\x02\x1f\x7b\x14\x5c\x09\x5b\xb9\x4a\xfc\x45\x30\x30\x79\x96\x4d\x58\xc7\x24\xce\xeb\xc6\x1f\xfa\x80\xcd\x33\xd4\x0e\x2f\xc9\x23\xe8\x44\x0d\xde\x48\x24\x6c\x6d\xab\x66\x1c\x16\x41\x4f\xe8\xc1\x38\xd4\x0c\xf3\x09\xfe\xa7\x55\xf4\x0a\x00\x01\x5b\x2a\xe4\x8c\x97\xa6\xc9\xc7\x63\x2c\x45\xe9\x43\xe6\xb1\x57\xaa\x9d\xf4\x29\xa5\x91\xa7\xb9\x7b\xd8\xbd\x3d\x3d\xa7\x30\x93\xfe\x25\x60\xf7\x3a\x23\x82\x8f\x68\x86\xf9\xd7\x16\x8c\xd2\x49\xf5\x3c\x53\x44\x11\xb2\x27\x23\x71\xc2\xdf\xf9\x3a\xb0\xee\x6c\xd4\x5b\xca\x72\x5d\x7f\xda\x46\xf8\x11\x53\xb6\xc6\x1f\xf6\x48\x45\x1c\x82\x25\xb8\xd9\x6c\xe6\x05\xc5\x20\xd7\x5e\x79\xf2\x13\x83\xfb\x5f\x06\xe7\x4b\x9a\x05\xb8\xda\x6b\xfc\x8f\x7f\x4b\x92\x5d\x92\x94\xb3\x90\x74\xb9\xd6\xe7\x05\x3f\xb9\x60\x39\x4e\xc8\x9f\x72\x71\x5e\x5c\xad\x26\xe2\x81\x58\x46\xdd\xef\x00\x00\x00\xff\xff\x2d\xb9\x68\xdc\x09\x03\x00\x00")
var _routeglue_lua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\x51\xcd\x4e\xe3\x40\x0c\x3e\x27\x4f\x61\xf5\x94\x48\x6d\x55\xed\x71\xa5\xde\x76\x6f\xc0\xa1\xc0\x19\xa5\x89\x43\x46\x9a\xce\x44\x1e\x87\xd0\x0b\xcf\x8e\x3d\xf9\x69\x28\x45\x5c\xac\x64\xfc\xfd\xd8\x9f\x37\x1b\xb8\x37\x55\x65\xb1\x2f\x08\xa1\x41\xdb\x22\x85\x35\x38\xcf\x40\x58\x58\x7b\x86\x2e\x60\xdd\x59\xe8\x0d\x37\x50\xb8\x33\x37\xc6\xbd\xc2\xb1\x63\xe0\x06\x21\x20\xbd\x21\x81\x71\x86\x21\x94\x64\x5a\x4e\xeb\xce\x95\x6c\xbc\x83\x53\xbf\x75\xd8\x67\xb5\x13\x39\xec\x03\x17\x8c\x79\x9a\x58\x5f\x16\x16\x4a\x5f\x21\xec\x61\xb5\x4a\x13\x53\x03\x9f\x5b\x14\x5c\x0e\x7b\x79\x9a\xf8\x2b\x35\x70\x69\x92\x8c\xd8\xc0\x24\xce\xdb\xaa\x3b\xb5\x8a\x4d\x13\xb4\x01\xaf\xc9\x03\x68\xa6\xaa\x37\x12\x09\xdb\xfa\xa2\x1a\x9a\x99\xea\x09\x5d\x8d\x75\x4d\xed\x8f\xf0\x1f\xad\xa2\x97\x02\x04\xec\x29\x93\x1a\x1f\x5d\x95\x0e\x65\x58\x8a\xa6\x0f\xe9\xc7\xbd\xa6\xb5\x27\x7d\x9a\xa6\x91\x68\xfe\xdd\x1d\x5e\x1e\x1e\xa7\x61\x46\xfd\x6b\xc0\xe1\xf9\x82\x50\x1f\xd1\xd4\xfe\xc7\x1e\x9c\xb1\x93\xea\x72\xa6\x88\x22\xe4\x8e\x9c\x8c\xa3\x7f\xcb\x73\x60\xd9\xf8\xa8\xb7\x96\xe3\x86\x76\xbe\x86\xfe\x88\x29\x7b\xd7\x9d\x8e\x48\x59\x6c\x82\x27\xf8\xb3\xdb\x5d\x0e\x14\x07\xb9\x95\xf2\xe8\x27\x06\xff\xd5\x40\xd9\x6b\x58\x2c\xf6\x5d\x80\x8b\xa3\xc5\xdf\xf9\x7f\x49\x36\x90\x79\xf2\x45\x42\x33\x56\x97\x79\xc2\x77\x1e\xf1\xec\x97\xe7\x1d\xa3\xb8\x15\x40\xe4\xb0\x94\x39\x84\xaf\xfe\xb1\x9f\xdd\xcc\x22\x17\x1b\xe9\xe6\x51\xf7\x33\x00\x00\xff\xff\xf8\x3a\xf5\xa9\x3a\x03\x00\x00")

func routeglue_lua_bytes() ([]byte, error) {
return bindata_read(
Expand All @@ -96,7 +96,7 @@ func routeglue_lua() (*asset, error) {
return nil, err
}

info := bindata_file_info{name: "RouteGlue.lua", size: 777, mode: os.FileMode(420), modTime: time.Unix(1431441955, 0)}
info := bindata_file_info{name: "RouteGlue.lua", size: 826, mode: os.FileMode(420), modTime: time.Unix(1431557323, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand Down
6 changes: 2 additions & 4 deletions tests/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ srv.Use(mw.ExtRoute({
[".lua"]=mw.Lua(),
["***"]=static.serve("")
}))
srv.GET("/woot", mw.new(function()
content(doctype()(
srv.GET("/woot", mw.echo(doctype()(
tag"body"(
tag"h1"("woot")
)
))
end))
), 200))
srv.GET("/wat", mw.echoText("u wut m8?!?!"))
print("bai")

0 comments on commit 60a2958

Please sign in to comment.