Skip to content

Commit 29bf468

Browse files
authored
Merge pull request #3 from kdssoftware/feat/tests
Add plugin to luarocks and fix CI testing
2 parents 4e8ff4d + 0d25bbd commit 29bf468

10 files changed

Lines changed: 82 additions & 2 deletions

File tree

.busted

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
return {
2+
_all = {
3+
coverage = false,
4+
lpath = "lua/?.lua;lua/?/init.lua",
5+
},
6+
default = {
7+
verbose = true,
8+
},
9+
tests = {
10+
verbose = true,
11+
},
12+
}

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: LuaRocks release
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
luarocks-release:
7+
runs-on: ubuntu-latest
8+
name: LuaRocks upload
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: LuaRocks Upload
13+
uses: nvim-neorocks/luarocks-tag-release@v5
14+
env:
15+
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ luac.out
3939
*.x86_64
4040
*.hex
4141

42+
# Lua specific
43+
/luarocks
44+
/lua_modules
45+
/.luarocks
46+
/lua

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# lua-obfuscator.nvim
2-
A plugin to use https://luaobfuscator.com/ for Neovim
2+
A plugin to obfuscate lua code inside of neovim
33

4+
[![LuaRocks](https://img.shields.io/luarocks/v/kdssoftware/lua-obfuscator.nvim?logo=lua&color=purple)](https://luarocks.org/modules/kdssoftware/lua-obfuscator)
45

56
## Commands
6-
- `LuaObfuscatorCurrent` : obfuscated
7+
- `LuaObfuscatorCurrent` : obfuscates the current buffer
8+
9+
More improves coming soon

lua-obfuscator.nvim-dev-1.rockspec

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package = "lua-obfuscator.nvim"
2+
version = "dev-1"
3+
source = {
4+
url = "git+ssh://git@github.com/kdssoftware/lua-obfuscator.nvim.git"
5+
}
6+
description = {
7+
summary = "## Commands- `LuaObfuscatorCurrent` : obfuscated ",
8+
detailed = [[
9+
10+
## Commands
11+
- `LuaObfuscatorCurrent` : obfuscated
12+
]],
13+
homepage = "*** please enter a project homepage ***",
14+
license = "*** please specify a license ***"
15+
}
16+
build = {
17+
type = "builtin",
18+
modules = {
19+
["lua-obfuscator"] = "lua/lua-obfuscator.lua",
20+
["lua-obfuscator.api"] = "lua/lua-obfuscator/api.lua",
21+
["lua-obfuscator.call"] = "lua/lua-obfuscator/call.lua",
22+
["lua-obfuscator.json"] = "lua/lua-obfuscator/json.lua"
23+
},
24+
copy_directories = {
25+
"doc"
26+
}
27+
}

run-tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
BUSTED_VERSION="2.1.2-3"
3+
luarocks init
4+
luarocks install busted "$BUSTED_VERSION"
5+
luarocks config --scope project lua_version 5.1
6+
nvim -u NONE \
7+
-c "lua package.path='lua_modules/share/lua/5.1/?.lua;lua_modules/share/lua/5.1/?/init.lua;'..package.path;package.cpath='lua_modules/lib/lua/5.1/?.so;'..package.cpath;local k,l,_=pcall(require,'luarocks.loader') _=k and l.add_context('busted','$BUSTED_VERSION')" \
8+
-l "lua_modules/lib/luarocks/rocks-5.1/busted/$BUSTED_VERSION/bin/busted" "$@"

spec/current_spec.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
describe(':LuaObfuscatorCurrent', function()
2+
it('should obfuscate lua file', function()
3+
-- todo
4+
assert.truthy("TODO")
5+
end)
6+
7+
it('should error if file is empty', function()
8+
assert.truthy("TODO")
9+
end)
10+
end)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)