You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "oowl (via GitHub)" <gi...@apache.org> on 2023/06/22 14:20:49 UTC
[GitHub] [incubator-opendal] oowl opened a new pull request, #2511: doc(binding/lua): Improve readme doc for contribute and usage
oowl opened a new pull request, #2511:
URL: https://github.com/apache/incubator-opendal/pull/2511
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2511: doc(binding/lua): Improve readme doc for contribute and usage
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2511:
URL: https://github.com/apache/incubator-opendal/pull/2511#discussion_r1239275959
##########
bindings/lua/README.md:
##########
@@ -14,10 +14,98 @@ op:write("test.txt","hello world")
print("read: ", op:read("test.txt"))
```
+## Lua version
+You have to enable one of the features: lua54, lua53, lua52, lua51, luajit(52) or luau in `Cargo.toml`, according to the chosen Lua version. Default Lua version is 5.2.
+
## Build
1. Build OpenDAL LUA Interface
```bash
-cargo build --package opendal-lua
-```
\ No newline at end of file
+$ cd bindings/lua
+$ cargo build --package opendal-lua --release
+```
+
+2. Install opendal lua library
+```bash
+# copy to lua share library directory
+# default lua5.2 share library directory is /usr/lib/lua/5.2
+$ cp ../../target/release/libopendal_lua.so /usr/lib/lua/5.2/opendal.so
+```
+
+## Usage
+```bash
+$ lua5.2 example/fs.lua
+read: hello world
+```
+
+## Test
+```bash
+$ busted -o gtest test/opendal_test.lua
+[==========] Running tests from scanned files.
+[----------] Global test environment setup.
+[----------] Running tests from test/opendal_test.lua
+[ RUN ] test/opendal_test.lua @ 24: opendal unit test opendal fs schema operator function in fs schema
+[ OK ] test/opendal_test.lua @ 24: opendal unit test opendal fs schema operator function in fs schema (1.52 ms)
+[ RUN ] test/opendal_test.lua @ 36: opendal unit test opendal fs schema meta function in fs schema
+[ OK ] test/opendal_test.lua @ 36: opendal unit test opendal fs schema meta function in fs schema (0.24 ms)
+[----------] 2 tests from test/opendal_test.lua (3.47 ms total)
+
+[----------] Global test environment teardown.
+[==========] 2 tests from 1 test file ran. (3.54 ms total)
+[ PASSED ] 2 tests.
+```
+
+# Modules
Review Comment:
Let's remove the `Modules` section. It can easily become outdated and inaccurate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo merged pull request #2511: doc(binding/lua): Improve readme doc for contribute and usage
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #2511:
URL: https://github.com/apache/incubator-opendal/pull/2511
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2511: doc(binding/lua): Improve readme doc for contribute and usage
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2511:
URL: https://github.com/apache/incubator-opendal/pull/2511#discussion_r1239269863
##########
bindings/lua/README.md:
##########
@@ -14,10 +14,98 @@ op:write("test.txt","hello world")
print("read: ", op:read("test.txt"))
```
+## Lua version
+You have to enable one of the features: lua54, lua53, lua52, lua51, luajit(52) or luau in `Cargo.toml`, according to the chosen Lua version. Default Lua version is 5.2.
+
## Build
1. Build OpenDAL LUA Interface
```bash
-cargo build --package opendal-lua
-```
\ No newline at end of file
+$ cd bindings/lua
+$ cargo build --package opendal-lua --release
+```
+
+2. Install opendal lua library
+```bash
+# copy to lua share library directory
+# default lua5.2 share library directory is /usr/lib/lua/5.2
+$ cp ../../target/release/libopendal_lua.so /usr/lib/lua/5.2/opendal.so
+```
+
+## Usage
+```bash
+$ lua5.2 example/fs.lua
+read: hello world
+```
+
+## Test
+```bash
+$ busted -o gtest test/opendal_test.lua
+[==========] Running tests from scanned files.
+[----------] Global test environment setup.
+[----------] Running tests from test/opendal_test.lua
+[ RUN ] test/opendal_test.lua @ 24: opendal unit test opendal fs schema operator function in fs schema
+[ OK ] test/opendal_test.lua @ 24: opendal unit test opendal fs schema operator function in fs schema (1.52 ms)
+[ RUN ] test/opendal_test.lua @ 36: opendal unit test opendal fs schema meta function in fs schema
+[ OK ] test/opendal_test.lua @ 36: opendal unit test opendal fs schema meta function in fs schema (0.24 ms)
+[----------] 2 tests from test/opendal_test.lua (3.47 ms total)
+
+[----------] Global test environment teardown.
+[==========] 2 tests from 1 test file ran. (3.54 ms total)
+[ PASSED ] 2 tests.
+```
+
+# Modules
Review Comment:
I prefer to have an API docs like https://opendal.apache.org/docs/python/opendal.html
Does lua has some native docs build tools?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] oowl commented on a diff in pull request #2511: doc(binding/lua): Improve readme doc for contribute and usage
Posted by "oowl (via GitHub)" <gi...@apache.org>.
oowl commented on code in PR #2511:
URL: https://github.com/apache/incubator-opendal/pull/2511#discussion_r1239275256
##########
bindings/lua/README.md:
##########
@@ -14,10 +14,98 @@ op:write("test.txt","hello world")
print("read: ", op:read("test.txt"))
```
+## Lua version
+You have to enable one of the features: lua54, lua53, lua52, lua51, luajit(52) or luau in `Cargo.toml`, according to the chosen Lua version. Default Lua version is 5.2.
+
## Build
1. Build OpenDAL LUA Interface
```bash
-cargo build --package opendal-lua
-```
\ No newline at end of file
+$ cd bindings/lua
+$ cargo build --package opendal-lua --release
+```
+
+2. Install opendal lua library
+```bash
+# copy to lua share library directory
+# default lua5.2 share library directory is /usr/lib/lua/5.2
+$ cp ../../target/release/libopendal_lua.so /usr/lib/lua/5.2/opendal.so
+```
+
+## Usage
+```bash
+$ lua5.2 example/fs.lua
+read: hello world
+```
+
+## Test
+```bash
+$ busted -o gtest test/opendal_test.lua
+[==========] Running tests from scanned files.
+[----------] Global test environment setup.
+[----------] Running tests from test/opendal_test.lua
+[ RUN ] test/opendal_test.lua @ 24: opendal unit test opendal fs schema operator function in fs schema
+[ OK ] test/opendal_test.lua @ 24: opendal unit test opendal fs schema operator function in fs schema (1.52 ms)
+[ RUN ] test/opendal_test.lua @ 36: opendal unit test opendal fs schema meta function in fs schema
+[ OK ] test/opendal_test.lua @ 36: opendal unit test opendal fs schema meta function in fs schema (0.24 ms)
+[----------] 2 tests from test/opendal_test.lua (3.47 ms total)
+
+[----------] Global test environment teardown.
+[==========] 2 tests from 1 test file ran. (3.54 ms total)
+[ PASSED ] 2 tests.
+```
+
+# Modules
Review Comment:
No official doc generator tools, but penlight has http://keplerproject.github.io/luadoc/, I will try to generate it in the next PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org