diff tools/migration/migrator/prosody_files.lua @ 7881:4e3067272fae

tools/migration/migrator/*: Remove use of module()
author Kim Alvefur <zash@zash.se>
date Thu, 02 Feb 2017 20:49:09 +0100
parents 9ce0d246c851
children
line wrap: on
line diff
--- a/tools/migration/migrator/prosody_files.lua	Thu Feb 02 20:11:25 2017 +0100
+++ b/tools/migration/migrator/prosody_files.lua	Thu Feb 02 20:49:09 2017 +0100
@@ -18,7 +18,6 @@
 prosody = {};
 local dm = require "util.datamanager"
 
-module "prosody_files"
 
 local function is_dir(path) return lfs.attributes(path, "mode") == "directory"; end
 local function is_file(path) return lfs.attributes(path, "mode") == "file"; end
@@ -88,7 +87,7 @@
 	return userdata;
 end
 
-function reader(input)
+local function reader(input)
 	local path = clean_path(assert(input.path, "no input.path specified"));
 	assert(is_dir(path), "input.path is not a directory");
 	local iter = coroutine.wrap(function()handle_root_dir(path);end);
@@ -127,7 +126,7 @@
 	end
 end
 
-function writer(output)
+local function writer(output)
 	local path = clean_path(assert(output.path, "no output.path specified"));
 	assert(is_dir(path), "output.path is not a directory");
 	return function(item)
@@ -139,4 +138,7 @@
 	end
 end
 
-return _M;
+return {
+	reader = reader;
+	writer = writer;
+}