-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #696: Allow for multiple hooks. Note that last one in list sets th…
…e result value on return
- Loading branch information
Robert McLay
committed
Mar 11, 2024
1 parent
b4f55e2
commit 6156d76
Showing
16 changed files
with
220 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local hook = require("Hook") | ||
|
||
require("test_hooks") | ||
|
||
hook.register("load",load_hook_a,"append") | ||
hook.register("load",load_hook_b,"append") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../test_hooks.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
step 1 | ||
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version | ||
=========================== | ||
Modules based on Lua: Version 8.6.9 2022-02-02 11:25 -04:00 | ||
Modules based on Lua: Version 8.7.34 2024-01-05 19:34 -07:00 | ||
by Robert McLay [email protected] | ||
=========================== | ||
step 2 | ||
|
@@ -12,3 +12,27 @@ lua ProjectDIR/src/lmod.in.lua shell --regression_testing use -a ProjectDIR/rt/h | |
step 3 | ||
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load admin intel | ||
=========================== | ||
Load hook B called on admin | ||
Load hook B called on intel | ||
=========================== | ||
step 4 | ||
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load admin intel | ||
=========================== | ||
Load hook B called on admin | ||
Load hook B called on intel | ||
=========================== | ||
step 5 | ||
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load admin intel | ||
=========================== | ||
Load hook A called on admin | ||
Load hook B called on admin | ||
Load hook A called on intel | ||
Load hook B called on intel | ||
=========================== | ||
step 6 | ||
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load admin intel | ||
=========================== | ||
Load hook B called on admin | ||
Load hook A called on admin | ||
Load hook B called on intel | ||
Load hook A called on intel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
local hook = require("Hook") | ||
|
||
require("test_hooks") | ||
|
||
hook.register("load",load_hook_a) | ||
hook.register("load",load_hook_b) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../test_hooks.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local hook = require("Hook") | ||
|
||
require("test_hooks") | ||
|
||
hook.register("load",load_hook_a,"prepend") | ||
hook.register("load",load_hook_b,"prepend") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../test_hooks.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local hook = require("Hook") | ||
|
||
require("test_hooks") | ||
|
||
hook.register("load",load_hook_a,"replace") | ||
hook.register("load",load_hook_b,"replace") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../test_hooks.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function load_hook_a(t) | ||
local frameStk = require("FrameStk"):singleton() | ||
local mt = frameStk:mt() | ||
local simpleName = string.match(t.modFullName, "(.-)/") | ||
LmodMessage("Load hook A called on " .. simpleName) | ||
end | ||
|
||
function load_hook_b(t) | ||
local frameStk = require("FrameStk"):singleton() | ||
local mt = frameStk:mt() | ||
local simpleName = string.match(t.modFullName, "(.-)/") | ||
LmodMessage("Load hook B called on " .. simpleName) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters