-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
-------------------------------------------------------------------------------- | ||
-- sailor.lua, v0.4.6: core functionalities of the framework | ||
-- sailor.lua, v0.4.7: core functionalities of the framework | ||
-- This file is a part of Sailor project | ||
-- Copyright (c) 2014 Etiene Dalcol <[email protected]> | ||
-- License: MIT | ||
|
@@ -59,6 +59,7 @@ end | |
-- Stores the path of the application in sailor.path | ||
function sailor.set_application_path(r) | ||
local dir = lfs.currentdir() | ||
|
||
if dir == '/' or not dir then | ||
local filename = r.uri:match( "([^/]+)$") | ||
sailor.path = r.filename:match("^@?(.-)/"..filename.."$") | ||
|
@@ -140,8 +141,8 @@ end | |
-- parms: table, vars being passed ahead | ||
function Page:include(path,parms) | ||
parms = parms or {} | ||
local incl_src = read_src(((sailor.path):match('(.*)'..self.base_path:gsub('-','%%-') ) or '')..path) | ||
|
||
local incl_src = read_src(sailor.path..'/'..path) | ||
incl_src = lp.translate(incl_src) | ||
parms.page = self | ||
render_page(path,incl_src,parms) | ||
|