Comparison

core/moduleapi.lua @ 6168:3942630b4e35

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 09 May 2014 23:35:54 +0200
parent 5900:cb1103423aa7
parent 6165:6a184b16b717
child 6418:ae798314347c
comparison
equal deleted inserted replaced
6163:7a8899d314d7 6168:3942630b4e35
11 local array = require "util.array"; 11 local array = require "util.array";
12 local set = require "util.set"; 12 local set = require "util.set";
13 local logger = require "util.logger"; 13 local logger = require "util.logger";
14 local pluginloader = require "util.pluginloader"; 14 local pluginloader = require "util.pluginloader";
15 local timer = require "util.timer"; 15 local timer = require "util.timer";
16 local resolve_relative_path = require"util.paths".resolve_relative_path;
16 17
17 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; 18 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat;
18 local error, setmetatable, type = error, setmetatable, type; 19 local error, setmetatable, type = error, setmetatable, type;
19 local ipairs, pairs, select = ipairs, pairs, select; 20 local ipairs, pairs, select = ipairs, pairs, select;
20 local tonumber, tostring = tonumber, tostring; 21 local tonumber, tostring = tonumber, tostring;
378 function api:get_directory() 379 function api:get_directory()
379 return self.path and (self.path:gsub("%"..path_sep.."[^"..path_sep.."]*$", "")) or nil; 380 return self.path and (self.path:gsub("%"..path_sep.."[^"..path_sep.."]*$", "")) or nil;
380 end 381 end
381 382
382 function api:load_resource(path, mode) 383 function api:load_resource(path, mode)
383 path = config.resolve_relative_path(self:get_directory(), path); 384 path = resolve_relative_path(self:get_directory(), path);
384 return io.open(path, mode); 385 return io.open(path, mode);
385 end 386 end
386 387
387 function api:open_store(name, type) 388 function api:open_store(name, type)
388 return storagemanager.open(self.host, name or self.name, type); 389 return storagemanager.open(self.host, name or self.name, type);