Software /
code /
verse
Comparison
squishy @ 504:8ed3c95bf880
squishy: Move the verse namespace prefix into a single place
Less repetition
Seemed weird that ProsodyModule = VerseModule
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 23 Jun 2023 22:21:05 +0200 |
parent | 503:395ae8df5a9e |
comparison
equal
deleted
inserted
replaced
503:395ae8df5a9e | 504:8ed3c95bf880 |
---|---|
1 Output "verse.lua" | 1 Output "verse.lua" |
2 | 2 |
3 local VerseModule = Module | 3 local function VerseModule(s) |
4 return Module("verse."..s); | |
5 end | |
4 local function ProsodyModule(s) | 6 local function ProsodyModule(s) |
5 return VerseModule("prosody." .. s) | 7 return Module("prosody." .. s) |
6 end | 8 end |
7 | 9 |
8 function ProsodyModules() | 10 function ProsodyModules() |
9 local Module = ProsodyModule; | 11 local Module = ProsodyModule; |
10 | 12 |
108 "archive"; | 110 "archive"; |
109 "browsing"; | 111 "browsing"; |
110 } | 112 } |
111 | 113 |
112 for _, plugin in ipairs(plugins) do | 114 for _, plugin in ipairs(plugins) do |
113 VerseModule("verse.plugins." .. plugin)("plugins/" .. plugin .. ".lua") | 115 VerseModule("plugins." .. plugin)("plugins/" .. plugin .. ".lua") |
114 end | 116 end |
115 | 117 |
116 -- Verse-specific versions of libraries | 118 -- Verse-specific versions of libraries |
117 VerseModule "verse.util.adhoc" "libs/adhoc.lib.lua" | 119 VerseModule "util.adhoc" "libs/adhoc.lib.lua" |
118 VerseModule "verse.util.bit" "libs/bit.lua" | 120 VerseModule "util.encodings" "libs/encodings.lua" |
119 VerseModule "verse.util.encodings" "libs/encodings.lua" | 121 VerseModule "util.hashes" "libs/hashes.lua" |
120 VerseModule "verse.util.hashes" "libs/hashes.lua" | 122 VerseModule "util.table" "libs/table.lua" |
121 VerseModule "verse.util.table" "libs/table.lua" | 123 VerseModule "util.vcard" "util/vcard.lua" |
122 VerseModule "verse.util.vcard" "util/vcard.lua" | |
123 | 124 |
124 VerseModule "verse.server" "server.lua" | 125 VerseModule "server" "server.lua" |
125 | 126 |
126 -- SASL client mechanisms | 127 -- SASL client mechanisms |
127 VerseModule "verse.util.sasl.scram" "util/sasl/scram.lua" | 128 VerseModule "util.sasl.scram" "util/sasl/scram.lua" |
128 VerseModule "verse.util.sasl.plain" "util/sasl/plain.lua" | 129 VerseModule "util.sasl.plain" "util/sasl/plain.lua" |
129 VerseModule "verse.util.sasl.anonymous" "util/sasl/anonymous.lua" | 130 VerseModule "util.sasl.anonymous" "util/sasl/anonymous.lua" |
130 VerseModule "verse.util.sasl.oauthbearer" "util/sasl/oauthbearer.lua" | 131 VerseModule "util.sasl.oauthbearer" "util/sasl/oauthbearer.lua" |
131 | 132 |
132 VerseModule "verse.client" "client.lua" | 133 VerseModule "client" "client.lua" |
133 VerseModule "verse.component" "component.lua" | 134 VerseModule "component" "component.lua" |
134 VerseModule "verse.bosh" "bosh.lua" | 135 VerseModule "bosh" "bosh.lua" |
135 | 136 |
136 if GetOption "internal-bit-module" then | 137 if GetOption "internal-bit-module" then |
137 Module "bit" "libs/bit.lua" | 138 Module "bit" "libs/bit.lua" |
138 end | 139 end |
139 | 140 |