Avançar para o conteúdo principal

post


Code review was in order last week, and some major improvements were made regarding my pseudo-spaghetti code, which now should be more readable and maintainable. Check out the complete list of changes made, in order to polish the Installer!

Events

prosodyctl

1: Swapped prints for the show_message function
2: Removed a comment from the remove command
3: Rewrote the install command
4: rewrote the remove command
5: Rewrote the list command, to make it cleaner and easier to work with
6: Install, remove and list now use the execute_command instead
7: removed the auxiliary command enabled_plugins

core/configmanager

1: Added support to complement_lua_path

util//prosodyctl

1: added the check_flags function - changeset
2: added the call_luarocks function
3: call_luarocks command differentiates output, when being called by install/remove
4: the call_luarocks function can now also deal with the list command
5: Added the execute_command function
6: check_flags now always consider that the plugin is specified at the penultimate argument that it receives
7: changed a comment

util/startup

1: The setup_plugindir function now uses the resolve_relative_path function
2: setup_plugindir now uses lfs.mkdir to check/create directories
3: removed/rewrote comments at setup_plugindir
4: removed redundant variable
5: Now also check cpath for duplicates
6: Now uses complement_lua_path to deal with lua's path/cpath
7: Reorganized some code at setup_plugindir

util/paths

1: Added the function complement_lua_path
2: Refactored a variable, to avoid shadowing

Miscellaneous

make_repo: moved make_repo script into the tools/directory

Difficulties/Considerations

Nothing too special this week on the technical side, but time was cut a bit shorter due to personal reasons, so I need to do some catchup again! Google is stressing that deadlines are around, and time is flying reaaaaaaally fast.
The most important objective of cleaning code was given priority, and I think a good effort was made towards it. Some minor issues (So far) are still lying around, but documentation needs to be given a serious tackle.

Future goals

At the very least this week, the main focus should be on documentation and a couple of hours debugging some areas I believe might give problems.

Comentários

Mensagens populares deste blogue

Sailing!

After some fusion dance, we have some stuff working neatly! Last week was all about the lua environment and improvements aimed at user-friendliness, which you can check down below with latest changesets and demos. Events prosodyctl Removed most development / experimental commands Created a script that is automatically setting up a ready to be served repository will rockspecs for all of prosody's plugins ( demo ) Various improvements/updates to the main commands: list - demo install demos: installing a prosody plugin installing a luarocks library Installation also prints configuration help   remove - demo prosody uses a separate folder to deal with non-standard plugins - demo Users can configure their own path, and override it at any time from the command line if needed - demo Updated the startup utility script regarding management of default/custom installer directories and lua environment Difficulties The greatest obstacles this past week were ...
Prosody's plugin installer is making use of Luarocks to get things working. Therefore, it makes sense that we look a bit into Luarocks to see how it works. Concepts Here is what you need to know. Luarocks uses files, called rockspecs, to get things installed around. These are basically instruction files and they tell the program how to do the work. We can pack the sources and the rockspecs into a single file, called a rock. We can install libraries from both rocks and rockspec files. The code is installed in what is called a rock tree, which is a folder with a specific structure inside, organized in a way to help with the required management of libraries and servers. Installing, removing and list If you are working on debian you can just use: sudo apt-get install luarocks Now, there might be some trouble here and there, depending on your machine, or if you are in a different OS, but the guys at luarocks have tips for almost every possible situation, just che...
Prosody's plugin installer is making use of Luarocks to work underneath the hood. Therefore, it makes sense that we look a bit into Luarocks to see how it works. Concepts Here is what you need to know. From the perspective of Luarocks, Lua Libraries are files called Rocks. Rock files are like a zip file, in the sense that inside there are many files. Most of those files are the sources, which means those are the files that have all the code itself. And then there is a rockspec file. This is like an instruction file, written in Lua, which contains the important information that Luarocks needs to do its job. Things like the location of sources, dependencies and build instructions. The code is then installed in what is called a rock tree. A normal folder, in other words. But this folder is referenced on luarocks documentation, for example, so that things know where to look for when they need to use a particular library. Installing, removing as list If you ...