{"action":"opened","issue":{"url":"https://api.github.com/repos/domoticz/domoticz/issues/931","repository_url":"https://api.github.com/repos/domoticz/domoticz","labels_url":"https://api.github.com/repos/domoticz/domoticz/issues/931/labels{/name}","comments_url":"https://api.github.com/repos/domoticz/domoticz/issues/931/comments","events_url":"https://api.github.com/repos/domoticz/domoticz/issues/931/events","html_url":"https://github.com/domoticz/domoticz/issues/931","id":184759120,"number":931,"title":"Support LuaRocks","user":{"login":"dantman","id":53399,"avatar_url":"https://avatars.githubusercontent.com/u/53399?v=3","gravatar_id":"","url":"https://api.github.com/users/dantman","html_url":"https://github.com/dantman","followers_url":"https://api.github.com/users/dantman/followers","following_url":"https://api.github.com/users/dantman/following{/other_user}","gists_url":"https://api.github.com/users/dantman/gists{/gist_id}","starred_url":"https://api.github.com/users/dantman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantman/subscriptions","organizations_url":"https://api.github.com/users/dantman/orgs","repos_url":"https://api.github.com/users/dantman/repos","events_url":"https://api.github.com/users/dantman/events{/privacy}","received_events_url":"https://api.github.com/users/dantman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-24T06:29:38Z","updated_at":"2016-10-24T06:29:38Z","closed_at":null,"body":"I think it would be a good idea to support modules installed via LuaRocks when luarocks is installed.\r\n\r\n----\r\n\r\nThe current situation of library usage in Lua seems to be well demonstrated with this wiki page, which seems to be the expected way of getting access to a JSON parsing library.\r\nhttps://www.domoticz.com/wiki/Lua_-_json.lua\r\n\r\nThe problems with this approach:\r\n* The code is out of date (wiki:20141223.14, current:20160916.19)\r\n* Of the many json implementations in lua, there are others with less bugs encoding/decoding mistakes (http://lua-users.org/wiki/JsonModules; dkjson or lua-cjson appear to be the preferred JSON libraries)\r\n* Exact paths specific to the installation/OS/etc are used; so this technique doesn't work well for Smart Lua Scripts wanting JSON\r\n\r\nInstead of telling users to download a file each time, it would probably be better let Smart Lua Scripts `require` the ones needed and tell the user how to install the necessary modules from luarocks.\r\n\r\n----\r\n\r\nThe primary change needed seems to be making sure that when luarocks is installed Domoticz gets the right LUA_PATH to execute scripts with so that `require` knows where to look.\r\n\r\nBut as an extra, it would also be nice if the prebuilt Raspberry PI image came with the `luarocks` deb package pre-installed."}}
{"actor":{"display_login":"dantman"}}