-
Notifications
You must be signed in to change notification settings - Fork 5
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
14 changed files
with
49 additions
and
76 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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- Update package path to load from lua_modules. | ||
|
||
local version = _VERSION:match "%d+%.%d+" | ||
|
||
package.path = "lua_modules/share/lua/" .. version .. "/?/init.lua;" .. package.path | ||
package.path = "lua_modules/share/lua/" .. version .. "/?.lua;" .. package.path | ||
package.cpath = "lua_modules/lib/lua/" .. version .. "/?.so;" .. package.cpath | ||
package.cpath = "lua_modules/lib64/lua/" .. version .. "/?.so;" .. package.cpath |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Run tests and linters. | ||
|
||
local exec = require("scripts.utils").exec | ||
|
||
exec "lua_modules/bin/busted" | ||
exec "lua_modules/bin/luacheck src spec scripts" |
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,28 +1,11 @@ | ||
-- Useful functions used in other scripts. | ||
|
||
local function run(command) | ||
-- Execute command and exit on error. | ||
local ok, _, code = os.execute(command) | ||
if not ok then | ||
os.exit(code) | ||
end | ||
-- Executes command. | ||
-- Raises an error on failure. | ||
local function exec(command) | ||
if not os.execute(command) then | ||
error "command failed" | ||
end | ||
end | ||
|
||
local updated = false | ||
|
||
local function update_paths() | ||
-- Include lua_modules/ in require path. | ||
assert(not updated) | ||
if not updated then | ||
package.path = "lua_modules/share/lua/5.4/?.lua;" .. package.path | ||
package.cpath = "lua_modules/lib/lua/5.4/?.so;" .. package.cpath | ||
package.cpath = "lua_modules/lib64/lua/5.4/?.so;" .. package.cpath | ||
updated = true | ||
end | ||
end | ||
|
||
update_paths() | ||
|
||
return { | ||
run = run, | ||
} | ||
return {exec = exec} |
22 changes: 18 additions & 4 deletions
22
filters/slipbox-filters-0.1-1.rockspec → filters/slipbox-filters-dev-1.rockspec
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,24 +1,38 @@ | ||
rockspec_format = "3.0" | ||
package = "slipbox-filters" | ||
version = "0.1-1" | ||
version = "dev-1" | ||
source = { | ||
url = "git+ssh://[email protected]/lggruspe/slipbox.git" | ||
} | ||
description = { | ||
summary = "Lua filters used by slipbox", | ||
homepage = "https://github.com/lggruspe/slipbox", | ||
license = "MIT" | ||
} | ||
dependencies = { | ||
"lua ~> 5.3" | ||
"lua >= 5.1, < 5.5", | ||
"dkjson" | ||
} | ||
test_dependencies = { | ||
"amalg", | ||
"busted", | ||
"luacheck", | ||
"luafilesystem" | ||
} | ||
build = { | ||
type = "builtin", | ||
modules = { | ||
csv = "src/csv.lua", | ||
errors = "src/errors.lua", | ||
filters = "src/filters.lua", | ||
log = "src/log.lua", | ||
links = "src/links.lua", | ||
metadata = "src/metadata.lua", | ||
slipbox = "src/slipbox.lua", | ||
utils = "src/utils.lua", | ||
["utils.test"] = "src/utils.test.lua", | ||
zk = "src/zk.lua" | ||
} | ||
} | ||
test = { | ||
type = "command", | ||
script = "scripts/test.lua", | ||
} |
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
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,3 @@ | ||
require "busted.runner" () | ||
|
||
local errors = require "src.errors" | ||
|
||
describe("duplicate_note_id", function() | ||
|
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,3 @@ | ||
require "busted.runner" () | ||
|
||
local links = require "src.links" | ||
|
||
local function join(table, sep) | ||
|
2 changes: 0 additions & 2 deletions
2
filters/src/metadata.test.lua → filters/spec/metadata_spec.lua
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,3 @@ | ||
require "busted.runner" () | ||
|
||
local metadata = require "src.metadata" | ||
|
||
describe("parse", function() | ||
|
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,3 @@ | ||
require "busted.runner" () | ||
|
||
local utils = require "src.utils" | ||
|
||
it("hashtag_prefix", function() | ||
|