From 9afad43a3ea781e98895fadbd85fac3fa42d2f45 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 11 Aug 2016 19:29:09 +0800 Subject: [PATCH] refactoring utils to tools as discussed in #2197 --- Makefile | 4 ++-- frontend/device/kobo/device.lua | 2 +- spec/unit/touch_probe_spec.lua | 2 +- {utils => tools}/kobo_touch_probe.lua | 2 +- {utils => tools}/trace_require.lua | 2 +- {utils => tools}/wbuilder.lua | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename {utils => tools}/kobo_touch_probe.lua (98%) rename {utils => tools}/trace_require.lua (95%) rename {utils => tools}/wbuilder.lua (99%) diff --git a/Makefile b/Makefile index d4e0f9505..ba2491865 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ UBUNTUTOUCH_SDL_DIR:=$(UBUNTUTOUCH_DIR)/ubuntu-touch-sdl WIN32_DIR=$(PLATFORM_DIR)/win32 # files to link from main directory -INSTALL_FILES=reader.lua frontend resources defaults.lua datastorage.lua l10n utils \ +INSTALL_FILES=reader.lua frontend resources defaults.lua datastorage.lua l10n tools \ README.md COPYING # for gettext @@ -336,7 +336,7 @@ pot: mkdir -p $(TEMPLATE_DIR) $(XGETTEXT_BIN) reader.lua `find frontend -iname "*.lua"` \ `find plugins -iname "*.lua"` \ - `find utils -iname "*.lua"` \ + `find tools -iname "*.lua"` \ > $(TEMPLATE_DIR)/$(DOMAIN).pot # push source file to Transifex $(MAKE) -i -C l10n bootstrap push diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index 089a64b7f..707c1e2c7 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -144,7 +144,7 @@ function Kobo:init() local switch_xy = G_reader_settings:readSetting("kobo_touch_switch_xy") -- and has no probe before if switch_xy == nil then - local TouchProbe = require("utils/kobo_touch_probe") + local TouchProbe = require("tools/kobo_touch_probe") local UIManager = require("ui/uimanager") UIManager:show(TouchProbe:new{}) UIManager:run() diff --git a/spec/unit/touch_probe_spec.lua b/spec/unit/touch_probe_spec.lua index ab0c1534d..c2cf072fd 100644 --- a/spec/unit/touch_probe_spec.lua +++ b/spec/unit/touch_probe_spec.lua @@ -5,7 +5,7 @@ describe("touch probe module", function() it("should probe properly for kobo touch", function() local Device = require("device") - local TouchProbe = require("utils/kobo_touch_probe"):new{} + local TouchProbe = require("tools/kobo_touch_probe"):new{} local need_to_switch_xy TouchProbe.saveSwitchXYSetting = function(_, new_need_to_switch_xy) need_to_switch_xy = new_need_to_switch_xy diff --git a/utils/kobo_touch_probe.lua b/tools/kobo_touch_probe.lua similarity index 98% rename from utils/kobo_touch_probe.lua rename to tools/kobo_touch_probe.lua index 0547398d9..0c8ea8f33 100755 --- a/utils/kobo_touch_probe.lua +++ b/tools/kobo_touch_probe.lua @@ -1,5 +1,5 @@ -- touch probe utility --- usage: ./luajit util/kobo_touch_probe.lua +-- usage: ./luajit tools/kobo_touch_probe.lua require "defaults" package.path = "common/?.lua;rocks/share/lua/5.1/?.lua;frontend/?.lua;" .. package.path diff --git a/utils/trace_require.lua b/tools/trace_require.lua similarity index 95% rename from utils/trace_require.lua rename to tools/trace_require.lua index a5e00668d..e32fdee1b 100644 --- a/utils/trace_require.lua +++ b/tools/trace_require.lua @@ -1,5 +1,5 @@ -- trace package loading flow with require call --- usage: ./luajit -lutils/trace_require reader.lua ../../test +-- usage: ./luajit -ltools/trace_require reader.lua ../../test local math = require("math") local _require = require diff --git a/utils/wbuilder.lua b/tools/wbuilder.lua similarity index 99% rename from utils/wbuilder.lua rename to tools/wbuilder.lua index 7c77b60c9..f3440981c 100755 --- a/utils/wbuilder.lua +++ b/tools/wbuilder.lua @@ -1,5 +1,5 @@ -- widget test utility --- usage: ./luajit util/wtest.lua +-- usage: ./luajit tools/wtest.lua require "defaults" print(package.path)