diff options
| author | Alexander Pickering <alex@cogarr.net> | 2020-09-16 17:18:38 -0400 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2020-09-16 17:18:38 -0400 |
| commit | 41ef510ce2fbaa25d8808250f00966baf0cb9b12 (patch) | |
| tree | e96a1d300955d23e9396b98579c05f00ca3759a8 | |
| parent | 105ea66aba31825512fea8f281b67f9c2a1d79a5 (diff) | |
| download | lua-nng-41ef510ce2fbaa25d8808250f00966baf0cb9b12.tar.gz lua-nng-41ef510ce2fbaa25d8808250f00966baf0cb9b12.tar.bz2 lua-nng-41ef510ce2fbaa25d8808250f00966baf0cb9b12.zip | |
Fix readme
Readme contains an explicit example, but it was broken.
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | lua-nng-master-1.rockspec | 40 | ||||
| -rw-r--r-- | lua-nng.rockspec | 41 |
3 files changed, 85 insertions, 4 deletions
@@ -4,7 +4,7 @@ This is a simple binding of [Nanomessage Next Generation](https://github.com/nan ## Installation
-The easiest way to download lua-nng is with [luarocks](https://github.com/luarocks/luarocks)
+The easiest way to download lua-nng is with [luarocks](https://github.com/luarocks/luarocks).
```
luarocks install --server=http://rocks.cogarr.net lua-nng
@@ -12,6 +12,8 @@ luarocks install --server=http://rocks.cogarr.net lua-nng ## Example
+ local nng = require("nng")
+
local s1 = nng.pair1_open()
local s2 = nng.pair1_open()
@@ -19,9 +21,7 @@ luarocks install --server=http://rocks.cogarr.net lua-nng s2:dial("ipc://tmp/pair.ipc")
s2:send("hello")
- print(s1:recv())
-
-prints "hello"
+ print(s1:recv()) --prints "hello"
For more examples, see spec/start\_spec.lua
diff --git a/lua-nng-master-1.rockspec b/lua-nng-master-1.rockspec new file mode 100644 index 0000000..9075cb3 --- /dev/null +++ b/lua-nng-master-1.rockspec @@ -0,0 +1,40 @@ +package = "lua-nng" +rockspec_format="3.0" +version = "master-1" +source = { + url = "git+https://cogarr.net/source/cgit.cgi/lua-nng", +} +description = { + summary = "A simple binding for Nanomessage Next Generation", + homepage = "https://cogarr.net/source/cgit.cgi/lua-nng/about", + license = "BSD/2 Clause", + maintainer = "Alexander Pickering <alex@cogarr.net>", + labels = {"network","nanomessage","nng"} +} +external_dependencies = { + NNG = { + library = "nng", + header = "nng/nng.h" + } +} +build = { + type = "make", + build_variables = { + CFLAGS="$(CFLAGS)", + LUA_INCDIR="$(LUA_INCDIR)", + LUA_LIBDIR="$(LUA_LIBDIR)", + NNG_INCDIR="$(NNG_INCDIR)", + NNG_LIBDIR="$(NNG_LIBDIR)", + FIND="$(FIND)", + LIB_EXTENSION="$(LIB_EXTENSION)", + LIBFLAG="$(LIBFLAG)", + }, + install_variables = { + INST_PREFIX="$(PREFIX)", + INST_LIBDIR="$(LIBDIR)", + NNG_LIBDIR="$(NNG_LIBDIR)", + LUA_LIBDIR="$(LUA_LIBDIR)", + LIB_EXTENSION="$(LIB_EXTENSION)", + CP="$(CP)", + }, +} diff --git a/lua-nng.rockspec b/lua-nng.rockspec new file mode 100644 index 0000000..42d1e29 --- /dev/null +++ b/lua-nng.rockspec @@ -0,0 +1,41 @@ +package = "lua-nng" +rockspec_format="3.0" +version = "2020.9.15" +source = { + url = "git+https://cogarr.net/source/cgit.cgi/lua-nng", + --tag = "v0.1" +} +description = { + summary = "A simple binding for Nanomessage Next Generation", + homepage = "https://cogarr.net/source/cgit.cgi/lua-nng/about", + license = "BSD/2 Clause", + maintainer = "Alexander Pickering <alex@cogarr.net>", + labels = {"network","nanomessage","nng"} +} +external_dependencies = { + NNG = { + library = "nng", + header = "nng/nng.h" + } +} +build = { + type = "make", + build_variables = { + CFLAGS="$(CFLAGS)", + LUA_INCDIR="$(LUA_INCDIR)", + LUA_LIBDIR="$(LUA_LIBDIR)", + NNG_INCDIR="$(NNG_INCDIR)", + NNG_LIBDIR="$(NNG_LIBDIR)", + FIND="$(FIND)", + LIB_EXTENSION="$(LIB_EXTENSION)", + LIBFLAG="$(LIBFLAG)", + }, + install_variables = { + INST_PREFIX="$(PREFIX)", + INST_LIBDIR="$(LIBDIR)", + NNG_LIBDIR="$(NNG_LIBDIR)", + LUA_LIBDIR="$(LUA_LIBDIR)", + LIB_EXTENSION="$(LIB_EXTENSION)", + CP="$(CP)", + }, +} |
