diff http/src/luan/modules/http/Server.luan @ 539:473e456444ff

Remove object-oriented primitive methods for string and binary
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 01 Jun 2015 17:53:55 -0600
parents 9bf9ad733827
children 35dde32c02ab
line wrap: on
line diff
--- a/http/src/luan/modules/http/Server.luan	Mon Jun 01 00:51:44 2015 -0600
+++ b/http/src/luan/modules/http/Server.luan	Mon Jun 01 17:53:55 2015 -0600
@@ -1,4 +1,6 @@
-require "luan:String"
+local String = require "luan:String"
+local gsub = String.gsub
+local match = String.match
 local Io = require "luan:Io"
 local Package = require "luan:Package"
 local Http = require "luan:http/Http"
@@ -72,14 +74,14 @@
 
 
 function M.init(dir)
-	dir = dir.gsub("/$","")  -- remove trailing '/' if any
+	dir = gsub(dir,"/$","")  -- remove trailing '/' if any
 	Http.dir = dir
 	function Io.schemes.site(path,add_extension)
 		return Io.uri( dir..path, add_extension )
 	end
 	M.authentication_handler.setPassword(M.private_password)
 	local base = dir
-	if base.match("^classpath:") ~= nil then
+	if match(base,"^classpath:") ~= nil then
 		base = dir.."#"..M.welcome_file.."#"..M.welcome_file..".luan"
 	end
 	M.resource_handler.setResourceBase(Io.uri(base).to_string())