diff --git a/dist.info b/dist.info index af3c4dd..c0edd7b 100644 --- a/dist.info +++ b/dist.info @@ -1,12 +1,12 @@ --- This file is part of LuaDist project name = "dkjson" -version = "2.2" +version = "2.4" desc = "dkjson is a module for encoding and decoding JSON data. It supports UTF-8." author = "David Kolf" license = "MIT/X11" -url = "http://chiselapp.com/user/dhkolf/repository/dkjson/" +url = "http://dkolf.de/src/dkjson-lua.fsl/" maintainer = "Peter Drahoš" depends = { diff --git a/dkjson-2.2-1.rockspec b/dkjson-2.2-1.rockspec deleted file mode 100644 index 040e7e1..0000000 --- a/dkjson-2.2-1.rockspec +++ /dev/null @@ -1,30 +0,0 @@ -package = "dkjson" -version = "2.2-1" -source = { - url = "http://chiselapp.com/user/dhkolf/repository/dkjson/tarball/dkjson-2.2.tar.gz?uuid=release_2_2", - file = "dkjson-2.2.tar.gz" -} -description = { - summary = "David Kolf's JSON module for Lua", - detailed = [[ -dkjson is a module for encoding and decoding JSON data. It supports UTF-8. - -JSON (JavaScript Object Notation) is a format for serializing data based -on the syntax for JavaScript data structures. - -dkjson is written in Lua without any dependencies, but -when LPeg is available dkjson uses it to speed up decoding. -]], - homepage = "http://chiselapp.com/user/dhkolf/repository/dkjson/", - license = "MIT/X11" -} -dependencies = { - "lua >= 5.1" -} -build = { - type = "builtin", - modules = { - dkjson = "dkjson.lua" - } -} - diff --git a/dkjson.lua b/dkjson.lua index e57e17c..b7475ba 100644 --- a/dkjson.lua +++ b/dkjson.lua @@ -1,18 +1,26 @@ -- Module options: local always_try_using_lpeg = true + local register_global_module_table = false + local global_module_name = 'json' --[==[ David Kolf's JSON module for Lua 5.1/5.2 ======================================== -*Version 2.2* +*Version 2.4* -This module writes no global values, not even the module table. -Import it using +In the default configuration this module writes no global values, not even +the module table. Import it using json = require ("dkjson") +In environments where `require` or a similiar function are not available +and you cannot receive the return value of the module, you can set the +option `register_global_module_table` to `true`. The module table will +then be saved in the global variable with the name given by the option +`global_module_name`. + Exported functions and values: `json.encode (object [, state])` @@ -105,7 +113,7 @@ You can use this value for setting explicit `null` values. `json.version` -------------- -Set to `"dkjson 2.2"`. +Set to `"dkjson 2.4"`. `json.quotestring (string)` --------------------------- @@ -159,12 +167,12 @@ This variable is set to `true` when LPeg was loaded successfully. Contact ------- -You can contact the author by sending an e-mail to 'kolf' at the -e-mail provider 'gmx.de'. +You can contact the author by sending an e-mail to 'david' at the +domain 'dkolf.de'. --------------------------------------------------------------------- -*Copyright (C) 2010, 2011, 2012 David Heiko Kolf* +*Copyright (C) 2010-2013 David Heiko Kolf* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -192,7 +200,7 @@ SOFTWARE. it isn't a valid HTML comment (and wastes space). --> -