Skip to content

Commit 953e2b0

Browse files
committed
Split jsonrpc4lua code away from json4lua module
Refactored the code to use lua-cjson module for JSON encoding and decoding TODO: finalize doc updates
1 parent 02bf735 commit 953e2b0

File tree

9 files changed

+63
-776
lines changed

9 files changed

+63
-776
lines changed

README.md

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,13 @@
1-
# json4lua
2-
JSON and JSONRPC for Lua
1+
# jsonrpc4lua
2+
JSONRPC for Lua
33

44
# Installation #
55
```
6-
luarocks install --server=http://rocks.moonscript.org/manifests/amrhassan --local json4Lua
6+
luarocks --local install https://raw.githubusercontent.com/pdxmeshnet/jsonrpc4lua/master/json4lua-0.9.53-1.rockspec
77
```
88

9-
# JSON Usage #
9+
# Required CGILua Fix #
10+
https://github.com/pdxmeshnet/cgilua/commit/1b35d812c7d637b91f2ac0a8d91f9698ba84d8d9
1011

11-
## Encoding ##
12-
13-
```lua
14-
json = require('json')
15-
print(json.encode({ 1, 2, 'fred', {first='mars',second='venus',third='earth'} }))
16-
```
17-
```json
18-
[1,2,"fred", {"first":"mars","second":"venus","third","earth"}]
19-
```
20-
21-
## Decoding ##
22-
23-
```lua
24-
json = require("json")
25-
testString = [[ { "one":1 , "two":2, "primes":[2,3,5,7] } ]]
26-
decoded = json.decode(testString)
27-
table.foreach(decoded, print)
28-
print ("Primes are:")
29-
table.foreach(o.primes,print)
30-
```
31-
```
32-
one 1
33-
two 2
34-
primes table: 0032B928
35-
Primes are:
36-
1 2
37-
2 3
38-
3 5
39-
4 7
40-
```
41-
42-
# JSONRPC Usage #
43-
```lua
44-
json = require('json')
45-
require("json.rpc")
46-
server = json.rpc.proxy("http://jsolait.net/testj.py")
47-
result, error = server.echo('Test echo!')
48-
print(result)
49-
```
50-
```
51-
Test echo!
52-
```
12+
# Usage #
13+
See examples directory.

doc/VERSION.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
JSON4Lua and JSONRPC4Lua
1+
JSONRPC4Lua
22
Version 1.0.0
3-
4 March 2015
4-
http://github.com/craigmj/json4lua/
3+
31 July 2015
4+
http://github.com/pdxmeshnet/jsonrpc4lua/

examples/example.lua

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/tests.lua

Lines changed: 0 additions & 205 deletions
This file was deleted.

examples/timetrials.lua

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)